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

mesa-libGL performance bug still exists for fedora 37? #180

Closed
nuitlejour opened this issue Nov 21, 2022 · 30 comments
Closed

mesa-libGL performance bug still exists for fedora 37? #180

nuitlejour opened this issue Nov 21, 2022 · 30 comments
Assignees

Comments

@nuitlejour
Copy link

nuitlejour commented Nov 21, 2022

Describe the bug

The latest mesa-libGL-devel (version 22.2.3-1.fc37) is filtered out by fedora remix.

It does say in the README.md that:
'Upgraded Mesa to 21.2.3, the latest version 21.3.1 provided by upstream Fedora 35 has a serious performance issue with GPU and WSLg'

Is it still an issue for the latest mesa-libGL-devel (version 22.2.3-1.fc37) ?

To Reproduce
dnf install mesa-libGL-devel, and returns:
package mesa-libGL-22.2.3-1.fc37.x86_64 is filtered out by exclude filtering

@nuitlejour nuitlejour changed the title mesa-libGL performance bug still exists? mesa-libGL performance bug still exists for fedora 37? Nov 21, 2022
@crramirez
Copy link
Contributor

Hello,

Thanks for reporting. The thing is that the mesa provided by Fedora repos doesn't come compiled with d3d12, so we need to compile it, package it and make it available.

It is in our roadmap and I'll tell you when it is ready.

Regards,
Carlos

@crramirez crramirez self-assigned this Nov 22, 2022
@crramirez
Copy link
Contributor

The latest 22.2.3 is faster than 21.3.1 but in our tests is slower than 21.2.3. But we will update to this version because it provides OpenGL 4 and video decoding (although we have never been able to make it work)

@shoffmeister
Copy link

If I understand the challenge correctly, then this is all about d3d12_dri.so?

Is there a bug report / issue ticket against Fedora that requests that they build and package d3d12_dri.so out of the box? See https://bugzilla.redhat.com/buglist.cgi?component=mesa&product=Fedora and their build system at https://src.fedoraproject.org/rpms/mesa with https://src.fedoraproject.org/rpms/mesa/blob/f37/f/mesa.spec

The expectation would be that dnf provides '/usr/lib64/dri/d3d12_dri.so' | grep mesa lists not only the -wsl packages, but also the original distribution as a source?

FWIW, https://koji.fedoraproject.org/koji/rpminfo?rpmID=33718767 for Fedora 38 does not package D3D12 either (via https://src.fedoraproject.org/rpms/mesa)

Additional comments here suggest that even if Fedora did package d3d12_dri.so, then performance of (say), mesa 22.3.6-1 (Fedora 37 as of today) would be significantly lower on WSL than older versions of Mesa? This would suggest a performance regression in Mesa?

Is there a bug report / issue ticket against Mesa for this?

@shoffmeister
Copy link

Just noticed https://src.fedoraproject.org/rpms/mesa/pull-request/16, so someone made some attempt, but that ended up nowhere.

@shoffmeister
Copy link

Just also found https://bugzilla.redhat.com/show_bug.cgi?id=2115560

So, fundamentally, and as of today, Fedora is missing out on a package for the Microsoft DirectX Headers at https://github.com/microsoft/DirectX-Headers (that's what the above Bugzilla review request is about).

Once those headers are packaged within Fedora, the mesa build could be conveniently extended such as below - is my understanding of this correct?

Note that this patch is wildy hacked up, with a local install of the DirectX headers, and off rawhide, but F37 should be the same and should install fine with find . -name '*.rpm' -not \( -name '*-debugsource-*' -o -name '*-debuginfo-*' -o -name '*-devel-*' \) -exec sudo dnf install {} +;

diff --git a/mesa.spec b/mesa.spec
index 1a16056..2f02142 100644
--- a/mesa.spec
+++ b/mesa.spec
@@ -13,6 +13,7 @@
 
 %ifarch %{ix86} x86_64
 %global with_crocus 1
+%global with_d3d12  1
 %global with_i915   1
 %global with_iris   1
 %global with_xa     1
@@ -136,6 +137,9 @@ BuildRequires:  glslang
 %if 0%{?with_vulkan_hw}
 BuildRequires:  pkgconfig(vulkan)
 %endif
+%if 0%{?with_d3d12}
+#BuildRequires:  pkgconfig(DirectX-Headers) >= 1.608.2
+%endif
 
 %description
 %{summary}.
