microsoft / WSL

Issues found on WSL
https://docs.microsoft.com/windows/wsl
MIT License
17.25k stars 812 forks source link

Cannot find GPU devices on Bash #829

Closed forhonourlx closed 4 years ago

forhonourlx commented 8 years ago

Does win10 bash support GPU devices?

michaelybecker commented 4 years ago

Bump, but also, layperson's question: does this mean everyone here who relies on CUDA uses linux? Are the drivers stable enough? I'm at my wits' end as most RNN and GAN implementations I run into seem to be clearly oriented towards linux...

machineko commented 4 years ago

@MichaelHazani It is almost every deep learning lib is writen for linux mostly ubuntu env. Thats why we need this freaking gpu support 🗡

suvl commented 4 years ago

what about VAAPI, will it be supported anytime soon?

rickstaa commented 4 years ago

Although I'm really impressed with WSL2, I will stick with dual booting until GPU support is added.

machineko commented 4 years ago

Coca Cola ads are out so "Holidays Are Coming ..." and let's wish GPU magic happen this year ❤️

aronsar commented 4 years ago

WSL is a very exciting project, and if it offered GPU support I would use it much more extensively. The reason I would like GPU support on WSL is because as researcher in computer vision and natural language processing I often find myself running other people's code, which is almost exclusively written on linux. Since I don't own a linux machine, I rely on my university for sys admining, and I have to deal with unplanned downtimes and no sudo access. In fact, what brought me here was a "hardware upgrade" I was notified about 20 minutes before the system was shut down, in the middle of training a model. Please WSL team, we need GPU support! Can we get a kickstarter going for this or something? I would definitely pitch in $20.

GusSand commented 4 years ago

+20.

On Tue, Dec 10, 2019 at 18:54 Aron Sarmasi notifications@github.com wrote:

WSL is a very exciting project, and if it offered GPU support I would use it much more extensively. The reason I would like GPU support on WSL is because as researcher in computer vision and natural language processing I often find myself running other people's code, which is almost exclusively written on linux. Since I don't own a linux machine, I rely on my university for sys admining, and I have to deal with unplanned downtimes and no sudo access. In fact, what brought me here was a "hardware upgrade" I was notified about 20 minutes before the system was shut down, in the middle of training a model. Please WSL team, we need GPU support! Can we get a kickstarter going for this or something? I would definitely pitch in $20.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/microsoft/WSL/issues/829?email_source=notifications&email_token=AAMEVVE7IHBQF6ODSUZT7TDQYAT5BA5CNFSM4CL6YCO2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEGRL2VI#issuecomment-564313429, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAMEVVBS7MYZK667CGOFYSLQYAT5BANCNFSM4CL6YCOQ .

DiegoJRR commented 4 years ago

+$20

robelgeda commented 4 years ago

+$50

rickstaa commented 4 years ago

WSL is a very exciting project, and if it offered GPU support I would use it much more extensively. The reason I would like GPU support on WSL is because as researcher in computer vision and natural language processing I often find myself running other people's code, which is almost exclusively written on linux. Since I don't own a linux machine, I rely on my university for sys admining, and I have to deal with unplanned downtimes and no sudo access. In fact, what brought me here was a "hardware upgrade" I was notified about 20 minutes before the system was shut down, in the middle of training a model. Please WSL team, we need GPU support! Can we get a kickstarter going for this or something? I would definitely pitch in $20.

+$20

+$50

As wsl2 with GPU support would simplify my development environment enormousl, if there is a bounty platform, I would also like to donate +$50 for this feature.

michaelmyc commented 4 years ago

+$50

xiongzubiao commented 4 years ago

+$10000

bitcrazed commented 4 years ago

Thanks everyone for your enthusiasm for this feature. Instead of posting meaningless +$'s which just dilute the thread, please thumbs-up upvote the topmost post in this thread so we can see a measurable indicator of interest.

image

Thanks.

privacyguy123 commented 4 years ago

Even if we could get something like Bumblebeed working - but that would require full systemd support ...

