GPU not detected in custom devcontainer with

I have created a custom container using the image:

The host computer is using Ubuntu 23.04, I have nvidia-docker2, and the nvidia drivers above 530 to be able to use CUDA. Here is the output of nvidia-smi:

The container runs well, but the drivers from the graphics card are not detected:

I have used the following devcontainer file:

and docker-compose:

Thank you for your help.
Best regards

Just updating a bit, after some research. It may be that I need to use “sudo” command to build the image. However, how can I achieve the same without the need to use sudo?


This may be related to a reported outage with

Please follow this thread: I can't pull nvidia images - #5 by TomNVIDIA


I have check and it is something related to the topic described in:

I will check the information from that topic to see if I can make it work.

Best regards,

Well, I actually found that the issue is related with Docker Desktop, as shown in the link: Nvidia/cuda doesn't work on Docker Desktop but works on Docker Engine - #5 by rimelek - Docker Desktop for Linux - Docker Community Forums

Thank you.

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