@@ -345,7 +349,7 @@ export RUSTFLAGS="%build_rustflags"
   -Ddri3=enabled \
   -Dosmesa=true \
 %if 0%{?with_hardware}
-  -Dgallium-drivers=swrast,virgl,nouveau%{?with_r300:,r300}%{?with_crocus:,crocus}%{?with_i915:,i915}%{?with_iris:,iris}%{?with_vmware:,svga}%{?with_radeonsi:,radeonsi}%{?with_r600:,r600}%{?with_freedreno:,freedreno}%{?with_etnaviv:,etnaviv}%{?with_tegra:,tegra}%{?with_vc4:,vc4}%{?with_v3d:,v3d}%{?with_kmsro:,kmsro}%{?with_lima:,lima}%{?with_panfrost:,panfrost}%{?with_vulkan_hw:,zink} \
+  -Dgallium-drivers=swrast,virgl,nouveau%{?with_r300:,r300}%{?with_crocus:,crocus}%{?with_i915:,i915}%{?with_iris:,iris}%{?with_vmware:,svga}%{?with_radeonsi:,radeonsi}%{?with_r600:,r600}%{?with_freedreno:,freedreno}%{?with_etnaviv:,etnaviv}%{?with_tegra:,tegra}%{?with_vc4:,vc4}%{?with_v3d:,v3d}%{?with_kmsro:,kmsro}%{?with_lima:,lima}%{?with_panfrost:,panfrost}%{?with_vulkan_hw:,zink}%{?with_d3d12:,d3d12} \
 %else
   -Dgallium-drivers=swrast,virgl \
 %endif
@@ -369,6 +373,11 @@ export RUSTFLAGS="%build_rustflags"
   -Degl=enabled \
   -Dglvnd=true \
   -Dmicrosoft-clc=disabled \
+%if 0%{?with_va}
+%if 0%{?with_d3d12}
+  -Dgallium-d3d12-video=enabled \
+%endif
+%endif
   -Dllvm=enabled \
   -Dshared-llvm=enabled \
   -Dvalgrind=%{?with_valgrind:enabled}%{!?with_valgrind:disabled} \
@@ -503,6 +512,7 @@ popd
 %endif
 %ifarch %{ix86} x86_64
 %{_libdir}/dri/crocus_dri.so
+%{_libdir}/dri/d3d12_dri.so
 %{_libdir}/dri/i915_dri.so
 %{_libdir}/dri/iris_dri.so
 %endif
@@ -584,6 +594,9 @@ popd
 %if 0%{?with_radeonsi}
 %{_libdir}/dri/radeonsi_drv_video.so
 %endif
+%if 0%{?with_d3d12}
+%{_libdir}/dri/d3d12_drv_video.so
+%endif
 %{_libdir}/dri/virtio_gpu_drv_video.so
 %endif
 
@@ -599,6 +612,9 @@ popd
 %if 0%{?with_radeonsi}
 %{_libdir}/vdpau/libvdpau_radeonsi.so.1*
 %endif
+%if 0%{?with_d3d12}
+%{_libdir}/vdpau/libvdpau_d3d12.so.1*
+%endif
 %{_libdir}/vdpau/libvdpau_virtio_gpu.so.1*
 %endif

@crramirez
Copy link
Contributor

Hello,

No problem. We will upgrade the mesa version for Fedora Remix this week.

Regards,
Carlos

@crramirez
Copy link
Contributor

Fedora project doesn't officially support WSL and we don't want to enter in this discussion to try to push it upstream. If they and RHEL don't have this support is their desision. We compile mesa with WSL support and upload the resulting packages to our repos then lock the version to avoid the user download the upstream one.

@shoffmeister
Copy link

Slightly off-topic WRT Fedora and WSL:

As far as I remember the story "back then", the Fedora organization really wanted to deliver Fedora Linux onto WSL - but Microsoft then came up with some contractual constraints (liability?) that Fedora did not want to enter into.

From a technical point of view, IMHO, Fedora would be happy to accept changes to further enable Fedora Linux on WSLg; it's just that they don't want to get into a specific contractual situation where they make a formal offer of a spin, i.e. literally "Fedora Linux - WSL edition", off the Microsoft Store.

@crramirez
Copy link
Contributor

This is one part of the story. The other is about Redhat and their position about WSL. Without trying to enter in polemics you can notice that Redhat Enterprise Linux doesn't have a WSL version nor CentOS.

