Go to file
2018-06-18 14:50:46 -07:00
.github Add ISSUE_TEMPLATE 2017-11-16 16:55:42 -08:00
debian Fix DISTRIB, add changelog for a stable release date 2018-03-08 17:19:33 -08:00
rpm Pave the way for a hypothetical transitional package from v1 2018-02-21 20:39:30 -08:00
.dockerignore Add .dockerignore 2017-11-16 21:20:38 -08:00
.gitignore Merge branch '2.0' 2017-11-13 21:10:52 -08:00
CLA Re-add CLA 2017-11-14 21:27:40 -08:00
daemon.json Use relative path for nvidia-container-runtime 2018-06-18 14:50:46 -07:00
Dockerfile.amzn Refactor Makefile 2018-03-06 21:09:42 -08:00
Dockerfile.centos Refactor Makefile 2018-03-06 21:09:42 -08:00
Dockerfile.debian Fix DISTRIB, add changelog for a stable release date 2018-03-08 17:19:33 -08:00
Dockerfile.ubuntu Fix DISTRIB, add changelog for a stable release date 2018-03-08 17:19:33 -08:00
LICENSE Document the 2.0 alpha release 2017-10-06 17:50:12 -07:00
Makefile Add support for Docker 18.03.1 on Amazon Linux 1 2018-06-12 13:28:44 -07:00
nvidia-docker Set version to 2.0.3 2018-02-22 16:28:50 -08:00
README.md Update README.md 2018-06-06 19:10:17 -07:00

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

# 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 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 nvidia-smi

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

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
sudo mkdir -p /usr/libexec/oci/hooks.d
echo -e '#!/bin/sh\nPATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" exec nvidia-container-runtime-hook "$@"' | \
  sudo tee /usr/libexec/oci/hooks.d/nvidia
sudo chmod +x /usr/libexec/oci/hooks.d/nvidia

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

For ppc64le, look at the FAQ.

Other distributions and architectures

Look at the Installation section of the wiki.

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.