Cover image for Install Docker and NVIDIA container

Install Docker and NVIDIA container

et813 profile image Ethan ・2 min read


Install Docker, NVIDIA Containter Toolkit.


Check OS

cat /etc/lsb-release

Check GPU

cat /etc/lsb-release 

OS: Ubuntu 18.04
GPU: GeFOrce RTX 2070

Installation of Docker


Refer the step docker docs

Set up the repository

sudo apt-get update
sudo apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common

Add Docker's official GPG key

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

Verify that I have key with the fingerpront.

sudo apt-key fingerprint 0EBFCD88

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 docker-ce docker-ce-cli containerd.io

Verify that Docker Engine is installed correctly

sudo docker run hello-world
docker -v

Installation of NVIDIA conatiner

Refer the step nvida Container Toolkit

This is the NVIDIA Containter Tool kit system:

Alt Text

According to the site,
"Make sure you have installed the NVIDIA driver and Docker 19.03 for your Linux distribution Note that you do not need to install the CUDA toolkit on the host, but the driver needs to be installed.

In my case, CUDA toolkit has been already installed.
Then, I skipped this step.

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

sudo apt-get update && sudo apt-get install -y nvidia-container-toolkit
sudo systemctl restart docker


sudo reboot

Check installation

nvidia-container-cli info


docker run --gpus all nvidia/cuda nvidia-smi

I confirmed that nvidia-smi worked.

How to use docker:


Posted on May 23 by:

et813 profile



I'm interested in computational photography, deep learning, image processing.


markdown guide