A patch in Fedora will eventually fall to RHEL.

As you said you cannot find any official build even outside the Store which is in theory the legal problem.

@crramirez
Copy link
Contributor

Hello,

We upgraded the mesa drivers. The performance hit is still there, but now you'll have support for OpenGL 4. It also comes with the video acceleration enabled that I personally haven't been able to use. Maybe it is my hardware. We'll soon test the video acceleration and publish a blog post.

Run update.sh to update them. If it doesn't work run it twice.

Here GlxGears before and after the upgrade:
9d1f0cf7-349c-4ad5-b270-f07975658f2d

image

@shoffmeister
Copy link

Many thanks for the refresh of Mesa!

FWIW, I have done some terribly non-scientific test of a fully updated, very fresh Fedora 37, no tweaks, on a Dell Inspiron 7610 laptop (Tiger Lake, Intel XE + RTX3060, 64 GB) [***]:

  • glmark2 on the Intel iGPU only (NVidia dGPU idle): 383
  • glmark2 on NVidia (Intel does a few things): 391
  • glxgears on Intel: ~880 FPS
  • glxgears on NVidia: ~905 FPS

Functionally, IDEs such as IntelliJ and Visual Studio Code seem to scroll text fast enough.

I even get Firefox to render a Youtube 4K video on the 4K screen, fullscreen (no video acceleration) - this is a bit jittery, but after all this is all through WSLg.

