Git Product home page Git Product logo

nvidia-docker's Introduction

NVIDIA Docker

This repository includes utilities to build and run NVIDIA Docker images.
See samples/ for a list of Dockerfile examples.
Please be aware that this project is currently experimental.

docker

Building images

Images can be built on any machine running Docker, it doesn't require a NVIDIA GPU nor any driver installation.

Building images is done through the Docker CLI or using the nvidia-docker wrapper similarly:

# With latest versions
$ docker build -t cuda ubuntu/cuda/latest
# With specific versions
$ docker build -t cuda:7.5 ubuntu-14.04/cuda/7.5

Alternatively, one can build an image directly from this repository:

# With latest versions
$ docker build -t cuda github.com/NVIDIA/nvidia-docker#:ubuntu/cuda/latest
# With specific versions
$ docker build -t cuda:7.5 github.com/NVIDIA/nvidia-docker#:ubuntu-14.04/cuda/7.5

NVIDIA Docker wrapper

The nvidia-docker script is a drop-in replacement for docker CLI. In addition, it takes care of setting up the NVIDIA host driver environment inside Docker containers for proper execution.

GPUs are exported through a list of comma-separated IDs using the environment variable GPU. The numbering is the same as reported by nvidia-smi or when running CUDA code with CUDA_DEVICE_ORDER=PCI_BUS_ID, it is however different from the default CUDA ordering.

$ GPU=0,1 ./nvidia-docker <docker-options> <docker-command> <docker-args>

CUDA requirements

Running a CUDA container requires a machine with at least one CUDA-capable GPU and a driver compatible with the CUDA toolkit version you are using.

NVIDIA drivers are backward-compatible with CUDA toolkits versions:

CUDA toolkit version Minimum driver version
7.0 >= 346.46
7.5 >= 352.39

Samples

Once you have built the required images, a few examples are provided in the folder samples.
The following assumes that you have an image in your repository named cuda (see samples/deviceQuery/Dockerfile):

# Run deviceQuery with one selected GPU
$ docker build -t device_query samples/deviceQuery
$ GPU=0 ./nvidia-docker run device_query

[ NVIDIA ] =INFO= Driver version: 352.39
[ NVIDIA ] =INFO= CUDA image version: 7.5

./deviceQuery Starting...

 CUDA Device Query (Runtime API) version (CUDART static linking)

Detected 1 CUDA Capable device(s)

Device 0: "GeForce GTX 980"
  [...]

deviceQuery, CUDA Driver = CUDART, CUDA Driver Version = 7.5, CUDA Runtime Version = 7.5, NumDevs = 1, Device0 = GeForce GTX 980
Result = PASS

Issues and Contributing

nvidia-docker's People

Contributors

flx42 avatar 3xx0 avatar

Watchers

James Cloos avatar outmanzhao avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.