Make installation instructions more generic

This commit is contained in:
Felix Abecassis 2018-03-15 16:21:16 -07:00
parent d77d8c1815
commit 0555a5ef44

View file

@ -16,7 +16,7 @@ The full documentation and frequently asked questions are available on the [repo
**If you have a custom `/etc/docker/daemon.json`, the `nvidia-docker2` package might override it.**
#### Xenial x86_64
#### Ubuntu 14.04/16.04, Debian Jessie/Stretch
```sh
# 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
@ -25,7 +25,8 @@ 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 -
curl -s -L https://nvidia.github.io/nvidia-docker/ubuntu16.04/amd64/nvidia-docker.list | \
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
@ -37,7 +38,7 @@ sudo pkill -SIGHUP dockerd
docker run --runtime=nvidia --rm nvidia/cuda nvidia-smi
```
#### CentOS/RHEL 7 x86_64
#### CentOS 7, RHEL 7.4, Amazon Linux 2
```sh
# If you have nvidia-docker 1.0 installed: we need to remove it and all existing GPU containers
@ -45,7 +46,8 @@ docker volume ls -q -f driver=nvidia-docker | xargs -r -I{} -n1 docker ps -q -a
sudo yum remove nvidia-docker
# Add the package repositories
curl -s -L https://nvidia.github.io/nvidia-docker/centos7/x86_64/nvidia-docker.repo | \
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