As a final test, the latest version of Microsoft Edge "dev" (112) on Fedora quite nicely renders a 4K action scene from Avengers (https://www.youtube.com/watch?v=rrGMENN1iaY) at 4K on the 4K screen with very very tolerable quality - amazing.

[***]
The hardware warrants a little bit of explanation:

  • "Intel iGPU only" refers to Windows task manager showing only the Intel GPU having load; output is shown on the built-in laptop screen (3K resolution) or a 4K screen attached via HDMI (controlled by the Intel GPU)

  • "on NVidia" refers to Windows task manager showing load on both the Intel GPI and the NVidia GPU; the output is rendered on a display (2.5K resolution) attached via Thunderbolt (DispayPort) connected to the NVidia GPU controlled output port - I cannot tell which GPU does what in that setup (out of "render" and "copy for presentation")

There might be room for improvement by tweaking things "somewhere", still, but for me right now this Very Much Good Enough.

@shoffmeister
Copy link

shoffmeister commented Mar 4, 2023

I think I really need to qualify my comments above: Fedora 37 does use llvmpipe. Not D3D12.

I just installed "Ubuntu (Preview)" from the Microsoft Store - and what I see there is totally horrible: Extremely slow performance on glxgears, jitter, functional defects, Microsoft Edge does not start etc - and that with d3d12 (according to glxinfo -B)

This suggests that my d3d12 setup on Fedora is broken right now - and I am not too unhappy that, given what I see on Ubuntu, right now ...

@shoffmeister
Copy link

I just updated both the Intel and Nvidia drivers.

Fedora still is on llvmpipe, but with better performance - glxgears slightly down to ~875 FPS

Ubuntu (23.04, effectively) still has d3d12, but now mostly working, with a many visual artefacts. glxgears is around 60 FPS. With LIBGL_ALWAYS_SOFTWARE=1 this gets performance similar to Fedora, and the visual artefacts are gone.

Truth to be told - on my system, I am not sure why I should be using d3d12. Neither Ubuntu nor Fedora appear to work well with it.

Funky.

@crramirez
Copy link
Contributor

OK if you have the latest mesa and d3d12 works on Ubuntu but no on Fedora probably you have the non-wsl mesa packages.

Run update.sh even though you already have run it.

As you said you can always disable the acceleration with the environment variable.

The theory is that although you see a drop in FPS in glxgears which is a very simple model, you should gain performance using the GPU with complex models, like for example render a scene in Blender.

@shoffmeister
Copy link

I tried update.sh again and did notice errors during execution - I guess I was running into microsoft/WSL#8843, as amending "WSLInterop.conf" fixed those errors (I have systemd=true in /etc/wsl.conf) on next execution.

Perhaps the update.sh script could be amended to have more (implicit) error handling (set -euo pipefail)? And perhaps --silent the curls?

Right now I am reasonably sure that update/upgrade ran without errors; the state of my system is

dnf list --installed 'mesa*'

Installed Packages
mesa-dri-drivers.x86_64         22.3.6-wsl_2       @whitewaterfoundry_fedoraremix
mesa-filesystem.x86_64          22.3.6-wsl_2       @whitewaterfoundry_fedoraremix
mesa-libEGL.x86_64              22.3.6-1.fc37      @updates
mesa-libGL.x86_64               22.3.6-wsl_2       @whitewaterfoundry_fedoraremix
mesa-libGLU.x86_64              9.0.1-7.fc37       @fedora
mesa-libgbm.x86_64              22.3.6-1.fc37      @updates
mesa-libglapi.x86_64            22.3.6-wsl_2       @whitewaterfoundry_fedoraremix
mesa-va-drivers.x86_64          22.3.6-wsl_2       @whitewaterfoundry_fedoraremix
mesa-vdpau-drivers.x86_64       22.3.6-wsl_2       @whitewaterfoundry_fedoraremix
mesa-vulkan-drivers.x86_64      22.3.6-1.fc37      @updates

and

ls -la /lib64/dri/

total 371012
drwxr-xr-x   2 root root     4096 Mar  4 07:40 .
dr-xr-xr-x 101 root root   110592 Mar  4 08:05 ..
-rwxr-xr-x  12 root root 26219832 Mar  2 00:09 crocus_dri.so
-rwxr-xr-x  12 root root 26219832 Mar  2 00:09 d3d12_dri.so
-rwxr-xr-x   5 root root 13022784 Mar  2 00:09 d3d12_drv_video.so
-rwxr-xr-x  12 root root 26219832 Mar  2 00:09 iris_dri.so
-rwxr-xr-x  12 root root 26219832 Mar  2 00:09 kms_swrast_dri.so
-rwxr-xr-x  12 root root 26219832 Mar  2 00:09 nouveau_dri.so
-rwxr-xr-x   5 root root 13022784 Mar  2 00:09 nouveau_drv_video.so
-rwxr-xr-x  12 root root 26219832 Mar  2 00:09 r300_dri.so
-rwxr-xr-x  12 root root 26219832 Mar  2 00:09 r600_dri.so
-rwxr-xr-x   5 root root 13022784 Mar  2 00:09 r600_drv_video.so
-rwxr-xr-x  12 root root 26219832 Mar  2 00:09 radeonsi_dri.so
-rwxr-xr-x   5 root root 13022784 Mar  2 00:09 radeonsi_drv_video.so
-rwxr-xr-x  12 root root 26219832 Mar  2 00:09 swrast_dri.so
-rwxr-xr-x  12 root root 26219832 Mar  2 00:09 virtio_gpu_dri.so
-rwxr-xr-x   5 root root 13022784 Mar  2 00:09 virtio_gpu_drv_video.so
-rwxr-xr-x  12 root root 26219832 Mar  2 00:09 vmwgfx_dri.so
-rwxr-xr-x  12 root root 26219832 Mar  2 00:09 zink_dri.so

(note that I do have Mesa 23.0.0 RPMs built locally inside F37/WSL with rpmbuild, but I have not installed them)

and

glxinfo -B

name of display: :0
display: :0  screen: 0
direct rendering: Yes
Extended renderer info (GLX_MESA_query_renderer):
    Vendor: Mesa/X.org (0xffffffff)
    Device: llvmpipe (LLVM 15.0.7, 256 bits) (0xffffffff)
    Version: 22.3.6
    Accelerated: no
    Video memory: 31970MB
    Unified memory: yes
    Preferred profile: core (0x1)
    Max core profile version: 4.5
    Max compat profile version: 4.5
    Max GLES1 profile version: 1.1
    Max GLES[23] profile version: 3.2
OpenGL vendor string: Mesa/X.org
OpenGL renderer string: llvmpipe (LLVM 15.0.7, 256 bits)
OpenGL core profile version string: 4.5 (Core Profile) Mesa 22.3.6
OpenGL core profile shading language version string: 4.50
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile

OpenGL version string: 4.5 (Compatibility Profile) Mesa 22.3.6
OpenGL shading language version string: 4.50
OpenGL context flags: (none)
OpenGL profile mask: compatibility profile

OpenGL ES profile version string: OpenGL ES 3.2 Mesa 22.3.6
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20

On Ubuntu (running in parallel) I get

glxinfo -B

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) UHD Graphics) (0xffffffff)
...

and, really, it takes half an eternity (500 ms?) for that output to show (with llvmpipe its instantaneous)

