Page 1 of 1

Please consider adding WSL2 GPU accelerator support

Posted: Sat Oct 16, 2021 5:02 pm
by jpalpant
Microsoft has started to support GPU acceleration inside the Windows Subsystem for Linux with version 2 (WSL2). WSL is a sort of Linux container running on Windows, and it's really convenient for development and testing. With WSL2, Microsoft presents a virtual GPU device and sort of proxies the actual Windows GPU driver, and this is supported with a variety of GPUs. They claim to support CUDA fairly well and automatically - in a WSL instance with Windows NVIDIA drivers, you can run CUDA samples automatically. They do not yet support OpenCL (or OpenGL, or Vulkan, I believe), but at least CUDA support is there.

I don't know if it's sufficient for FAH, but would love to hear if it is and if this system of GPU access could be added to the whitelist. Currently FAH does not detect the virtual GPU device due to the blacklist, as it has a new PCI vendor and device code:

Code: Select all

$ lspci -nn
...
d175:00:00.0 3D controller [0302]: Microsoft Corporation Device [1414:008e]
The announcement: https://developer.nvidia.com/blog/annou ... r-linux-2/
NVIDIA's CUDA on WSL guide: https://docs.nvidia.com/cuda/wsl-user-guide/index.html

Re: Please consider adding WSL2 GPU accelerator support

Posted: Sun Oct 17, 2021 12:42 pm
by toTOW
Unless you can enable GPU passthrough to expose the real GPU to the virtualized Linux client, it won't be supported by FAH.

Re: Please consider adding WSL2 GPU accelerator support

Posted: Tue Oct 19, 2021 12:00 am
by jpalpant
I see, thank you for responding! I think it's unlikely that MSFT plans to do so in the near future considering the way they're working on the GPUPV stuff, but if that changes, I'll keep that in mind.

Re: Please consider adding WSL2 GPU accelerator support

Posted: Tue Oct 19, 2021 6:32 pm
by JimboPalmer
[I not not privy to program internals, I just hang out here]

Since every supported GPU runs OpenCL 1.2 or newer, I am unsure if you even can run a GPU which only has CUDA. It sure looks like F@H starts OpenCL and then starts CUDA, which is doomed to fail.

If indeed you can run just CUDA, then it might be possible to see what virtualized GPU MS is pretending to be. if you run "FAHClient.exe --lspci" it should tell you what GPU you linux thinks it has, F@H could whitelist that virtualized GPU. But I suspect it will still choke on no OpenCL,.