wandreopoulos / deeplasmid

17 stars 2 forks source link

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

Open sprdmt opened 8 months ago

sprdmt commented 8 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

wandreopoulos commented 3 months ago

Hi Dmytro, Sorry for the delay. I haven't been monitoring this email account frequently. Please note the initial feature extraction of deeplasmid is CPU only. It does not use GPUs for feature extraction. The GPU is used later in the inference part of the tool (second part of deeplasmid). Stefano had a similar question about GPU usage. He posted some docker commands he used to verify if GPUs are used. After the feature extraction (first part) he confirmed that GPU is being used: https://github.com/wandreopoulos/deeplasmid/issues/11 Let me know if I can help further. Thanks

On Fri, Mar 29, 2024 at 6:13 AM Dmytro Spriahailo @.***> wrote:

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

— Reply to this email directly, view it on GitHub https://github.com/wandreopoulos/deeplasmid/issues/14, or unsubscribe https://github.com/notifications/unsubscribe-auth/AANGW5POC5SZJZJFGCMJGY3Y2VLGBAVCNFSM6AAAAABFONH5ZOVHI2DSMVQWIX3LMV43ASLTON2WKOZSGIYTKMZSGIZDOMA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

-- Thanks, Bill


William B. Andreopoulos, Ph.D. Joint Genome Institute LBNL