garzillo commented 4 years ago

I would move back to Windows 10 from a MacBook Pro for development (ML engineer) if this were supported.

michaelmyc commented 4 years ago

@garzillo Wait, I think macOS don't support NVIDIA in general.

garzillo commented 4 years ago

@6etacat Right - WSL2 NVIDIA support would the the killer feature that would entice me to completely switch.

machineko commented 4 years ago

@bitcrazed So can u tell us anything new? Machine learning community fell kinda ignored in this issue. GPU support was hottest request for about a year or even more, and we dont even know if wsl team is doing something in way to bring gpu and machine learning on windows or we should just ignore all of that and fully move to linux. A lot of my colleagues from work was big windows fans before moving from data science/analytics roles to more ML based where they just cant do most of the stuff needed from them cause there is no GPU support in WSL (a lot of medium sized companies are working on thier own machines with ML stack, ignoring cloud because of high gpu pricing).

12101111 commented 4 years ago

Nvidia does not allow consumer graphics card used for virtualization purposes, so using Nvidia graphics cards in wsl2 is not possible unless Microsoft and Nvidia reach an agreement.

Yiannis128 commented 4 years ago

MS needs to do something about this since it is pretty much one of the biggest issues with WSL at the moment... I wish NVIDIA wasn't so anti consumer...

bitcrazed commented 4 years ago

We hear you and we're as eager for a solution in this space as you all are. But do understand that implementing GPU compute support for WSL is a monumental piece of work spanning several teams and partners.

Be sure to follow @craigloewen-msft on Twitter and visit the command-line blog for news of up-and-coming WSL features and improvements.

We thank you all for your patience. It'll be worth it in the end :)

cloudhan commented 4 years ago

So can I take your comment as "we are working on it"? Since you are not saying "It is on the backlog." or "I have nothing to say". @bitcrazed

bitcrazed commented 4 years ago

We have been exploring this feature for > 2 years now so, yes, we are 'working on it', but don't raise expectations of a delivery schedule for this feature until you see an announcement blog post by Craig on Twitter and/or on https://devblogs.microsoft.com/commandline

bloodgain commented 4 years ago

Man, I just spent a whole day getting my toolchain working for CUDA on some slightly outdated training material (but hey, it was "free") to finally get "no CUDA-capable device" and find this thread. I could have spent the time setting up a VM or dual-booting my test PC instead. Some sort of warning or feature-list on the "package" for WSL would sure be helpful to warn people about things like this.

machineko commented 4 years ago

@bloodgain VM cant share gpu u need dual-booting :)

Yiannis128 commented 4 years ago

Just saying... It's gonna probably be Windows 10's best feature. Having a fully powered Linux virtual environment that doesn't have the slowness and sluggishness of a VM.

Even if Nvidia doesn't allow MS to implement such a feature for their GPUs I still think they should do it for AMD GPUs. Edit: I think AMD cards don't let you do that either, not sure.

bloodgain commented 4 years ago

@bloodgain VM cant share gpu u need dual-booting :)

Thanks for the head's up. So silly. If standard VMs can do this and Docker containers can do it, why not hosted VM's?

cloudhan commented 4 years ago

@bloodgain VM cant share gpu u need dual-booting :)

Thanks for the head's up. So silly. If standard VMs can do this and Docker containers can do it, why not hosted VM's?

VM cannot do this if you are using GeForce or RTF card, nvidia does not allow GPU virtualization.

Yiannis128 commented 4 years ago

You need to buy their VM GPU for that feature. 🙄👀 I think AMD may be on the same boat

michaelmyc commented 4 years ago

@bloodgain VM cant share gpu u need dual-booting :)

You may also use GPU passthrough if you have 2 GPUs in the system. One for Windows VM and one for Linux. A lot of people use this method to play Windows games on Linux.

delivey commented 4 years ago

Really looking forward to this. Can't install a certain video-inpainting program on Windows, because the bash scripts are written for Linux, so there's no way to do it except to install a VM. Any updates?

