Issue with Enabling GPU Usage in Docker (Option Not Appearing)

Hello everyone!

I’m facing an issue while trying to enable GPU usage in Docker for parallel computing with CUDA. When I try to run my containers, Docker does not seem to utilize the GPU, and the option to enable it does not appear, even after following the official NVIDIA documentation.

Details:

  • I’m using Ubuntu 24.04.1 LTS on WSL 2.
  • I have the latest version of Docker installed.
  • The GPU is correctly configured on the system and visible through other tools (like nvidia-smi).

I’ve tried the following approaches:

  • Checked permissions and NVIDIA driver installation.
  • Installed nvidia-docker as recommended, but Docker still doesn’t recognize or offer the option to enable the GPU.
  • Restarted the system and reconfigured both Docker and the NVIDIA driver installation.

Has anyone experienced this issue or have any suggestions on how to resolve it? Any help would be greatly appreciated!

Thanks in advance!

What does it mean that the option is not appearing? The category indicates you are using Docker Desktop. The statement about the appearance of the option also indicates that, but I’m not sure where and what should appear. It should work by default. And if you are using Docker DEsktop, it doesn’t matter what Distro you are using for which you enabled the WSL integration on Docker Desktop and you defnitely don’t need to install the nvidia-docker package which is an archived project anyway. You only need the driver on your Windows. WSL2 and Docker takes care of the rest and you can use the --gpus all option of docker run or equivalent parameters in a compose file.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.