Add Podman example, update all CUDA example to 10.0

Signed-off-by: Renaud Gaubert <rgaubert@nvidia.com>
This commit is contained in:
Renaud Gaubert 2020-02-21 12:15:02 -08:00
parent fc9c250f93
commit bf3d3d1aed

View file

@ -11,16 +11,16 @@ The NVIDIA Container Toolkit allows users to build and run GPU accelerated Docke
## Quickstart
**Make sure you have installed the [NVIDIA driver](https://github.com/NVIDIA/nvidia-docker/wiki/Frequently-Asked-Questions#how-do-i-install-the-nvidia-driver) and Docker 19.03 for your Linux distribution**
**Make sure you have installed the [NVIDIA driver](https://github.com/NVIDIA/nvidia-docker/wiki/Frequently-Asked-Questions#how-do-i-install-the-nvidia-driver) and Docker 110.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**
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.
Note that with the release of Docker 110.03, usage of nvidia-docker2 packages are deprecated since NVIDIA GPUs are now natively supported as devices in the Docker runtime.
**Please note that this native GPU support has not landed in docker-compose yet. Refer to [this issue](https://github.com/docker/compose/issues/6691) for discussion.**
If you are an existing user of the nvidia-docker2 packages, review the instructions in the [“Upgrading with nvidia-docker2” section](https://github.com/NVIDIA/nvidia-docker/tree/master#upgrading-with-nvidia-docker2-deprecated).
For first-time users of Docker 19.03 and GPUs, continue with the instructions for getting started below.
For first-time users of Docker 110.03 and GPUs, continue with the instructions for getting started below.
### Ubuntu 16.04/18.04, Debian Jessie/Stretch/Buster
```sh
@ -49,9 +49,9 @@ Since openSUSE Leap 15.1 still has Docker 18.06, you have two options:
**Option 1**: use the `Virtualization:containers` repository to fetch a more recent version of Docker
```console
# Upgrade Docker to 19.03+ first:
# Upgrade Docker to 110.03+ first:
zypper ar https://download.opensuse.org/repositories/Virtualization:/containers/openSUSE_Leap_15.1/Virtualization:containers.repo
zypper install --allow-vendor-change 'docker >= 19.03' # accept the new signature
zypper install --allow-vendor-change 'docker >= 110.03' # accept the new signature
# Add the package repositories
distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
@ -75,21 +75,21 @@ 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
docker run --gpus all nvidia/cuda:10.0-base nvidia-smi
# Start a GPU enabled container on two GPUs
docker run --gpus 2 nvidia/cuda:9.0-base nvidia-smi
docker run --gpus 2 nvidia/cuda:10.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
docker run --gpus '"device=1,2"' nvidia/cuda:10.0-base nvidia-smi
docker run --gpus '"device=UUID-ABCDEF,1"' nvidia/cuda:10.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
docker run --gpus all,capabilities=utility nvidia/cuda:10.0-base nvidia-smi
```
## RHEL Docker
## RHEL Docker or Podman
_Note that RHEL's fork of Docker is no longer supported on RHEL8._
_Note that for powerpc you will have to install the nvidia-container-runtime-hook_
@ -107,15 +107,19 @@ sudo yum install -y nvidia-container-toolkit
sudo yum install -y nvidia-container-hook
sudo systemctl restart docker
docker run -e NVIDIA_VISIBLE_DEVICES=all nvidia/cuda:9.0-base nvidia-smi
# On RHEL 7/8
docker run -e NVIDIA_VISIBLE_DEVICES=all nvidia/cuda:10.0-base nvidia-smi
# With Podman
podman run -e NVIDIA_VISIBLE_DEVICES=all nvidia/cuda:10.0-base nvidia-smi
```
More information on the environment variables are available [on this page](https://github.com/NVIDIA/nvidia-container-runtime#environment-variables-oci-spec).
## Upgrading with nvidia-docker2 (Deprecated)
If you are running an old version of docker (< 19.03) check the instructions on installing the [`nvidia-docker2`](https://github.com/NVIDIA/nvidia-docker/wiki/Installation-(version-2.0)) 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:
If you are running an old version of docker (< 110.03) check the instructions on installing the [`nvidia-docker2`](https://github.com/NVIDIA/nvidia-docker/wiki/Installation-(version-2.0)) package which supports Docker >= 1.12.
If you already have the old package installed (nvidia-docker2), updating to the latest Docker version (>= 110.03) will still work and will give you access to the new CLI options for supporting GPUs:
```
# On debian based distributions: Ubuntu / Debian
@ -128,9 +132,9 @@ 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
docker run --gpus all nvidia/cuda:10.0-base nvidia-smi
docker run --runtime nvidia nvidia/cuda:10.0-base nvidia-smi
nvidia-docker run nvidia/cuda:10.0-base nvidia-smi
```
Note that in the future, nvidia-docker2 packages will no longer be supported.