Go to file
Renaud Gaubert 315b92b0b7 Fix nvidia-docker version
Signed-off-by: Renaud Gaubert <rgaubert@nvidia.com>
2019-08-12 14:42:31 -07:00
.github Update template issue to include nvidia-container-cli informations 2018-12-20 09:02:06 -08:00
debian Use the RUNTIME_VERSION variable defined in the Makefile 2019-07-22 16:11:32 -07:00
rpm Use the RUNTIME_VERSION variable defined in the Makefile 2019-07-22 16:11:32 -07: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 Fix nvidia-docker version 2019-08-12 14:42:31 -07:00
Dockerfile.centos Fix nvidia-docker version 2019-08-12 14:42:31 -07:00
Dockerfile.debian Fix nvidia-docker version 2019-08-12 14:42:31 -07:00
Dockerfile.ubuntu Fix nvidia-docker version 2019-08-12 14:42:31 -07:00
LICENSE Document the 2.0 alpha release 2017-10-06 17:50:12 -07:00
Makefile Bump the version to 2.2.0 2019-07-23 16:44:50 -07:00
nvidia-docker Fix nvidia-docker version 2019-08-12 14:42:31 -07:00
README.md Replace duplicate quickstart 2019-07-25 16:53:35 -07:00

NVIDIA Container Toolkit

GitHub license Documentation Package repository

nvidia-gpu-docker

Introduction

The NVIDIA Container Toolkit allows users to build and run GPU accelerated Docker containers. The toolkit includes a container runtime library and utilities to automatically configure containers to leverage NVIDIA GPUs. Full documentation and frequently asked questions are available on the repository wiki.

Quickstart

Make sure you have installed the NVIDIA driver and Docker 19.03 for your Linux distribution

Note that with the release of Docker 19.03, usage of nvidia-docker2 packages are deprecated since NVIDIA GPUs are now natively supported as devices in the Docker runtime. If you are an existing user of the nvidia-docker2 packages, review the instructions in the “Upgrading with nvidia-docker2” section.

For first-time users of Docker 19.03 and GPUs, continue with the instructions for getting started below.

Ubuntu 16.04/18.04, Debian Jessie/Stretch

# 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

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

$ 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

$ sudo yum install -y nvidia-container-toolkit
$ sudo systemctl restart docker

Usage

#### Test nvidia-smi with the latest official CUDA image
$ docker run --gpus all nvidia/cuda:9.0-base nvidia-smi

# Start a GPU enabled container on two GPUs
$ docker run --gpus 2 nvidia/cuda:9.0-base nvidia-smi

# Starting a GPU enabled container on specific GPUs
$ docker run --gpus '"device=1,2"' nvidia/cuda:9.0-base nvidia-smi
$ docker run --gpus '"device=UUID-ABCDEF,1'" nvidia/cuda:9.0-base nvidia-smi

# Specifying a capability (graphics, compute, ...) for my container
# Note this is rarely if ever used this way
$ docker run --gpus all,capabilities=utility nvidia/cuda:9.0-base nvidia-smi

Upgrading with nvidia-docker2 (Deprecated)

If you are running an old version of docker (< 19.03) check the instructions on installing the nvidia-docker2 package which supports Docker >= 1.12. If you already have the old package installed (nvidia-docker2), updating to the latest Docker version (>= 19.03) will still work and will give you access to the new CLI options for supporting GPUs:

# On debian based distributions: Ubuntu / Debian
$ sudo apt-get update
$ sudo apt-get --only-upgrade install docker-ce nvidia-docker2
$ sudo systemctl restart docker

# On RPM based distributions: Centos / RHEL / Amazon Linux
$ sudo yum upgrade -y nvidia-docker2
$ sudo systemctl restart docker

# All of the following options will continue working
$ docker run --gpus all nvidia/cuda:9.0-base nvidia-smi
$ docker run --runtime nvidia nvidia/cuda:9.0-base nvidia-smi
$ nvidia-docker run nvidia/cuda:9.0-base nvidia-smi

Note that in the future, nvidia-docker2 packages will no longer be supported.

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.