Skip to content

Minimal container with CUDA drivers as a base for GPU computing.

Notifications You must be signed in to change notification settings

ozzyjohnson/docker-cuda

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

docker-cuda

Minimal container with CUDA drivers as a base for GPU computing.

Installs only the driver without the enourmous toolkit. I use this as a base for Folding and BOINC images, but it could certainly be used elsewhere.

Usage:

On a host with a CUDA device and drivers.

docker run \
  --device=/dev/nvidia0:/dev/nvidia0 \
  --device=/dev/nvidiactl:/dev/nvidiactl \
  --device=/dev/nvidia-uvm:/dev/nvidia-uvm \
  -it \
  --rm cuda

Or, as the base of another image.

FROM ozzyjohnson/cuda

Validate that the container can see the GPU .

nvidia-smi

Which produces.

+------------------------------------------------------+                       
| NVIDIA-SMI 340.46     Driver Version: 340.46         |                       
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  GRID K520           Off  | 0000:00:03.0     Off |                  N/A |
| N/A   32C    P0     0W / 125W |     10MiB /  4095MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+
									       
+-----------------------------------------------------------------------------+
| Compute processes:                                               GPU Memory |
|  GPU       PID  Process name                                     Usage      |
|=============================================================================|
|  No running compute processes found                                         |
+-----------------------------------------------------------------------------+

A message like.

Failed to initialize NVML: Unknown Error

Could be due to a mismatch between the host and container driver versions of missing host /dev entries.

Next:

  • An AMI or end to end to script to build and run this image.

Thanks / Resources:

A few guides and posts that were invaluable in getting this working.

About

Minimal container with CUDA drivers as a base for GPU computing.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published