wandreopoulos / deeplasmid

12 stars 2 forks source link

Unable to Utilize GPU when Running Docker Container on Windows 11 with WSL 2 #14

Open sprdmt opened 3 months ago

sprdmt commented 3 months ago

Hello!

I was trying to run the container via Docker installed on the Windows 11 machine with WSL 2 (Ubuntu 22.04). Despite my efforts I couldn't make it run on GPU - during the run there is no usage of the GPU detected by nvidia-smi or in the task manager (while CPU is at 100%). I have to say that I am a complete novice to Docker, NVIDIA tools, and to many aspects of Unix programming, therefore it was a bit of a struggle to follow the README. Nevertheless I managed to set Docker up and allowed it the access to the GPU (which required modifying the Docker's json file via the Docker Desktop interface to set nvidia as default runtime), since the command docker run --rm --gpus all ubuntu nvidia-smi works fine and returns my GPU and CUDA version. I also tried installing tensorflow just in case, even though it's not required, but that didn't change anything. torch.cuda.is_available() and torch.cuda.get_device_name(0) work as expected, however the container itself doesn't seem to detect the GPU. Itried running it without the --gpus, setting it as all or "device=0".

Any ideas what I could be doing wrong? Does it perhaps have something to do with the versions of CUDA/NVIDIA Container Toolkit that I am using (are the latest one problematic somehow?).

Any help would be appreciated.

Thanks Dmytro