-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Description
Windows Version
Microsoft Windows [Version 10.0.26200.7462]
WSL Version
2.6.3.0
Are you using WSL 1 or WSL 2?
- WSL 2
- WSL 1
Kernel Version
6.6.87.2-microsoft-standard-WSL2
Distro Version
Ubuntu 24.04.3 LTS
Other Software
Intel Arc Graphics GPU driver version: 32.0.101.8331 (WHQL Certified)
Repro Steps
On a clean windows installation, enable wsl2 support and install a distro. For these tests the default distro, "Ubuntu", has been used. The command currently installs Ubuntu 24.04.3 LTS which is what has been used. All WSL2 configuration options have been left untouched and kernel being used is default one.
- open the new distro and complete setup
- update all packages normally with apt and reboot the instance
- install "mesa-utils" package to check status of OpenGL support.
Checking the command output you will be able to see that OpenGL hardware acceleration will be marked as unsupported. We can also see that by default the software fallback "llvmpipe" is being used.
According to various official WSL annoucements and documentation, hardware accelerated OpenGL should be supported on recent versions:
- https://learn.microsoft.com/en-us/windows/wsl/tutorials/gui-apps (1)
- https://github.com/microsoft/wslg/wiki/GPU-selection-in-WSLg (2)
- https://devblogs.microsoft.com/commandline/d3d12-gpu-video-acceleration-in-the-windows-subsystem-for-linux-now-available/ (3)
So, as reported in various official resources, I should be able to use accelerated GPU rendering if I have a supported distro (1) and GPU driver (3). Both conditions are satisfied but still no hardware acceleration.
We can follow instructions on 3 to officially check if GPU rendering is available. Installing tools to check and mesa drivers. An additional reboot is done. Immediately we can see that they don't even work as "/dev/dri/card0" is missing because of the "vgem" kernel driver not being loaded.
If you are wondering the "LIBVA_DRIVER_NAME=d3d12" variable is set from now on.
At this point I have added "vgem" kernel module to be loaded automatically and added my user to "video" and "render" group and rebooted again. Still no luck, "vainfo" still fails and "glxinfo" still shows software rendering and no acceleration as shown above.
Looking at other issues I have tried to play with some environment variables, the only one which changed the situation has been "GALLIUM_DRIVER=d3d12". After setting this, both "vainfo" and "glxinfo" started showing the correct GPU with enabled hardware acceleration and "vainfo" output matching the expected one in (3).
The "GALLIUM_DRIVER=d3d12" variable is set when running every program from now on.
However this just caused all GPU hardware accelerated apps to fail and Windows OS to start having issues too. I tested Google Chrome, Microsoft Edge, blender but the most dramatic one has been glxgears.
Opening the two browsers and Blender cause the Windows display to have issues. The display initially goes all black and then reappears. This often occurs in an infinite cycle unless I kill the program. In one of the tests, trying to open Google Chrome again after closing it has caused a BSOD where the interested file is "dxgkrnl.sys". However I wasn't able to reproduce the BSOD anymore.
glxgears, on the other hand, has a totally different behiavour. As soon as it is opened the Windows OS completely freezes. No input is accepted but the cursor still moves for some time. System just hangs like this forever, trying to do CTRL+C didn't help in any way. CTRL+ALT+CANC also has no effect on the system. Only solution is a forced reboot via power button.
Expected Behavior
According to Microsoft official resources (1), WSL2 should support GPU hardware acceleration, OpenGL in this case, by default without any user intervention. Reading document (3) we can see that some more steps are requires, yet they don't fix the issue in any way as it continues to fallback to software rendering without acceleration on clean installations of supported WSL2 instances.
I should be able to use GPU hardware acceleration in applications installed on WSL2.
Actual Behavior
20260107_185859.mp4
20260107_192109.mp4
Diagnostic Logs
WslLogs-2026-01-07_20-10-31.zip
With Dumps: https://drive.google.com/file/d/1qr0btAgB3i2XCima286xZ5Jc_3RqtXMo/view?usp=sharing