Skip to content
Build and run Docker containers leveraging NVIDIA GPUs
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github Update template issue to include nvidia-container-cli informations Dec 20, 2018
debian Fix DISTRIB, add changelog for a stable release date Mar 9, 2018
rpm Pave the way for a hypothetical transitional package from v1 Feb 22, 2018
.dockerignore Add .dockerignore Nov 17, 2017
.gitignore Merge branch '2.0' Nov 14, 2017
CLA
Dockerfile.amzn Update Makefile for CI Feb 11, 2019
Dockerfile.centos Update Makefile for CI Feb 11, 2019
Dockerfile.debian Update Makefile for CI Feb 11, 2019
Dockerfile.ubuntu Update Makefile for CI Feb 11, 2019
LICENSE Document the 2.0 alpha release Oct 7, 2017
Makefile Add support for 18.09.2 and 18.06.2 Feb 11, 2019
README.md Add changelog for CVE-2019-5736 Feb 12, 2019
daemon.json Use relative path for nvidia-container-runtime Jun 18, 2018
nvidia-docker Set version to 2.0.3 Feb 23, 2018

README.md

NVIDIA Container Runtime for Docker

GitHub license Documentation Package repository

nvidia-gpu-docker

Documentation

The full documentation and frequently asked questions are available on the repository wiki.

An introduction to the NVIDIA Container Runtime is also covered in our blog post.

Quickstart

Make sure you have installed the NVIDIA driver and a supported version of Docker for your distribution (see prerequisites).

If you have a custom /etc/docker/daemon.json, the nvidia-docker2 package might override it.

Ubuntu 14.04/16.04/18.04, Debian Jessie/Stretch

Ubuntu will install docker.io by default which isn't the latest version of Docker Engine. This implies that you will need to pin the version of nvidia-docker. See more information here.

# If you have nvidia-docker 1.0 installed: we need to remove it and all existing GPU containers
docker volume ls -q -f driver=nvidia-docker | xargs -r -I{} -n1 docker ps -q -a -f volume={} | xargs -r docker rm -f
sudo apt-get purge -y nvidia-docker

# Add the package repositories
curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | \
  sudo apt-key add -
distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
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

# Install nvidia-docker2 and reload the Docker daemon configuration
sudo apt-get install -y nvidia-docker2
sudo pkill -SIGHUP dockerd

# Test nvidia-smi with the latest official CUDA image
docker run --runtime=nvidia --rm nvidia/cuda:9.0-base nvidia-smi

CentOS 7 (docker-ce), RHEL 7.4/7.5 (docker-ce), Amazon Linux 1/2

If you are not using the official docker-ce package on CentOS/RHEL, use the next section.

# If you have nvidia-docker 1.0 installed: we need to remove it and all existing GPU containers
docker volume ls -q -f driver=nvidia-docker | xargs -r -I{} -n1 docker ps -q -a -f volume={} | xargs -r docker rm -f
sudo yum remove nvidia-docker

# Add the package repositories
distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.repo | \
  sudo tee /etc/yum.repos.d/nvidia-docker.repo

# Install nvidia-docker2 and reload the Docker daemon configuration
sudo yum install -y nvidia-docker2
sudo pkill -SIGHUP dockerd

# Test nvidia-smi with the latest official CUDA image
docker run --runtime=nvidia --rm nvidia/cuda:9.0-base nvidia-smi

If yum reports a conflict on /etc/docker/daemon.json with the docker package, you need to use the next section instead.

For docker-ce on ppc64le, look at the FAQ.

CentOS 7 (docker), RHEL 7.4/7.5 (docker)

# If you have nvidia-docker 1.0 installed: we need to remove it and all existing GPU containers
docker volume ls -q -f driver=nvidia-docker | xargs -r -I{} -n1 docker ps -q -a -f volume={} | xargs -r docker rm -f
sudo yum remove nvidia-docker

# Add the package repositories
distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
curl -s -L https://nvidia.github.io/nvidia-container-runtime/$distribution/nvidia-container-runtime.repo | \
  sudo tee /etc/yum.repos.d/nvidia-container-runtime.repo

# Install the nvidia runtime hook
sudo yum install -y nvidia-container-runtime-hook

# Test nvidia-smi with the latest official CUDA image
# You can't use `--runtime=nvidia` with this setup.
docker run --rm nvidia/cuda:9.0-base nvidia-smi

Other distributions and architectures

Look at the Installation section of the wiki.

Changelog

New nvidia-docker packages have been released for docker 18.09.2 and 18.06.2 addressing CVE-2019-5736

Update nvidia-docker to adress runc critical vulnerability that allows specially-crafted containers to gain administrative privileges on the host.

# On Ubuntu/Debian
sudo apt upgrade

# On Centos/RHEL/Amazon Linux
sudo yum upgrade

Issues and Contributing

A signed copy of the Contributor License Agreement needs to be provided to digits@nvidia.com before any change can be accepted.

You can’t perform that action at this time.