PyTorch Docker does not detect my GPU

Bernd: <p>Hello PyTorchers</p>
<p>I am using the latest PyTorch docker container inside PyCharm Pro 2021.1.<br>
And I transformed the quickstart tutorial notebook into a python script, and it trains the Fashion MNIST stuff like a charm in that environment <img src="https://discuss.pytorch.org/images/emoji/apple/slight_smile.png?v=9" title=":slight_smile:" class="emoji" alt=":slight_smile:"><br>
Unfortunately the function torch.cuda.is_available() tells that there is no GPU support and runs on slow CPU instead.<br>
I am new to docker, so please bare with me if my questions seems stupid or my trials are doomed to fail.</p>
<p>I googled for that and found out that I should use “–gpus all” in my Debug Configuration \ Docker container settings.<br>
But when I do that the containers fails to start with the error:<br>
“Error running ‘quickstart_tutorial’: Cannot run the remote Python interpreter: OCI runtime create failed: container_linux.go:367: starting container process caused: process_linux.go:495: container init caused: Running hook <span class="hashtag">#0::</span> error running hook: exit status 1, stdout: , stderr: nvidia-container-cli: initialization error: driver error: failed to process request: unknown”</p>
<p>I also saw some solutions telling me to change /etc/docker/daemon.json.<br>
Well, I have no clue where to do this change (I run Windows 10, so I do not have /etc/… on my system!?) and noone in these solutions ever bothers to explain.</p>
<p>I also tried adding “–runtime nvidia” to the docker settings, but that fails with:<br>
“Error running ‘quickstart_tutorial’: Cannot run the remote Python interpreter: Unknown runtime specified nvidia”</p>
<p>Finally I tried the pytorch/pytorch:1.6.0-cuda10.1-cudnn7-runtime docker container instead of pytorch:pytorch:latest.<br>
It fits to my CUDA 10.1 and CUDNN 7.6 install, which I derived both from C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\include\cudnn.h<br>
But this did not change anything, I still see the same errors as above.</p>
<p>I would like to avoid upgrading my CUDA version, since I had a really hard time to get it running the last time.<br>
And I thought running docker containers is exactly the solution to avoid such environment changes &amp; breaks!?</p>
<p>Can anyone help me to get this pytorch docker quickstart tutorial run on my NVIDIA GTX 1080Ti?</p>
<p>Regards,<br>
Bernd</p>

ptrblck: <p>I don’t think nvidia docker containers are directly supported on Windows but via WSL2.</p>

Bernd: <p>Meaning that I cannot run (pytorch) docker with GPU support in a Windows 10 environment?<br>
Or do I “just” need another docker container?</p>

ptrblck: <p>I don’t think you can run an nvidia docker container on Windows directly, but would need to use <a href="https://docs.nvidia.com/cuda/wsl-user-guide/index.html#setting-containers">WSL2</a>.</p>

Bernd: <p>Ah now I get it. So I need to run a Linux inside my Windows 10.<br>
I worked with VirtualBox from Oracle some time ago. But as far as google and some forums tell me I cannot use VirtualBox for GPU passthrough, only WSL. I will look into this.</p>
<p>To be honest I find it a little sad that an environment for python, that claims to be plattform independent and even exists to abstract from the plattform, misses such an important feature <img src="https://discuss.pytorch.org/images/emoji/apple/frowning.png?v=9" title=":frowning:" class="emoji" alt=":frowning:"></p>
<p>Thx for support <img src="https://discuss.pytorch.org/images/emoji/apple/slight_smile.png?v=9" title=":slight_smile:" class="emoji" alt=":slight_smile:"></p>