FWIW, there is some general interoperability going on - I can run compute on the NVidia card from WSL2, so generally it is accessible (keeping in mind to always fix the out-of-whack CUDA setup via https://forums.developer.nvidia.com/t/wsl2-libcuda-so-and-libcuda-so-1-should-be-symlink/236301)

In an ideal world, for accelerate graphics I'd be able to choose between

  • software rendering (llvmpipe)
  • accelerated to Intel XE (iGPU)
  • accelerated to Nvidia (dGPU)
    keeping in mind that on Ubuntu the visual artefacts are quite disruptive (suggestive of driver defects along the chain - perhaps in d3d12 itself?).

I have no idea how feasible this ideal world is with my hardware and (Windows, Linux) drivers; I wouldn't invest too much time into that, as CUDA is my main concern - and that works. For me, accelerated graphics inside WSL2 would only be an interesting thing to have.

@crramirez
Copy link
Contributor

You can choose Nvidia card by using:

export MESA_D3D12_ADAPTER_NAME=nvidia

I don't understand why is not picking the d3d12. Are you inside a desktop environment or something like that?

@shoffmeister
Copy link

Unfortunately, export MESA_D3D12_ADAPTER_NAME=nvidia does not seem to have any effect on my system:

  • Ubuntu - stays on "D3D12 (Intel(R) UHD Graphics) (0xffffffff)"
  • Fedora - stays on "llvmpipe (LLVM 15.0.7, 256 bits) (0xffffffff)"

... but according to https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10710/diffs#a7d30d7e3ed27f77d78e6873c484281764144c8c_77_77 the name is MESA_D3D12_DEFAULT_ADAPTER_NAME - and that works, on Ubuntu.

Insight gained from that (i.e. Nvidia turned on for Ubuntu):

  • Performance is horrible for glmark2
  • Video acceleration works (4K video on 4K screen from WSL2, decoded by Nvidia, presented by Intel on HDMI out)
  • Nvidia has no visual artefacts, Intel has defects in their driver

So 👍 on that :)

@crramirez
Copy link
Contributor

Good at least advanced a bit. Still don't know why in Fedora is not working

@shoffmeister
Copy link

I am quite at a loss to understand why things work on Ubuntu, but not on Fedora.

The existing Fedora is, mostly, a pristine installation of your fantastic Fedora Remix, with some adjustments (IIRC):

  • systemd=true
  • sudo dnf install konsole <-- KDE konsole
  • install some cursor themes

My experiments above are based on starting Windows Terminal, logging into the Fedora console, and then immediately running glxinfo.

So ... I created a fresh installation of Fedora Remix (uninstall / unregister -> install) and now

  • sudo dnf upgrade --refresh
  • wsl --shutdown
  • upgrade.sh
  • wsl --shutdown
  • glxinfo -B
    --> "llvmpipe"

This is Windows 11 22H2.

All the packages and drivers are present as expected. I added lshw and sudo lshw | grep dxg shows two PCI devices (as in Ubuntu)

But here is something really surprising: MESA_D3D12_DEFAULT_ADAPTER_NAME has some effect

  • glxinfo -B | grep Device == llvmpipe (LLVM 15.0.7, 256 bits) (0xffffffff)
  • MESA_D3D12_DEFAULT_ADAPTER_NAME=intel glxinfo -B | grep Device == llvmpipe (LLVM 15.0.7, 256 bits) (0xffffffff)
  • MESA_D3D12_DEFAULT_ADAPTER_NAME=nvidia glxinfo -B | grep Device == D3D12 (NVIDIA GeForce RTX 3060 Laptop GPU) (0xffffffff)

IOW, there is something wrong with the installation of the Intel drivers on Fedora that has the effect that d3d12 appears to be broken. Forcing the Nvidia driver then works, i.e.

  • wget https://packages.microsoft.com/yumrepos/edge/microsoft-edge-stable-110.0.1587.63-1.x86_64.rpm
  • sudo dnf install ./https://packages.microsoft.com/yumrepos/edge/microsoft-edge-stable-110.0.1587.63-1.x86_64.rpm
  • microsoft-edge
    --> works with software rendering
  • MESA_D3D12_DEFAULT_ADAPTER_NAME=nvidia microsoft-edge
    --> works with Nvidia -- video acceleration works, too

This leaves the question: What's wrong with the Intel driver installation on Fedora that it does not want to work through d3d12?

