Skip to content

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
  • Loading branch information
Qinka committed Sep 18, 2017
1 parent 25af0c4 commit 3fb2134
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
32 changes: 32 additions & 0 deletions post/docker/using-gpu.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
Using Host's GPU on Docker
===


There are two steps to using GPU on your Docker:

* Install nvidia-docker (for it's volumes)
* Setup volumes and device for your container

## FIRST STEP: install nvidia docker

Checkout [Nvidia's official report for nvidia-docker](https://github.com/NVIDIA/nvidia-docker) to get the guides about install
nvidia-docker, and then install it.

After it installed, you need to make sure `nvidia-docker-plugin` is running.
If not, you need run it on the background.

Then you need to use `docker volumes ls` to checkout whether there are a volume `named nvidia-docker`.
You also need to run `nvidia-docker run --rm nvidia/cuda nvidia-smi` to checkout whether the container can connect to
host GPU.

## SECOND STEP: launch your container

> Before beginning with all of this section, it is important that in your image, there should install cuda toolkit or sdk.
If you want to use GPU, the following list is want you need to do:

* Mount volume `nvidia-docker` to your container by using the option `-v` when creating container
* Map the devices about GPU by using `--device` when creating container
> You need to map those whose name has prefix `nvidia`
* Launch your container

3 changes: 3 additions & 0 deletions post/docker/using-gpu.sum.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## Summary

So in this post, I will tell your about how to use Nvidia's GPU on Docker.

0 comments on commit 3fb2134

Please sign in to comment.