Created attachment 900028 [details] glxinfo -B ; emerge --info I'm attempting to get WSL-g up and running however I've discovered that despite `/dev/dxg` existing and USE=`video_cards_d3d12` enabled on media-libs/mesa-24.1.3 that the only available renderer is `llvmpipe`. This is obviously undesirable. I'm using an Intel iGPU, and https://bugs.gentoo.org/845213 suggests that this may have never worked under this configuration - Has anybody had success? The only insight I have at this stage is the following whenever anything using OpenGL is launched (e.g. glxinfo, glxgears, firefox): ``` kangie@wsl2-hostname ~ $ glxinfo -B name of display: :0 WARNING: dzn is not a conformant Vulkan implementation, testing use only. MESA: error: ID3D12DeviceFactory::CreateDevice failed . . . ``` I'm not much of a Mesa/OpenGL buff, but WSL appears to be correctly passing in `/dev/dxg` from the Linux VM: ``` kangie@wsl2-hostname ~ $ ls -la /dev/dxg crw-rw-rw- 1 root root 10, 127 Aug 12 09:58 /dev/dxg ``` I'm a bit stumped for now bit will try and see if I can work out what the Mesa code is doing sometime in the next month. Available to try suggestions if anyone has them.
I can confirm that Ubuntu in WSL-g does not have this issue: ``` name of display: :0 display: :0 screen: 0 direct rendering: Yes Extended renderer info (GLX_MESA_query_renderer): Vendor: Microsoft Corporation (0xffffffff) Device: D3D12 (Intel(R) Iris(R) Xe Graphics) (0xffffffff) Version: 23.2.1 Accelerated: yes Video memory: 8162MB Unified memory: yes Preferred profile: core (0x1) Max core profile version: 4.1 Max compat profile version: 4.1 Max GLES1 profile version: 1.1 Max GLES[23] profile version: 3.0 OpenGL vendor string: Microsoft Corporation OpenGL renderer string: D3D12 (Intel(R) Iris(R) Xe Graphics) OpenGL core profile version string: 4.1 (Core Profile) Mesa 23.2.1-1ubuntu3.1~22.04.2 OpenGL core profile shading language version string: 4.10 OpenGL core profile context flags: (none) OpenGL core profile profile mask: core profile OpenGL version string: 4.1 (Compatibility Profile) Mesa 23.2.1-1ubuntu3.1~22.04.2 OpenGL shading language version string: 4.10 OpenGL context flags: (none) OpenGL profile mask: compatibility profile OpenGL ES profile version string: OpenGL ES 3.0 Mesa 23.2.1-1ubuntu3.1~22.04.2 OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.00 ```
Created attachment 902436 [details] gentoo glxinfo strace
Created attachment 902437 [details] ubuntu glxinfo strace
It appears that I'm getting proper libraries and devices into WSL from MS: ``` $ ls /usr/lib/wsl/lib/ -av . .. libd3d12.so libd3d12core.so libdxcore.so ``` Nothing jumping out at me in the straces, which is sad - I'd hoped there would be something obvious.
My current Mesa build config ``` [ebuild R ] media-libs/mesa-24.1.6::gentoo USE="X llvm (opengl) proprietary-codecs vulkan wayland zstd -d3d9 -debug -lm-sensors -opencl -osmesa (-selinux) -test -unwind -vaapi -valgrind -vdpau -vulkan-overlay -xa" ABI_X86="(64) -32 (-x32)" CPU_FLAGS_X86="sse2" LLVM_SLOT="18 -15 -16 -17" VIDEO_CARDS="d3d12 zink (-freedreno) -intel -lavapipe (-lima) -nouveau -nvk (-panfrost) -r300 -r600 -radeon -radeonsi (-v3d) (-vc4) -virgl (-vivante) -vmware" 0 KiB ```
Three things to try after each do the strace -e file glxinfo -B again - media-libs/mesa VIDEO_CARDS: -zink - mv /usr/share/vulkan/icd.d/dzn_icd.x86_64.json{,.old} - undo the move, and set USE=-vulkan for mesa
Done, I'll upload the straces. Nothing special to report. Still llvmpipe in Gentoo. The `WARNING: dzn is not a conformant Vulkan implementation, testing use only.` warning disappears with USE=-zink, so I guess dozen (dzn) is a directx zink thing? Had to install Ubuntu 24.04 LTS for testing/doco. It seems to work as well, I get glxgears. Some interesting warnings that don't seem to impact anything. ```Ubuntu24.04 name of display: :0 MESA: error: ZINK: failed to choose pdev glx: failed to create drisw screen display: :0 screen: 0 direct rendering: Yes Extended renderer info (GLX_MESA_query_renderer): Vendor: Microsoft Corporation (0xffffffff) Device: D3D12 (Intel(R) Iris(R) Xe Graphics) (0xffffffff) Version: 24.0.9 Accelerated: yes Video memory: 8162MB Unified memory: yes Preferred profile: core (0x1) Max core profile version: 4.1 Max compat profile version: 4.1 Max GLES1 profile version: 1.1 Max GLES[23] profile version: 3.0 OpenGL vendor string: Microsoft Corporation OpenGL renderer string: D3D12 (Intel(R) Iris(R) Xe Graphics) OpenGL core profile version string: 4.1 (Core Profile) Mesa 24.0.9-0ubuntu0.1 ```
Dozen (dzn) is Vulkan on D3D12. We can ignore that until/unless we get the mesa d3d12 driver working.
Created attachment 902499 [details] gentoo glxinfo strace USE=-zink
Created attachment 902500 [details] gentoo glxinfo strace USE=-zink moved dzn lib
Created attachment 902501 [details] gentoo glxinfo strace USE=-video_cards_zink -vulkan
New mesa (~arch - 24.2.2) makes no difference. Found some discussion involving envvar `GALLIUM_DRIVER`; if set to d3d12 we now get a clear failure rather than a fallback to llvmpipe. ``` name of display: :0 glx: failed to create drisw screen X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 148 (GLX) Minor opcode of failed request: 24 (X_GLXCreateNewContext) Value in failed request: 0x0 Serial number of failed request: 38 Current serial number in output stream: 39 ``` Will upload strace. Still no idea what's going on; might have to ask upstream.
Created attachment 903096 [details] gentoo mesa 24.2.2 glxinfo strace force d3d12
OK, we have a missing dependency on dev-libs/libedit. It's a little annoying as it explicitly wants libedit.so.2 but we only provide .0 and .7. A quick symlink solves that problem. What's the actual solution here desktop team? Current status: ``` name of display: :0 display: :0 screen: 0 direct rendering: Yes Extended renderer info (GLX_MESA_query_renderer): Vendor: Microsoft Corporation (0xffffffff) Device: D3D12 (Intel(R) Iris(R) Xe Graphics) (0xffffffff) Version: 24.2.2 Accelerated: yes Video memory: 8162MB Unified memory: yes Preferred profile: core (0x1) Max core profile version: 4.1 Max compat profile version: 4.1 Max GLES1 profile version: 1.1 Max GLES[23] profile version: 3.0 OpenGL vendor string: Microsoft Corporation OpenGL renderer string: D3D12 (Intel(R) Iris(R) Xe Graphics) OpenGL core profile version string: 4.1 (Core Profile) Mesa 24.2.2 OpenGL core profile shading language version string: 4.10 OpenGL core profile context flags: (none) OpenGL core profile profile mask: core profile OpenGL version string: 4.1 (Compatibility Profile) Mesa 24.2.2 OpenGL shading language version string: 4.10 OpenGL context flags: (none) OpenGL profile mask: compatibility profile OpenGL ES profile version string: OpenGL ES 3.0 Mesa 24.2.2 OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.00 ```
Looks like this is reported upstream (to WSL) as https://github.com/microsoft/wslg/issues/996
For any users that stumble across this issue and just need working Graphics in WSL2, the TL;DR is: Intel (or MS?) build the drivers against a Debian or Ubuntu-based distribution. Debian use `libedit2`, a package that differs from `libedit` only in that the soname is `.2` instead of `.0`. It is inappropriate for us to package a fix for this issue, however enterprising users can make the Mesa D3D12 Gallium drivers for intel to work by: - Building mesa with `VIDEO_CARDS_D3D12` - Installing dev-libs/libedit - Symlinking `libedit.so` to `libedit.so.2` - Cursing Microsoft/Intel/Debian/Ubuntu/Deity of choice. The end result is that the D3D12 Intel GPU should work transparently and continue working until this is resolved upstream and flows into the Gentoo WSL container through a WSL store update.