although i've setup docker to use wsl2 but it doesn't use wsl2 os

I’m using updated windows 11 and docker desktop,

and also i’ve setup and use ubuntu inside wsl2

i’ve config docker to use wsl2 as its engine and use ubuntu as default, i’ve done everything in setting for wsl2,

when i want to run images that can use gpu for better performance and

i’ve done everything for it inside ubuntu(downloaded pkg like cuda …) but it is still using cpu

when i run this command: docker info

this is the output: Operating System: Docker Desktop

and is not ubuntu, i think for this reason i can’t use my gpu for images.

why? how i can change it to use ubuntu inside wsl2?

i re-installed docker desktop, nothing changed

If you want to use GPU in Docker Desktop, the documentation can help

You don’t have to install anythin in the WSL 2 distribution. You don’t configure Docker Desktop to run its en gine in a specific WSL2 distribution, you just configure it to enable the client in that WSL2 distribution so the Desktop distribution will be like a remote machine. You wouldn’t try to install cuda on your workstation when containers ar running on a remote machine.

thanks for your response
why in docker info command i see this response:
Operating System: Docker Desktop
is it correct? it shouldn’t be ubuntu?


i was using ollama + openwebui inside docker compose
for openwebui i used gpu version + gpu configs
but for ollama i didn’t use any gpu config
so when i run both of them only cpu was used and no gpu was involved
so i though it was because of wrong drivers so i installed nvidia things inside wsl2
and nothing changed

No, Docker Desktop is the correct one, as that is the OS of the daemon, not the client and Docker DEsktop has its own WSL2 distribution not based on Ubuntu, but Linux Kit.

thanks for your response
i edit my docker compose file and now my ollama + openwebui is better than before
(the speed of response is increased)
but still when i check from task manager of windows, still cpu has load and gpu has no load
how i can be sure that gpu is using by docker?
i must add -benchmark to my setup and check? or there is other way too?

I rarely use Windows so I’m not sure how the resources can be seen. I know that the Task manager doesn’t always show the expected values and the 'Resource Monitor" can be used then. If the application actually uses the GPU and not the CPU and the --gpus all flag is added the GPU should be used. If it doesn’t happen, and you think it is a bug, you can report it on GitHub

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