Install Nvidia Container Toolkit
-
On Windows, open the Ubuntu subsystem terminal; on Linux, just open the terminal.
-
Follow the instructions in the formal website and use “apt” to install the NVIDIA Container Toolkit.
-
Just in case, I record the installation process I did below:
-
Configure the production repository:
$ curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg \ && curl -s -L https://nvidia.github.io/libnvidia-container/stable/deb/nvidia-container-toolkit.list | \ sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' | \ sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list
-
Update the packages list from the repository:
$ sudo apt-get update
-
Install the NVIDIA Container Toolkit packages:
$ sudo apt-get install -y nvidia-container-toolkit
-
Configure the container runtime by using the
nvidia-ctk
command:$ sudo nvidia-ctk runtime configure --runtime=docker
-
Restart the Docker daemon:
$ sudo systemctl restart docker
May not work on Windows. Please reopen the Docker Desktop and reopen the terminal, the settings will work fine.
-