I used to use docker desktop with wsl2 integration and there was no problem running containers with gpu support.
However, after a recent update to docker desktop v4.17.1 ( march 2023 ), any containers that I run specifically using the --gpus all tag on wsl hangs forever without any response. The same containers run without any issue unless if specified with the --gpus tag.
running cuda container with nvidia-smi on wsl hangs without any response
Note: nvidia-smi works fine in wsl. System: windows 11.
Docker Desktop 4.18.0 has been released which resolves this issue.
This seems to be a known issue with Docker Desktop 4.17.1.
Older versions can be found here: https://docs.docker.com/desktop/release-notes/