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

Backport to Windows 10 #771

Closed
pedroaugustosmribeiro opened this issue Jun 17, 2022 · 21 comments
Closed

Backport to Windows 10 #771

pedroaugustosmribeiro opened this issue Jun 17, 2022 · 21 comments
Labels
enhancement New feature or request

Comments

@pedroaugustosmribeiro
Copy link

Please backport this project to Windows 10.

@pedroaugustosmribeiro pedroaugustosmribeiro added the enhancement New feature or request label Jun 17, 2022
@gschian0
Copy link

I second this... is there a workaround?

@chickyd3v
Copy link

this #347 (comment)

@pedroaugustosmribeiro
Copy link
Author

pedroaugustosmribeiro commented Jun 23, 2022

Upvoted there, thank you @chickyd3v .
Guess for the time I'll continue using Vcxsrv or GWSL, though mostly limited to software rendering.
For my particular needs it's kind of ok, I'm not running Linux games, just some matplotlib plots and scientific computing scripts.

@WSLUser
Copy link

WSLUser commented Jun 27, 2022

There's also https://github.com/Biswa96/wslg if you want to compile yourself.

@crramirez
Copy link
Contributor

Upvoted there, thank you @chickyd3v . Guess for the time I'll continue using Vcxsrv or GWSL, though mostly limited to software rendering. For my particular needs it's kind of ok, I'm not running Linux games, just some matplotlib plots and scientific computing scripts.

You can do hardware rendering with Windows 10 21h2 and Vcxsrv, you don't need WSLg for that

@crramirez
Copy link
Contributor

Please backport this project to Windows 10.

This issue is a duplicate of #414 please vote everyone in one place to have more strength

@pedroaugustosmribeiro
Copy link
Author

Upvoted there, thank you @chickyd3v . Guess for the time I'll continue using Vcxsrv or GWSL, though mostly limited to software rendering. For my particular needs it's kind of ok, I'm not running Linux games, just some matplotlib plots and scientific computing scripts.

You can do hardware rendering with Windows 10 21h2 and Vcxsrv, you don't need WSLg for that

That only works with indirect rendering, and limited to OpenGL 1.4 check here

Not a problem on most scenarios though.

@crramirez
Copy link
Contributor

crramirez commented Jul 8, 2022

@pedroaugustosmribeiro your link is about the behavior 2 years ago. I am talking about Windows 10 21h2. See this screenshot and give it a try; it works:

image

@pedroaugustosmribeiro
Copy link
Author

pedroaugustosmribeiro commented Jul 9, 2022

@crramirez Nope, it's still valid for me. Please make sure your linux distro on WSL2 is really using direct rendering.
In my case, when in direct mode, it's software rendering through Mesa that I get (which is fine). BTW my laptop is pretty old (2012 model), so are the video drivers, so there's no passthrough available even on 21H2.
image

@pedroaugustosmribeiro
Copy link
Author

pedroaugustosmribeiro commented Jul 9, 2022

with inderect_rendering set:

pedro@Pedro-PowerWindows:~$ systeminfo.exe| grep "Versão do sistema operacional" && glxinfo -B
Versão do sistema operacional: 10.0.19044 N/A compilação 19044
name of display: 172.18.176.1:0.0
display: 172.18.176.1:0 screen: 0
direct rendering: No (LIBGL_ALWAYS_INDIRECT set)
OpenGL vendor string: Intel
OpenGL renderer string: Intel(R) HD Graphics 4000
OpenGL version string: 1.4 (4.0.0 - Build 10.18.10.5161)

pedro@Pedro-PowerWindows:$ glxheads
glxheads: exercise multiple GLX connections (any key = exit)
Usage:
glxheads xdisplayname ...
Example:
glxheads :0 mars:0 venus:1
Name: 172.18.176.1:0.0
Display: 0x55786e565190
Window: 0x200002
Context: 0x55786e57ccb0
GL_VERSION: 1.4 (4.0.0 - Build 10.18.10.5161)
GL_VENDOR: Intel
GL_RENDERER: Intel(R) HD Graphics 4000
X connection to 172.18.176.1:0.0 broken (explicit kill or server shutdown).
pedro@Pedro-PowerWindows:
$glxgears
Running synchronized to the vertical refresh. The framerate should be
approximately the same as the monitor refresh rate.
18180 frames in 11.4 seconds = 1590.304 FPS
8410 frames in 10.4 seconds = 807.588 FPS
X connection to 172.18.176.1:0.0 broken (explicit kill or server shutdown).

@crramirez
Copy link
Contributor

@pedroaugustosmribeiro Well the driver requirements are the same for GPU acceleration with or without WSLg. Backporting WSLg to Windows 10 (which is the title of this issue) won't solve the driver thing.

@pedroaugustosmribeiro
Copy link
Author

@crramirez You're probably right, it's something Microsoft and the hardware manufacturers would have to solve, but won't (for the old devices, at least). However they could, as it's a feature already available on Windows itself and that works with third-party hypervisors like VirtualBox and VMWare Player

@crramirez
Copy link
Contributor

I agree

@majk-dev
Copy link

majk-dev commented Aug 14, 2022

