3.6 GPUs with Docker
Running a sample GPU container to prove the whole chain works.
Key points
A sample workload proves the whole chain works: driver, toolkit and Docker. NVIDIA runs nvidia-smi inside an ubuntu container with '--gpus all'. If the container prints the GPU table, Docker can use the GPUs.
What NVIDIA says (1)
“sudo docker run --rm --runtime=nvidia --gpus all ubuntu nvidia-smi”
A sample workload proves the whole chain works: driver, toolkit, runtime and Docker. If nvidia-smi inside the container lists the GPUs, the setup is right.
What NVIDIA says (2)
“you can verify your installation by running a sample workload.”
“sudo docker run --rm --runtime=nvidia --gpus all ubuntu nvidia-smi”
Key terms
- NVIDIA Container Toolkit: The software that lets containers use the host GPUs; nvidia-ctk configures Docker or containerd for it.
Try it
Sample question
Which command does NVIDIA use to confirm Docker can see the GPUs after installing the toolkit and driver?
Show the answer
Answer: sudo docker run --rm --runtime=nvidia --gpus all ubuntu nvidia-smi
A sample workload proves the whole chain works: driver, toolkit and Docker. NVIDIA runs nvidia-smi inside an ubuntu container with '--gpus all'. If the container prints the GPU table, Docker can use the GPUs.
What NVIDIA says (1)
“sudo docker run --rm --runtime=nvidia --gpus all ubuntu nvidia-smi”
Practice 3.6 (2 questions) Full Control Plane Installation and Configuration guide