Document the 2.0 alpha release
This commit is contained in:
parent
e4ca89ea44
commit
b9294ab2b4
25
LICENSE
Normal file
25
LICENSE
Normal file
|
@ -0,0 +1,25 @@
|
|||
Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of NVIDIA CORPORATION nor the names of its
|
||||
contributors may be used to endorse or promote products derived
|
||||
from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
|
||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
||||
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
99
README.md
99
README.md
|
@ -1,3 +1,100 @@
|
|||
# Docker Engine Utility for NVIDIA GPUs
|
||||
|
||||
## Transition to version 2.0
|
||||
[![GitHub license](https://img.shields.io/badge/license-New%20BSD-blue.svg?style=flat-square)](https://raw.githubusercontent.com/NVIDIA/nvidia-docker/master/LICENSE)
|
||||
[![Package repository](https://img.shields.io/badge/packages-repository-b956e8.svg?style=flat-square)](https://nvidia.github.io/nvidia-docker)
|
||||
|
||||
![nvidia-gpu-docker](https://cloud.githubusercontent.com/assets/3028125/12213714/5b208976-b632-11e5-8406-38d379ec46aa.png)
|
||||
|
||||
This branch contains version 2.0 of the nvidia-docker utility.
|
||||
|
||||
**Warning: Version 2.0 is in alpha state, it is not intended to be used in production systems.**
|
||||
|
||||
## Differences with 1.0
|
||||
* Doesn't require wrapping the Docker CLI,
|
||||
* Doesn't require starting a separate daemon,
|
||||
* GPU isolation is now achieved with environment variable `NVIDIA_VISIBLE_DEVICES`,
|
||||
* Can enable GPU support for any Docker image. Not just the ones based on our official CUDA images,
|
||||
* Package repositories are available for Ubuntu and CentOS,
|
||||
* Uses a new implementation based on [libnvidia-container](https://github.com/NVIDIA/libnvidia-container).
|
||||
|
||||
## Removing nvidia-docker 1.0
|
||||
|
||||
Version 1.0 of the nvidia-docker package must be cleanly removed before continuing.
|
||||
You must stop and remove **all** containers started with nvidia-docker 1.0.
|
||||
|
||||
#### Ubuntu distributions
|
||||
```sh
|
||||
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 nvidia-docker
|
||||
```
|
||||
|
||||
#### CentOS distributions
|
||||
|
||||
```
|
||||
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
|
||||
```
|
||||
|
||||
## Installation
|
||||
|
||||
#### Ubuntu distributions
|
||||
|
||||
1. Install the repository for your distribution by following the instructions [here](http://nvidia.github.io/nvidia-docker/).
|
||||
2. Install the `nvidia-docker2` package and restart the Docker daemon:
|
||||
```
|
||||
sudo apt-get install nvidia-docker2
|
||||
sudo pkill -SIGHUP dockerd
|
||||
```
|
||||
|
||||
#### CentOS distributions
|
||||
1. Install the repository for your distribution by following the instructions [here](http://nvidia.github.io/nvidia-docker/).
|
||||
2. Install the `nvidia-docker2` package and restart the Docker daemon:
|
||||
```
|
||||
sudo yum install nvidia-docker2
|
||||
sudo pkill -SIGHUP dockerd
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
#### NVIDIA runtime
|
||||
nvidia-docker 2.0 registers a new container runtime to the Docker daemon.
|
||||
You must select the `nvidia` runtime when using `docker run`:
|
||||
```
|
||||
docker run --runtime=nvidia --rm nvidia/cuda nvidia-smi
|
||||
```
|
||||
|
||||
#### GPU isolation
|
||||
Set the environment variable `NVIDIA_VISIBLE_DEVICES` in the container:
|
||||
```
|
||||
docker run --runtime=nvidia -e NVIDIA_VISIBLE_DEVICES=0 --rm nvidia/cuda nvidia-smi
|
||||
```
|
||||
|
||||
#### Non-CUDA image:
|
||||
Setting `NVIDIA_VISIBLE_DEVICES` will enable GPU support for any container image:
|
||||
```
|
||||
docker run --runtime=nvidia -e NVIDIA_VISIBLE_DEVICES=all --rm debian:stretch nvidia-smi
|
||||
```
|
||||
|
||||
## Advanced
|
||||
|
||||
#### Backward compatibility
|
||||
|
||||
To help transitioning code from 1.0 to 2.0, a bash script is provided in `/usr/bin/nvidia-docker` for backward compatibility.
|
||||
It will automatically inject the `--runtime=nvidia` argument and convert `NV_GPU` to `NVIDIA_VISIBLE_DEVICES`.
|
||||
|
||||
#### Environment variables
|
||||
The behavior of the runtime can be modified through environment variables (such as `NVIDIA_VISIBLE_DEVICES`).
|
||||
Those environment variables are consumed by [nvidia-container-runtime](https://github.com/nvidia/nvidia-container-runtime) and are documented [here](https://github.com/nvidia/nvidia-container-runtime#environment-variables-oci-spec).
|
||||
Our official CUDA images use default values for these variables.
|
||||
|
||||
#### Default runtime
|
||||
The default runtime used by the Docker® Engine is [runc](https://github.com/opencontainers/runc), our runtime can become the default one by configuring the docker daemon with `--default-runtime=nvidia`.
|
||||
Doing so will remove the need to add the `--runtime=nvidia` argument to `docker run`.
|
||||
It is also the only way to have GPU access during `docker build`.
|
||||
|
||||
## Issues and Contributing
|
||||
|
||||
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.
|
||||
|
||||
* Please let us know by [filing a new issue](https://github.com/NVIDIA/nvidia-docker/issues/new)
|
||||
* You can contribute by opening a [pull request](https://help.github.com/articles/using-pull-requests/)
|
||||
|
|
Loading…
Reference in a new issue