# 查看所有 image docker image ls # REPOSITORY TAG IMAGE ID CREATED SIZE # ubuntu 16.04 005d2078bdfa 7 weeks ago 125MB
# 启动一个实例,以交互模式运行 docker container run -it ubuntu:16.04 # root@506f4389875e:/#
# 查看正在运行的实例(在另外一个shell中输入) docker container ls # CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES # 506f4389875e ubuntu:16.04 "/bin/bash" About a minute ago Up 10 seconds brave_hermann
# 运行 #### Test nvidia-smi with the latest official CUDA image docker run --gpus all nvidia/cuda:10.0-base nvidia-smi
# Start a GPU enabled container on two GPUs docker run --gpus 2 nvidia/cuda:10.0-base nvidia-smi
# Starting a GPU enabled container on specific GPUs docker run --gpus '"device=1,2"' nvidia/cuda:10.0-base nvidia-smi docker run --gpus '"device=UUID-ABCDEF,1"' nvidia/cuda:10.0-base nvidia-smi
# Specifying a capability (graphics, compute, ...) for my container # Note this is rarely if ever used this way docker run --gpus all,capabilities=utility nvidia/cuda:10.0-base nvidia-smi