AnalogRez commented 4 years ago

Thanks for the update @bitcrazed! Plenty of people would make the switch to Windows, definitely worth prioritizing

MarkusPfundstein commented 4 years ago

PLEASE

AbhimanyuAryan commented 4 years ago

I definitely greyed out my hair waiting for this. Moved back to Ubuntu 18.04...this is definitely going to take till 2022

Biswa96 commented 4 years ago

There are some work going on (maybe) about implementing this feature. Here are two hints I found:

  1. This one is so old. Go to this mach2 repository. The mach2 repository lists all the insider build features. Then grep WSL_Device_GPU in features folder. You can find that it remains way back in 18932 insider build. Also WSL_Device_GPU_WSL1 feature is present in 19624 build.

  2. This one I found today. Go to WSL2 Linux kernel repository, linux-msft-wsl-4.19.y branch. See the gpu: dxgkrnl: core code commit. There is a config saying -- Microsoft virtual GPU support. And dxgkrnl.sys is the kernel mode DirectX graphics driver. Calculate the rest... 🤩

craigloewen-msft commented 4 years ago

Hi folks, we announced today that WSL will support GPU compute! I'll be posting more details about this change today. :)

And here are the details on our blog post. We're looking forward to making this real!

Biswa96 commented 4 years ago

Some queries:

  1. Will those DirectX user mode .so libraries be open sourced?
  2. The post only mentions about glibc based distributions, what about musl based ones e.g. Alpine? AFAIK, the init binary is statically linked to musl libc.
  3. As some of the directx headers (e.g. d3dkmthk.h) are open sourced with GPL in Linux kernel tree, will this somehow affect the Windows SDK DirectX headers also?
  4. Will there be some ways/docs about using the /dev/dxg interface through ioctl instead of relying on those libraries? May be someone will come up their own implementation.
severian1778 commented 4 years ago

I spent $4000 on my surfacebook2 and I can't use my GPU in bash? How does a centi-billion dollar firm not solve this problem. I cant just go and buy a new computer like Bill Gates when I feel like it, maybe the devs at MS can grow up and service their customers. I have CUDA intensive tasks I want to run on something I paid out of the nose for.

bitcrazed commented 4 years ago

Polite ask: Please keep conversations around here respectful.

@severian1778 In case you missed the news this week from Build2020, you'll want to read these two posts:

In addition, there's a ton of work going on right now on DirectML which aims to enable you to run AI/ML type workloads across any compatible GPU from any silicon vendor:

This work by Microsoft and our silicon partners will be leveraged by any app running atop DirectML including apps running in WSL.

cloudhan commented 4 years ago

@bitcrazed regarding with DirectML,

  1. Will it support dynamic shape? This will be critical for NLP/ASR task.
  2. Will it support custom op?
bitcrazed commented 4 years ago

@cloudhan - great questions for https://twitter.com/crahrig

craigloewen-msft commented 4 years ago

The first preview of this work hit the Windows Insiders Dev channel today. Please find all the details on this blog post. 🎉🎉🎉

YaaZ commented 4 years ago

@craigloewen-msft cool to hear that! Are there any updates about rendering, like Vulkan/OpenGL support?

michaelybecker commented 4 years ago

this is incredible - years in the making but worth the wait. Thank you!

craigloewen-msft commented 4 years ago

@YaaZ not yet, but please stay tuned. :)

therealkenc commented 4 years ago

No instant gratification here unfort. The bind mount of the drivers took, but no [ed, typeo] /dev/dxg. dmesg looks clean at a glance. Problem between monitor and chair, probably. Still early.

image

[edit2]

Got it.... 20150 hit the street, but read the fine print kernel 4.19.121+ has not yet. Patience grasshopper.

Untitled

[edit3] woot. Confirmed tag fixedininsiders. Or something.

image

ningacoding commented 4 years ago

Finally WSL2 And Genymotion Working <3 Thanks Microsoft

image

robelgeda commented 4 years ago

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

Riccorl commented 4 years ago

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 commented 4 years ago

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