Skip to content

How to install NVIDIA Docker on Ubuntu 20.04

Adam Radocz edited this page Aug 2, 2020 · 1 revision

Install the Docker

Check the guide here.

Install the NVIDIA driver

For more details check out the NVIDIA Docker Docs.

Other guides:

Install and Activate the latest Driver

Currently the nvidia-390 the latest driver. There may be a newer version for you.

sudo apt update && sudo apt upgrade -y && \
sudo apt purge nvidia* -y && \
sudo add-apt-repository -y ppa:graphics-drivers && \
sudo apt update && \
sudo apt-get install -y nvidia-390

Restart the system

Test the NVIDIA driver

nvidia-smi

Install NVIDIA Docker

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 && \
sudo apt-get update && \
sudo apt-get install -y nvidia-container-toolkit && \
sudo systemctl restart docker

Test the NVIDIA Docker

sudo docker run --gpus all --rm nvidia/cuda:10.0-base nvidia-smi

Clone this wiki locally