Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot find GPU devices on Bash #829

Closed
forhonourlx opened this issue Aug 9, 2016 · 119 comments
Closed

Cannot find GPU devices on Bash #829

forhonourlx opened this issue Aug 9, 2016 · 119 comments

Comments

@forhonourlx
Copy link

Does win10 bash support GPU devices?

@benhillis
Copy link
Member

Not currently. This is a highly requested feature on our User Voice forum. I would suggest you add your workflow to the discussion there so help us prioritize features we work on in the future.

Thanks for trying out WSL!

@fpqc
Copy link

fpqc commented Aug 9, 2016

@forhonourlx I wonder if it ever will (and if it did, how would it work). If MS could code some kind of generic driver that passed openGL DRM stuff to the Windows driver stack and passed the rest of it onwards to an X or Wayland server on Windows, maybe it could work, but otherwise I think the best you might get is something that will inevitably be kind of crappy virtualized graphics card.

If not, AIGLX is still a supported (if not the absolute fastest) way of doing graphics rendering in Linux (and according to my sources (Arch Wiki) was still the way that most desktop composition was done until at least 2009). Support for something like AIGLX (which is hardware-agnostic on the X client side) already exists in vcXsrv (although the most important plugin GL_PIX_FROM_TEXMAP) is not implemented right now in hardware accelerated mode, leading to very bad performance due to falling back to software rendering.

@aseering
Copy link
Contributor

aseering commented Aug 9, 2016

Another major use case for GPUs is OpenCL/CUDA/etc, which I don't think AIGLX will help with? And it's more relevant to the sorts of use cases that WSL is initially targeting.