I took a look at LD_DEBUG=files MESA_D3D12_DEFAULT_ADAPTER_NAME=intel glxinfo -B 2> ld.txt and grep 'opening file=/usr/lib/wsl' ld.txt | cut -f 2 -d '=' | cut -f 1 -d ';' | sort --unique which shows ...

Ubuntu:

/usr/lib/wsl/drivers/iigd_dch.inf_amd64_fc51d29440c1dd25/libigc.so [0]
/usr/lib/wsl/drivers/iigd_dch.inf_amd64_fc51d29440c1dd25/libigd12dxva64.so [0]
/usr/lib/wsl/drivers/iigd_dch.inf_amd64_fc51d29440c1dd25/libigd12um64xel.so [0]
/usr/lib/wsl/drivers/iigd_dch.inf_amd64_fc51d29440c1dd25/libigd12umd64.so [0]
/usr/lib/wsl/drivers/iigd_dch.inf_amd64_fc51d29440c1dd25/libigdgmm_w.so.12 [0]
/usr/lib/wsl/lib/libd3d12.so [0]
/usr/lib/wsl/lib/libd3d12core.so [0]
/usr/lib/wsl/lib/libdxcore.so [0]

Fedora:

/usr/lib/wsl/drivers/iigd_dch.inf_amd64_fc51d29440c1dd25/libigd12um64xel.so [0]
/usr/lib/wsl/drivers/iigd_dch.inf_amd64_fc51d29440c1dd25/libigd12umd64.so [0]
/usr/lib/wsl/drivers/iigd_dch.inf_amd64_fc51d29440c1dd25/libigdgmm_w.so.12 [0]
/usr/lib/wsl/lib/libd3d12core.so [0]
/usr/lib/wsl/lib/libd3d12.so [0]
/usr/lib/wsl/lib/libdxcore.so [0]

... but it is not really obvious why libigc.so and libigd12dxva64.so are not loaded on Fedora.

I tried ltrace, but Ubuntu's version is too old to resolve strings for openat syscalls (which is where all the .so loading happens). Sigh. So strace. And strace finally suggests that libedit.so.2 is missing on Fedora

And libedit.so.2 is a bit of a mess between Ubuntu and Fedora:

  • Fedora knows this as libedit and installs libedit.so.0 and libedit.so.0.0.69
  • Ubuntu knows this as libedit2 and installs libedit.so.2 and libedit.so.2.0.70

And, yes, that's the exact same thing from https://www.thrysoee.dk/editline/

Resolution / hack: sudo ln -s /usr/lib64/libedit.so.0 /usr/lib64/libedit.so.2

And that finally, on Fedora 37 pristine + the hack, yields

MESA_D3D12_DEFAULT_ADAPTER_NAME=intel glxinfo -B | grep Device

Device: D3D12 (Intel(R) UHD Graphics) (0xffffffff)

The root cause for all of that is that readelf --dynamic /usr/lib/wsl/drivers/iigd_dch.inf_amd64_8a4323c80a901a5c/libLLVM-9.so shows a dependency on libedit.so.2

IOW, Intel most likely built their Linux driver bundle on Ubuntu. And the SONAMEs there are just plain incompatible with Fedora.

@shoffmeister
Copy link

TL;DR:

To marry the Mesa d3d12 driver with a Windows Intel driver for WSLg, the only solution on Fedora is sudo ln -s /usr/lib64/libedit.so.0 /usr/lib64/libedit.so.2

@shoffmeister
Copy link

FWIW, I was complaining about the large amount of visual artefacts on the Intel driver in Ubuntu - well even with their WSL Ubuntu Preview (23.04), they ship Mesa 22.2.5

It would seem as if a thing or two were fixed between Mesa 22.2.5 und 22.3.6, because I currently don't see these virtual artefacts on Fedora.

Video acceleration does not work on either distro - Ubuntu apparently doesn't ship that (at all), and on Fedora init fails (for Intel only) with libva error: /usr/lib64/dri/d3d12_drv_video.so init failed

@crramirez
Copy link
Contributor

Wow you did a huge investigation on making it work. I was thinking about the version difference between Ubuntu and Fedora, but I never though anything about not loading a library.

We are working on video acceleration. Because Fedora Team removed the video codecs from Fedora 37. And not only from mesa but from others like ffmpeg. So the user need to use another repo and install the full version of these programs.