@crramirez Thanks for your post - it gives me some hope, but I can't get Vcxsrv to work with d3d12 driver. I have the latest intel driver in Windows, it should support WSL and seems like it does - I have a /dev/dxg device and auto-mounted drivers in /var/lib/wsl/. But setting DISPLAY to host where latest Vcxsrv 1.20.14.0 runs, only gives me OpenGL 1.4 with indirect rendering.

Can you share more about your configuration? Do you run Vcxsrv with -wgl or some other option? Maybe you have some special env variables defined? Or is it some Pengwin specialty not available for plain Debian or Ubuntu?

UPDATE (SOLVED):
You need mesa 21+ for it to work. Debian stable still has mesa 18, but Ubuntu just needed an update and now it works on Ubuntu.
Apart from mesa 21, I've found out that for D3D12 graphics driver in WSL, you need Windows driver for whatever gfx card you have that's al least WDDM 2.9 compatibile (https://devblogs.microsoft.com/directx/directx-heart-linux/). For my intel integrated graphics latest driver is WDDM 3.0 (I think), so I just needed a driver update (https://www.intel.com/content/www/us/en/download/19344/intel-graphics-windows-dch-drivers.html?).

TLDR - just needed latest intel drivers (30+) on Windows and mesa 21+ in Linux.

@crramirez
Copy link
Contributor

Hello @majk-dev,

Very good I was just answering your comment when I realized your update.

For me, it is not working with the latest Intel driver, but sure version 30.0.101.1660 works.

I also saw you mentioned indirect mode. For others reading this, be sure that you unset LIBGL_ALWAYS_INDIRECT

Also, having Mesa 21 is not enough because it needs to be compiled with the d3d12 driver. RHEL-based distros like Oracle and Alma, for example, have Mesa 21 but not the d3d12 drivers, so that it won't work. If it is not working, check for the file /lib/x86_64-linux-gnu/dri/d3d12_dri.so if it is present in your distro.

Hope it helps.

@majk-dev please submit a screenshot with it working; more people need to see it working. Thanks

@majk-dev
Copy link

@crramirez You're right. The DirectX post I linked mentions it is only glibc based distros - forgot about that since I mainly use Debian and derivatives.

Also, I run Vcxsrv WITH "native opengl" (-wgl) option ON, and WITHOUT LIBGL_ALWAYS_INDIRECT like you mentioned.

The distro is Ubuntu 20.04 LTS with updated mesa packages from apt.

And the screenshot :)
image

@pedroaugustosmribeiro
Copy link
Author

@crramirez Thanks for your post - it gives me some hope, but I can't get Vcxsrv to work with d3d12 driver. I have the latest intel driver in Windows, it should support WSL and seems like it does - I have a /dev/dxg device and auto-mounted drivers in /var/lib/wsl/. But setting DISPLAY to host where latest Vcxsrv 1.20.14.0 runs, only gives me OpenGL 1.4 with indirect rendering.

Can you share more about your configuration? Do you run Vcxsrv with -wgl or some other option? Maybe you have some special env variables defined? Or is it some Pengwin specialty not available for plain Debian or Ubuntu?

UPDATE (SOLVED): You need mesa 21+ for it to work. Debian stable still has mesa 18, but Ubuntu just needed an update and now it works on Ubuntu. Apart from mesa 21, I've found out that for D3D12 graphics driver in WSL, you need Windows driver for whatever gfx card you have that's al least WDDM 2.9 compatibile (https://devblogs.microsoft.com/directx/directx-heart-linux/). For my intel integrated graphics latest driver is WDDM 3.0 (I think), so I just needed a driver update (https://www.intel.com/content/www/us/en/download/19344/intel-graphics-windows-dch-drivers.html?).

TLDR - just needed latest intel drivers (30+) on Windows and mesa 21+ in Linux.

Just saw the updates here and retried direct rendering one more time, without success.
Unfortunally my graphics cards (I have two: integrated and discrete) are both below WDDM 2.9 so nope, won't get acceleration for now.
I still hope one day Microsoft backports to previous WDDM versions (at least 2.5), please.
issue #86 can be useful

@Jackenmen
Copy link

It seems that with the now stable release of WSL on Microsoft Store installed on Windows 10 22H2 with KB5020030 update installed, graphic applications now work out of the box on a fresh WSL instance:
image

The Start Menu integration works as well!

@ajspetner
Copy link

It seems that with the now stable release of WSL on Microsoft Store installed on Windows 10 22H2 with KB5020030 update installed, graphic applications now work out of the box on a fresh WSL instance: image

The Start Menu integration works as well!

Literally the same day that I set up my new PC with Windows 11. Ah well...

@spronovo
Copy link
Collaborator

Hey folks, it is indeed official and WSLg is now available for Windows 10. Please make sure that your Windows 10 installation is fully up to date and then update to the latest version of WSL in the Microsoft Store.

For more details, please see our official blog on this.

https://devblogs.microsoft.com/commandline/the-windows-subsystem-for-linux-in-the-microsoft-store-is-now-generally-available-on-windows-10-and-11/

@pedroaugustosmribeiro
Copy link
Author

That's great, just tested now, it's working!
Thank you very much, even my old PC is handling fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

9 participants