If there were enough demand and if the relevant players felt like playing nice (inter-company coordination is complicated...), in principle the WSL team could collaborate with NVidia (I'd list all vendors but really NVidia seems to be the big player in this particular field) and build a WSL driver. Not saying that's the best approach, nor that it would ever necessarily happen; just saying it could.

(If you care about CUDA in particular, it might be worth making some noise on the NVidia forums as well; make sure they also hear about any demand for support.)

@thesby
Copy link

thesby commented Oct 21, 2016

If cuda is okay on bash, maybe some deep learning tools, such as tensorflow, caffe, can directly run on windows.

@roachsinai
Copy link

Truly!

@IvanFarkas
Copy link

Would be nice!

@jotaf98
Copy link

jotaf98 commented Jun 26, 2017

Any insights on how challenging, technically, this would be? Just to adjust expectations accordingly.

@XinliZ
Copy link

XinliZ commented Aug 15, 2017

Expecting...

@vickylance
Copy link

Ok it's 2017 November. Any updates on this so far?

@IvanFarkas
Copy link

Can we have it for Thanksgiving or a super early Christmass present the latest, please?

@sunilmut
Copy link
Member

sunilmut commented Nov 6, 2017

We are quite aware of the demand of this feature and are working to see how best we can support it. It's very unlikely to be part of the next (FCU + 1) release.

@jotaf98 - The challenge here is not just technical but also logistical and other. Because there are multiple players involved here, and not everything is in direct control. But, we are exploring all possibilities here.

@jotaf98
Copy link

jotaf98 commented Nov 8, 2017

@sunilmut Thanks for the insight! Rooting for you guys to find a way to make it work.

@yuchenlin
Copy link

Looking forward!

@IvanFarkas
Copy link

Ditto!

@riceshrug
Copy link

I'd like to add to the chorus, OpenCL support from the bash shell is very important to me. Thank you.

@omaralvarez
Copy link

Any new updates on this? I would love to be able to run OpenGL apps.

@gigagem
Copy link

gigagem commented Jun 1, 2018

Really looking forward to being able to use WSL for running/testing our GPU-intensive programs. Now executing nvidia-smi in WSL Ubuntu, I get "NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running."

@GusSand
Copy link

GusSand commented Aug 8, 2018

+1 on @peterjc123 request. I'm trying to run some deep learning libs on WSL and can't. Some help here guys. Can you get Abolade on the case? 👍

@Khalilsqu
Copy link

any updates!

@ghost
Copy link

ghost commented Sep 18, 2018

C'mon guys, I really need this feature...

@Khalilsqu
Copy link

please add also sound system. no sound can be played from wsl

@ningacoding
Copy link

Finally WSL2 And Genymotion Working <3 Thanks Microsoft

image

@robelgeda
Copy link

I literally took a shot 🥃🍻
Some good news during bad times.
Thanks for listing to the people WSL team ❤️

@Riccorl
Copy link

Riccorl commented Jun 19, 2020

I followed the documentation and it seems like it's successfully installed, but this code hangs indefinitely with one cpu core at 99%

python -c 'import torch; print(torch.rand(2,3).cuda())'

is this the normal behavior and I should just wait?

@onomatopellan
Copy link

@Riccorl It could be a nvdia driver problem https://forums.developer.nvidia.com/t/known-limitations-with-cuda-on-wsl-2/128506

@Riccorl
Copy link

Riccorl commented Jun 19, 2020

@Riccorl It could be a nvdia driver problem https://forums.developer.nvidia.com/t/known-limitations-with-cuda-on-wsl-2/128506

Unfortunately, I'm using a Ryzen CPU. I think I should just wait then. Thank you for the link!

@Hendiadyoin1
Copy link

I'm not on the insider branch and from the blog entry it seems, that the rocm/rock and opencl apis arent yet supported, and therefore the hip library not functional.
will there be support for these api's in the next "stable" version or do we have to wait for the amd devs to make a move on a windows compatible version of hip?

@onomatopellan
Copy link

onomatopellan commented Jun 19, 2020

New nvidia drivers 455.41 available should fix the freeze problems
https://developer.nvidia.com/cuda/wsl/download

@duxie
Copy link

duxie commented Jun 21, 2020

My dream came true !!!
image

@catskillsresearch
Copy link

@Kyle2142
Copy link

Kyle2142 commented Jun 22, 2020

Can someone please post the steps to get this working?

  • I have windows build 20150
  • I installed the WSL-compatible drivers (455.41) from nvidia's blogpost
  • I have ubuntu 18.04 on wsl 2
  • kernel version 4.19.121-microsoft-WSL2-standard
  • /dev/dxg exists
  • sudo lspci does not show my GPU

Sorry if this is hijacking the thread, but I do think my problem is "cannot find gpu devices on bash"

@onomatopellan
Copy link

@Kyle2142 what's the output of uname -a ? You need kernel 4.19.121 for cuda to work.

@Kyle2142
Copy link

Kyle2142 commented Jun 22, 2020

@Kyle2142 what's the output of uname -a ? You need kernel 4.19.121 for cuda to work.

thanks for the quick reply, please see edit above. Should've remembered to include that

@onomatopellan
Copy link

It seems the gpu is available only for the first wsl2 running distro. Try wsl.exe --shutdown and run the distro again. Can you see the libs in /usr/lib/wsl/lib ?

@Kyle2142
Copy link

>wsl --shutdown
>ubuntu1804
$ ls /usr/lib/wsl/lib/
libcuda.so  libcuda.so.1  libcuda.so.1.1  libd3d12.so  libdirectml.so  libdxcore.so

lspci still shows no nvidia device

@onomatopellan
Copy link

Any error message related to dxg in sudo dmesg?

@Kyle2142
Copy link

$ conda create -n torch python=3.7
$ conda activate torch
$ pip install torch -y
$ python -c 'import torch; print(torch.rand(2,3).cuda())'
tensor([[0.4829, 0.4576, 0.9950],
        [0.3608, 0.6088, 0.7283]], device='cuda:0')

It still does not show on lspci but the above works, I am sure the problem was running debian by default. Thank you for the assistance @onomatopellan and if you know who to ask, please document the gotcha of multiple distros!

@y0d4a
Copy link

y0d4a commented Jun 22, 2020

Can someone please post the steps to get this working?

* I have windows build 20150

* I installed the WSL-compatible drivers (455.41) from nvidia's blogpost

* I have ubuntu 18.04 on wsl 2

* kernel version 4.19.121-microsoft-WSL2-standard

* /dev/dxg exists

* `sudo lspci` does not show my GPU

Sorry if this is hijacking the thread, but I do think my problem is "cannot find gpu devices on bash"

how did you upgrade the kernel? i have 4.19.104 and cannot upgrade to latest.. in downlaod section, only get source... do i need to compile?!

@onomatopellan
Copy link

@y0d4a You need to be in build 20150 it comes via Windows Update or with wsl.exe --update

@Hendiadyoin1
Copy link

Again asking will and drivers and therfor rocm/hip sopport come to wsl or is there already a way to get it to work

@catskillsresearch
Copy link

I can't get WSL 2 and Ubuntu and NVidia GPU to work. I started a thread on AskUbuntu with my experience. Microsoft/NVidia please help and contribute that thread to raise the visibility for the idea of having a complete, correct and simple set of instructions for WSL 2/Ubuntu/NVidia. I am doing this on a Lenovo Yoga P40 with latest Windows fast track and Quadro M500M with latest NVidia drivers, as described in the thread.

@eternalphane
Copy link

@y0d4a You need to be in build 20150 it comes via Windows Update or with wsl.exe --update

or you can manually build the kernel.

@ningacoding
Copy link

how did you upgrade the kernel? i have 4.19.104 and cannot upgrade to latest.. in downlaod section, only get source... do i need to compile?!

Enable update for other Microsoft products.

Vfqi3pA0rp

@craigloewen-msft
Copy link
Member

I'm marking this issue as complete, since the original ask (Making GPU devices available in WSL) is fulfilled. If you're running into specific issues please open another issue on this repo using our bug template! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests