gow icon indicating copy to clipboard operation
gow copied to clipboard

Test on Windows with WSL2

Open ABeltramo opened this issue 3 years ago • 27 comments

WSL2 is missing the uinput kernel module. There's a way to get it which involves recompile the kernel, try following the instructions at https://gist.github.com/cerebrate/d40c89d3fa89594e1b1538b2ce9d2720

ABeltramo avatar Jun 26 '21 10:06 ABeltramo

Hello! I stumbled across this repo today and it looks very interesting. I am curious, would HW acceleration work with WSL?

TheSamDickey avatar Sep 29 '21 00:09 TheSamDickey

That's a very good question to which I don't have an answer. I'm not even sure that WSL will expose the underlying GPU like you do on Linux via /dev/dri.

We are currently focusing our efforts on Linux, to be fair, the more I think about running GOW on Windows, the more I'm convinced it's not worth the effort compared to just running the .exe

ABeltramo avatar Sep 29 '21 06:09 ABeltramo

It might be worth to investigate on https://github.com/microsoft/wslg

ABeltramo avatar Oct 07 '21 19:10 ABeltramo

There is a published nvidia guide for WSL2 and docker : https://docs.nvidia.com/cuda/wsl-user-guide/index.html

Poprox198 avatar Nov 14 '21 15:11 Poprox198

Did anyone retried to implement GOW with WSL2 since the addition of systemd and the 2022 new kernel features?

jfrgagnon avatar Feb 02 '23 17:02 jfrgagnon

Did anyone retried to implement GOW with WSL2 since the addition of systemd and the 2022 new kernel features?

AFAIK no, and to be fair, I'm not sure I see the point; as things are right now Sunshine works perfectly well natively on Windows, and why would you run games in a Docker container via proton or the likes when you can just run them natively on the host?

I'm open to suggestions and POW, but right now, I'm focusing all my efforts in Linux.

ABeltramo avatar Feb 02 '23 19:02 ABeltramo

Just tried on my WSL 2 Ubuntu 20.04 install + WSLg + CUDA 11.4 which I use for ML.

Headless

Fails to start X11. The suggested hack with EDID did not work. I still get Fatal server error: no screens found.

Host

I installed and ensured GEdit works.

Launching Steam container actually shows Steam login window in Windows, but Sunshine fails to start:

Cannot load libcuda.so.1
terminate called after throwing an instance of
'std::filesystem::__cxx11::filesystem_error'
   what():  filesystem error: directory iterator
     cannot open directory: No such file or directory [/dev/dri]
Error: Couldn't load cuda: -1
Warning: Couldn't find /dev/dri, kmsgrab won't be enabled
gow-sunshine-1 exited with code 139

Windows

why would you run games in a Docker container via proton or the likes when you can just run them natively on the host?

Two goals really: containerization and running headless (+ as a bonus in arbitrary resolutions and multiple games at once from the same host?)

lostmsu avatar Feb 22 '23 15:02 lostmsu

After updating wsl with wsl --update, /dev/dri is now available and so Sunshine starts, and I can access the web UI, but Moonlight still can not connect to it. sunshine-wsl2.log

The relevant bits appear to be:

Couldn't expose some/all drm planes for card: /dev/dri/card0
...
Error: Could not create Sunshine Mouse: No such file or directory
Error: Could not create Sunshine Touchscreen: No such file or directory
Error: Could not create Sunshine Keyboard: No such file or directory
Error: Unable to create any input devices! Are you a member of the 'input' group?
...
Info: Screencasting with X11
Error: Couldn't load cuda: -1
Info: Encoder [nvenc] failed
Cannot load libcuda.so.1
...
Info: Trying encoder [vaapi]
Info: Screencasting with X11
MESA-LOADER: failed to open vgem: /usr/lib/dri/vgem_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib/x86_64-linux-gnu/dri:\$${ORIGIN}/dri:/usr/lib/dri, suffix _dri)
failed to load driver: vgem
libva info: VA-API version 1.14.0
Info: SDR color coding [Rec. 601]
Info: Color range: [JPEG]
Info: vaGetDriverNameByIndex() failed with unknown libva error, driver_name = (null)
Error: Couldn't initialize va display: unknown libva error

Moonlight complains about access to UDP 47999, which I take it means Sunshine failed to start the control stream.

lostmsu avatar Feb 22 '23 19:02 lostmsu

Thanks for reporting this, by a quick look at the logs I think you are hitting multiple issues:

Issues

  • Error: Could not create Sunshine Mouse is uinput present in the WSL kernel? (You can check with: lsmod | grep uinput) When I originally opened this issue it wasn't present, I'm not sure if that's changed now. Without uinput you'll not be able to create virtual devices and that means that you'll not be able to control the stream remotely.
  • Cannot load libcuda.so.1, failed to load driver: vgem, Couldn't initialize va display: unknown libva error looks like you have issues with your video drivers, which GPU are you using? Can you try running vainfo and see what's reported?

Goals

Two goals really: containerization and running headless (+ as a bonus in arbitrary resolutions and multiple games at once from the same host?)

Sunshine supports multiple users sharing a single screen (ex: co-op games). We are building a completely different solution in order to support headless virtual HW accelerated displays for multiple users which is called Wolf. It's still under heavy development and not really ready to be used as is but, since we are building our own Wayland compositor, this could potentially work under WSL.

I can only say, keep an eye on this space because we are getting close to something that looks like a solution. 😅

ABeltramo avatar Feb 22 '23 20:02 ABeltramo

Can you try running vainfo and see what's reported?

libva info: VA-API version 1.7.0
libva error: vaGetDriverNameByIndex() failed with invalid VADisplay, driver_name = (null)
vaInitialize failed with error code 3 (invalid VADisplay),exit

looks like you have issues with your video drivers Perhaps I need to upgrade my mesa as described here: https://devblogs.microsoft.com/commandline/d3d12-gpu-video-acceleration-in-the-windows-subsystem-for-linux-now-available/

lostmsu avatar Feb 22 '23 21:02 lostmsu