We will publish a blog post with all the steps.

And I'll try to incorporate your findings into the image. So, other users can work with Intel cards

Best Regards
Carlos

@shoffmeister
Copy link

Just created a bug on WSLg for that at microsoft/wslg#996

@shoffmeister
Copy link

The hardware codec video acceleration challenge in general on Fedora is actually relatively tame, IMHO: barely anyone is affected because only few codecs on very few real hardware is affected (effectively AMD only) and the solution is https://rpmfusion.org/Howto/Multimedia?highlight=%28%5CbCategoryHowto%5Cb%29 (via rpmfusion-infra/fedy#110)

So, for WSLg, I don't see hardware video acceleration as much a problem (although what Nvidia manage to accomplish is quite astounding, to be honest)

Just my two cents.

@shoffmeister
Copy link

With respect to performance, I took inspiration from https://devblogs.microsoft.com/commandline/wslg-architecture/#hardware-accelerated-opengl and just ran those tests locally on the "fixed" Fedora 37.

TL;DR: The FPS on my system went 3 (llvmpipe) -> 30 (Intel) -> 103 (Nvidia). Whoops.

Apparently the performance "problem" with WSLg is all around the overhead transitioning between Mesa on the Linux side and execution on the real hardware: The more complex the individual batch is that can be executed on the hardware, the better the results are from the benchmark. The "Piano" test in this benchmark exposes this, as does the "Voloplosion".

IOW, glmark2 and in particular glxgears effectively only measure the call overhead for transitioning between the WSLg'ed Linux and the real hardware.

==================================
GpuTest 0.7.0
http://www.geeks3d.com

Module: PixMark Piano
Score: 182 points (FPS: 3)

Settings:
- 1024x640 windowed
- antialiasing: Off
- duration: 60000 ms

Renderer:
- llvmpipe (LLVM 15.0.7, 256 bits)
- OpenGL: 4.5 (Core Profile) Mesa 22.3.6
==================================
==================================
GpuTest 0.7.0
http://www.geeks3d.com

Module: PixMark Piano
Score: 653 points (FPS: 10)

Settings:
- 1024x640 windowed
- antialiasing: Off
- duration: 60000 ms

Renderer:
- D3D12 (Intel(R) UHD Graphics)
- OpenGL: 4.1 (Core Profile) Mesa 22.3.6
==================================
==================================
GpuTest 0.7.0
http://www.geeks3d.com

Module: PixMark Piano
Score: 6233 points (FPS: 103)

Settings:
- 1024x640 windowed
- antialiasing: Off
- duration: 60000 ms

Renderer:
- D3D12 (NVIDIA GeForce RTX 3060 Laptop GPU)
- OpenGL: 4.2 (Core Profile) Mesa 22.3.6
==================================

@nuitlejour
Copy link
Author

hello, there
When I tried to update.sh, the following message occurred:
curl: (7) Failed to connect to raw.githubusercontent.com port 443 after 94 ms: Connection refused
Do I need to set github id and password somewhere?
Or does update.sh offer options to enter login info?

@shoffmeister
Copy link

Connection refused is a networking (infrastructure) issue - nothing this project here can change.
Either github.com really had infrastructure problems - simply keep retrying manually - or something very specific to your route to that endpoint is in a bad mood.

That having been said, retry in the curl and explicit timeouts in the update script might make that more resilient (am unable to locate the current authoritative source for that script though)

@crramirez
Copy link
Contributor

OK it is a good point. Let's investigate a bit to see if we can put a loop with five retries or something similar.

Thanks for the suggestion

@nuitlejour
Copy link
Author

I have added url rule to my host file as follows, it works now:
185.199.108.133 raw.githubusercontent.com

@shoffmeister
Copy link

Just wanted to leave a note on the GpuTest benchmark for my specific laptop, on Windows 11, in a specific display configuration...

40 fps native vs (still) 100+ fps through WSLg (through Ubuntu 23.04 Preview + mesa git)

Funky.

---------------------------
GpuTest
---------------------------
GpuTest 0.7.0

http://www.geeks3d.com

Module: PixMark Piano
Score: 2400 points (FPS: 40)

Settings:
- 1024x640 windowed
- antialiasing: Off
- duration: 60000 ms

Renderer:
- NVIDIA GeForce RTX 3060 Laptop GPU/PCIe/SSE2
- OpenGL: 4.6.0 NVIDIA 531.18

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants