2017-07-22 21:54:03 +02:00
# Docker Engine Utility for NVIDIA GPUs
2015-11-17 01:33:03 +01:00
2017-10-07 02:50:12 +02:00
[![GitHub license ](https://img.shields.io/badge/license-New%20BSD-blue.svg?style=flat-square )](https://raw.githubusercontent.com/NVIDIA/nvidia-docker/master/LICENSE)
2017-11-17 00:31:02 +01:00
[![Documentation ](https://img.shields.io/badge/documentation-wiki-blue.svg?style=flat-square )](https://github.com/NVIDIA/nvidia-docker/wiki)
2017-10-07 02:50:12 +02:00
[![Package repository ](https://img.shields.io/badge/packages-repository-b956e8.svg?style=flat-square )](https://nvidia.github.io/nvidia-docker)
2017-10-07 02:59:46 +02:00
2016-01-09 10:13:34 +01:00
![nvidia-gpu-docker ](https://cloud.githubusercontent.com/assets/3028125/12213714/5b208976-b632-11e5-8406-38d379ec46aa.png )
2015-11-17 01:33:03 +01:00
2017-11-14 06:10:52 +01:00
**Warning: This project is based on an alpha release (libnvidia-container). It is already more stable than 1.0 but we need help testing it.**
2015-11-04 21:55:32 +01:00
2017-11-15 04:17:12 +01:00
# Documentation
2017-07-22 21:54:03 +02:00
2017-11-17 00:31:02 +01:00
The full documentation and frequently asked questions are available on the [repository wiki ](https://github.com/NVIDIA/nvidia-docker/wiki ).
2015-11-04 21:55:32 +01:00
2017-11-15 04:17:12 +01:00
## Quickstart
2015-11-21 03:08:10 +01:00
2017-11-17 00:31:02 +01:00
**If you have a custom `/etc/docker/daemon.json` , the `nvidia-docker2` package might override it.**
2016-03-29 03:31:56 +02:00
2017-11-15 04:17:12 +01:00
#### Xenial x86_64
```sh
2017-11-17 00:31:02 +01:00
# If you have nvidia-docker 1.0 installed: we need to remove it and all existing GPU containers
2017-10-07 02:50:12 +02:00
docker volume ls -q -f driver=nvidia-docker | xargs -r -I{} -n1 docker ps -q -a -f volume={} | xargs -r docker rm -f
2017-11-15 04:17:12 +01:00
sudo apt-get purge -y nvidia-docker
2016-03-29 03:31:56 +02:00
2017-11-15 04:17:12 +01:00
# 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 | \
sudo tee /etc/apt/sources.list.d/nvidia-docker.list
sudo apt-get update
2017-10-07 02:50:12 +02:00
2017-11-17 00:31:02 +01:00
# Install nvidia-docker2 and reload the Docker daemon configuration
2017-11-15 04:17:12 +01:00
sudo apt-get install -y nvidia-docker2
2017-10-07 02:50:12 +02:00
sudo pkill -SIGHUP dockerd
2016-03-29 03:31:56 +02:00
2017-11-17 00:31:02 +01:00
# Test nvidia-smi with the latest official CUDA image
2017-10-07 02:50:12 +02:00
docker run --runtime=nvidia --rm nvidia/cuda nvidia-smi
```
2017-11-15 04:17:12 +01:00
#### CentOS/RHEL 7 x86_64
2017-10-07 02:50:12 +02:00
2017-11-15 04:17:12 +01:00
```sh
2017-11-17 00:31:02 +01:00
# If you have nvidia-docker 1.0 installed: we need to remove it and all existing GPU containers
2017-11-15 04:17:12 +01:00
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
2017-10-07 02:50:12 +02:00
2017-11-15 04:17:12 +01:00
# Add the package repositories
curl -s -L https://nvidia.github.io/nvidia-docker/centos7/x86_64/nvidia-docker.repo | \
sudo tee /etc/yum.repos.d/nvidia-docker.repo
2017-10-07 02:50:12 +02:00
2017-11-17 00:31:02 +01:00
# Install nvidia-docker2 and reload the Docker daemon configuration
2017-11-15 04:17:12 +01:00
sudo yum install -y nvidia-docker2
sudo pkill -SIGHUP dockerd
2017-10-07 02:50:12 +02:00
2017-11-17 00:31:02 +01:00
# Test nvidia-smi with the latest official CUDA image
2017-11-15 04:17:12 +01:00
docker run --runtime=nvidia --rm nvidia/cuda nvidia-smi
```
2015-11-04 21:55:32 +01:00
2017-11-15 04:17:12 +01:00
#### Other distributions and architectures
2017-04-28 18:54:26 +02:00
2017-11-15 04:17:12 +01:00
Look at the [Installation section ](https://github.com/nvidia/nvidia-docker/wiki/Installation-(version-2.0 )) of the wiki.
2017-04-28 18:54:26 +02:00
2017-10-07 02:50:12 +02:00
## Issues and Contributing
2015-11-04 21:55:32 +01:00
2017-10-07 02:50:12 +02:00
A signed copy of the [Contributor License Agreement ](https://raw.githubusercontent.com/NVIDIA/nvidia-docker/master/CLA ) needs to be provided to < a href = "mailto:digits@nvidia.com" > digits@nvidia.com</ a > before any change can be accepted.
2015-11-04 21:55:32 +01:00
* Please let us know by [filing a new issue ](https://github.com/NVIDIA/nvidia-docker/issues/new )
2016-01-09 10:13:34 +01:00
* You can contribute by opening a [pull request ](https://help.github.com/articles/using-pull-requests/ )