WSL2 Windows Insider 20257.1 Docker Desktop 2.5.` (49550) docker: unrecognized service

On WSL2 the following works:
$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES

The following works:
$ docker run hello-world
Unable to find image ‘hello-world:latest’ locally
latest: Pulling from library/hello-world
0e03bdcc26d7: Pull complete
Hello from Docker!
This message shows that your installation appears to be working correctly.

The following fails:
$ sudo service docker start
docker: unrecognized service

The following fails:
$ docker run --gpus all nvcr.io/nvidia/k8s/cuda-sample:nbody nbody -gpu -benchmark
docker: Error response from daemon: could not select device driver “” with capabilities: [[gpu]].
ERRO[0018] error waiting for container: context canceled

All network tricks fail to make it work.
Helop would be appreciated.

2 Likes

I have the exact same issue

I have the same issue. Have you resolved it?

Wow, did this never get solved after a year? I have the exact same problem.

I don’t really understand the original post and now we have Docker Destop 4, so the reasons might be completely different.

The first part of the original post

1 ) Using Docker desktop, you do not need to start the docker service from a WSL2 machine.
2 ) docker ps works on Windows with Docker desktop
3 ) There are docker-desktop and docker-desktop-data WSL 2 machines but not for running docker commands
4 ) You can enable “WSL intergation” so the Docker desktop makes “docker” command available but you will not have any docker service inside that machine. Docker has a client and a server. The latter is in another machine (“docker-desktop”)
5 ) If you use Docker Desktop, you start and restart the service from Windows

The second part of the original post

Using the GPU in a WSL2 machine is a relatively new feature. I heard about it but never actually tried yet. I tried it on Linux hosts with NVIDIA GPU but I had to install the cuda driver on the host.

If you tried to test the GPU support after reading WSL 2 GPU Support is Here - Docker Blog that works for me now running the docker command from powershell and NOT from WSL2. I have to add that I have Windows 11.

If you want to install the docker daemon inside WSL2, then try to follow the instructions of NVIDIA: CUDA on WSL :: CUDA Toolkit Documentation

1 Like

Small note to add:
Docker Desktop release notes indicate that experimental support for GPU workloads was added in 3.1.0, but is not mentioned to be final in any later version. It is either still an experimental feature or less likely docker forgot to mention it beeing final in later releases :slight_smile:

Ofc this feature still requires WSlg, either provided by WSL2 in Win11 or the Windows 10 Insider preview.

Thanks for your clarification. As a beginner in Docker, if I simply want to use multiple CUDA versions for different deep learning models (because of dependency issues), would you recommend me to follow Nvidia and install Docker for Linux distributions in WSL2, or just use the Docker Desktop in Windows?

I would recommend to try and choose whatever is best for you :slight_smile: As a Linux user I choose linux hosts when I want to make better use of hardware resources in Linux containers. If I need to use Windows host, I always use WSL2 but that’s me and I have never configured CUDA inside WSL2 without Docker Desktop. So if you can, use a linux host. If you can’t use a linux host, try to use WSL2. If you can’t configure WSL2 on Windows or you yust don’t like it for some reason, use Docker Desktop for Windows. If Docker Desktop for Windows doesn’t work as you expect, for example you experience performance issues, use WSL2. If you have still bad performance, use a linux host.