Step #3: Installing Docker and Docker Utility Engine for NVIDIA GPUs
The NVIDIA Container Toolkit allows users to build and run GPU accelerated Docker containers. The toolkit includes a container runtime library and utilities to configure containers to leverage NVIDIA GPUs automatically. Complete documentation and frequently asked questions are available on the repository wiki.
First you will need to set up the repository.
You will need VM Console located on the left navigation pane. DO NOT USE the vCenter web console!
When connecting to the VM Console use the log in credentials created for the VM in Step #2 Create Your First NVIDIA AI Enterprise VM.
Update the apt package index with the command below:
$ sudo apt-get update
Install packages to allow apt to use a repository over HTTPS:
$ sudo apt-get install -y \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
software-properties-common
Next you will need to add Docker’s official GPG key with the command below:
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
Verify that you now have the key with the fingerprint 9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88, by searching for the last 8 characters of the fingerprint:
$ sudo apt-key fingerprint 0EBFCD88
pub rsa4096 2017-02-22 [SCEA]
9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88
uid [ unknown] Docker Release (CE deb) <docker@docker.com>
sub rsa4096 2017-02-22 [S]
Use the following command to set up the stable repository:
$ sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs)\
stable"
Install Docker Engine
$ sudo apt-get update
$ sudo apt-get install -y docker-ce docker-ce-cli containerd.io
Verify that Docker Engine - Community is installed correctly by running the hello-world image:
$ sudo docker run hello-world
More information on how to install Docker can be found here.
Make sure you have installed the NVIDIA driver and Docker 20.10 for your Linux distribution.
You do not need to install the CUDA toolkit on the host, but the driver needs to be installed.
With the release of Docker 19.03, usage of nvidia-docker2
packages is deprecated since NVIDIA GPUs are now natively supported as devices in the Docker runtime.
For first-time users of Docker 20.10 and GPUs, continue with the instructions for getting started below.
Add the package repositories:
$ distribution=$(. /etc/os-release;echo $ID$VERSION_ID) $ curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add - $ curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | sudo tee /etc/apt/sources.list.d/nvidia-docker.list
Download information from all configured sources about the latest versions of the packages and install the
nvidia-container-toolkit
package:$ sudo apt-get update && sudo apt-get install -y nvidia-container-toolkit
Restart the Docker service:
$ sudo systemctl restart docker
Remove sudo permissions for docker
$ sudo usermod -aG docker $USER
Close the ssh window in the browser and reopen the session again from the left pane of ITadmin main page.
Single GPU
#### Test nvidia-smi with the latest official CUDA image
$ sudo docker run --gpus all nvidia/cuda:11.0-base nvidia-smi