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

Test on Windows with WSL2 #13

Open
ABeltramo opened this issue Jun 26, 2021 · 10 comments
Open

Test on Windows with WSL2 #13

ABeltramo opened this issue Jun 26, 2021 · 10 comments
Labels
help wanted Extra attention is needed

Comments

@ABeltramo
Copy link
Member

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 ABeltramo added the help wanted Extra attention is needed label Jun 26, 2021
@TheSamDickey
Copy link

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

@ABeltramo
Copy link
Member Author

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
Copy link
Member Author

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

@Poprox198
Copy link

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

@jfrgagnon
Copy link

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

@ABeltramo
Copy link
Member Author

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.

@lostmsu
Copy link

lostmsu commented Feb 22, 2023

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
Copy link

lostmsu commented Feb 22, 2023

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.

@ABeltramo
Copy link
Member Author

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. 😅

@lostmsu
Copy link

lostmsu commented Feb 22, 2023

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/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

5 participants