NVIDIA GPUs

Using proprietary drivers

You can see if your host is using the proprietary driver using lshw:

$ lshw -class video | grep -i driver
       configuration: driver=nvidia latency=0

In order to make use of your GPU inside a docker container, you’ll need to set up the NVIDIA Container Toolkit.

If you have more than one NVIDIA GPU, you may want to set the GPU_UUID variable in env/nvidia.env to indicate which card to use. To get the correct UUID for your GPU, use the nvidia-container-cli command:

$ sudo nvidia-container-cli --load-kmods info
NVRM version:   [version]
CUDA version:   11.3

Device Index:   0
Device Minor:   0
Model:          NVIDIA GeForce [model]
Brand:          GeForce
GPU UUID:       GPU-[uuid]
Bus Location:   00000000:0a:00.0
Architecture:   7.5

Older NVIDIA GPUs

Older NVIDIA GPUs data might not appear in nvidia-smi, but there is a patch that will fix the issue. For more information, see https://github.com/CFSworks/nvml_fix

Xorg drivers

Although the NVIDIA Container Toolkit automatically provides most of the drivers needed to use the GPU inside a container, Xorg is not officially supported. This means that the runtime will not automatically map in the specific drivers needed by Xorg.

The run-gow script attempts to automatically handle this situation for you, if you tell it you’re using an NVIDIA GPU, but under rare circumstances it may not be able to. If you run into trouble, come chat with us on Discord.

You will need to pass the --gpu nvidia flag any time you run a run-gow command.

NVIDIA GPUs with nouveau drivers

It should be possible to use the nouveau driver, but be aware that this path is significantly less well-tested than using the proprietary driver.

Make sure that the host doesn’t use proprietary drivers but that it’s using the open source nouveau drivers.

sudo lshw -class video | grep driver=
       configuration: driver=nouveau latency=0

Double check that the GPU card is correctly listed under /dev/dri/:

ls -la /dev/dri/
total 0
drwxr-xr-x  3 root root        100 Jun 20 09:47 .
drwxr-xr-x 17 root root       3100 Jun 20 10:33 ..
drwxr-xr-x  2 root root         80 Jun 20 09:47 by-path
crw-rw----  1 root video  226,   0 Jun 20 09:47 card0
crw-rw----  1 root render 226, 128 Jun 20 09:47 renderD128
Because the nouveau driver implements standard APIs, you will need to make sure you do not pass --gpu nvidia when using run-gow.