-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |