yuk7 / ArchWSL

ArchLinux based WSL Distribution. Supports multiple install.
https://git.io/archwsl
MIT License
6.54k stars 194 forks source link

As we know in issue #308 that mesa uses llvmpipe instead of D3D12, if my laptop has a nvidia gpu as well, how to make Arch use Nvidia GPU like the Ubuntu WSL do? #367

Open RayneScofield opened 1 month ago

RayneScofield commented 1 month ago

For my Ubuntu WSL that GPU indicates NVIDIA GeForce GTX1060

❯ 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 (NVIDIA GeForce GTX 1060) (0xffffffff) Version: 23.2.1 Accelerated: yes Video memory: 14164MB Unified memory: no Preferred profile: core (0x1) Max core profile version: 4.2 Max compat profile version: 4.2 Max GLES1 profile version: 1.1 Max GLES[23] profile version: 3.1 OpenGL vendor string: Microsoft Corporation OpenGL renderer string: D3D12 (NVIDIA GeForce GTX 1060) OpenGL core profile version string: 4.2 (Core Profile) Mesa 23.2.1-1ubuntu3.1~22.04.2 OpenGL core profile shading language version string: 4.20 OpenGL core profile context flags: (none) OpenGL core profile profile mask: core profile

OpenGL version string: 4.2 (Compatibility Profile) Mesa 23.2.1-1ubuntu3.1~22.04.2 OpenGL shading language version string: 4.20 OpenGL context flags: (none) OpenGL profile mask: compatibility profile

OpenGL ES profile version string: OpenGL ES 3.1 Mesa 23.2.1-1ubuntu3.1~22.04.2 OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.10

Is it possible to config Archlinux to perform this way?

dmitry3l commented 1 month ago

does your arch have /usr/lib/dri/d3d12_dri.so?

RayneScofield commented 1 month ago

does your arch have /usr/lib/dri/d3d12_dri.so?

no, there is no /usr/lib/dri direcoty.

dmitry3l commented 1 month ago

does your arch have /usr/lib/dri/d3d12_dri.so?

no, there is no /usr/lib/dri direcoty.

/usr/lib/dri/d3d12_dri.so is owned by mesa 1:24.0.7-3 reinstall mesa maybe your installation is corrupted

reflyable commented 3 weeks ago

does your arch have /usr/lib/dri/d3d12_dri.so?你的 Arch 有 /usr/lib/dri/d3d12_dri.so 吗?

I have the file, but it still uses LLVM as renderer. 图片

dmitry3l commented 3 weeks ago

does your arch have /usr/lib/dri/d3d12_dri.so?你的 Arch 有 /usr/lib/dri/d3d12_dri.so 吗?

I have the file, but it still uses LLVM as renderer. 图片

try MESA_LOADER_DRIVER_OVERRIDE=d3d12 glxinfo -B | grep render what do you see?

reflyable commented 3 weeks ago

does your arch have /usr/lib/dri/d3d12_dri.so?你的 Arch 有 /usr/lib/dri/d3d12_dri.so 吗?

I have the file, but it still uses LLVM as renderer. 图片

try MESA_LOADER_DRIVER_OVERRIDE=d3d12 glxinfo -B | grep render what do you see?

The same as before.

图片

dmitry3l commented 3 weeks ago

does your arch have /usr/lib/dri/d3d12_dri.so?你的 Arch 有 /usr/lib/dri/d3d12_dri.so 吗?

I have the file, but it still uses LLVM as renderer. 图片

try MESA_LOADER_DRIVER_OVERRIDE=d3d12 glxinfo -B | grep render what do you see?

The same as before.

图片

Is your gpu included in this (including same driver version or more recent)? image

reflyable commented 3 weeks ago

does your arch have /usr/lib/dri/d3d12_dri.so?你的 Arch 有 /usr/lib/dri/d3d12_dri.so 吗?

I have the file, but it still uses LLVM as renderer. 图片

try MESA_LOADER_DRIVER_OVERRIDE=d3d12 glxinfo -B | grep render what do you see?

The same as before. 图片

Is your gpu included in this (including same driver version or more recent)? image

yes, I use a laptop with two gpu. A GeForce RTX 4060 laptop with driver 551.86 and a Intel Iris Xe with driver 31.0.101.4502.

dmitry3l commented 3 weeks ago

does your arch have /usr/lib/dri/d3d12_dri.so?你的 Arch 有 /usr/lib/dri/d3d12_dri.so 吗?

I have the file, but it still uses LLVM as renderer. 图片

try MESA_LOADER_DRIVER_OVERRIDE=d3d12 glxinfo -B | grep render what do you see?

The same as before. 图片

Is your gpu included in this (including same driver version or more recent)? image

yes, I use a laptop with two gpu. A GeForce RTX 4060 laptop with driver 551.86 and a Intel Iris Xe with driver 31.0.101.4502.

AFAIK it should work out of box if you have guiApplications=true in ur .wslconfig maybe someone will find out what i missed here

AreamanM commented 3 weeks ago

Hi I had the same problem this thread is about and I think I've figure out a fix for this from https://github.com/microsoft/wslg/issues/1254#issuecomment-2150471340 and https://github.com/microsoft/wslg/issues/1254#issuecomment-2155259633

xuangeyouneihan commented 2 weeks ago

Hello, I have the same issue here. When I rebuild Mesa according to @AreamanM's method, it tells me that fakeinstall/usr/lib/libspirv_to_dxil.a is not a directory. What should I do now?

dmitry3l commented 2 weeks ago

Hello, I have the same issue here. When I rebuild Mesa according to @AreamanM's method, it tells me that fakeinstall/usr/lib/libspirv_to_dxil.a is not a directory. What should I do now?

thats because libspirv_to_dxil.a is a static library anyways i use this script

  _install fakeinstall/usr/share/vulkan/icd.d/dzn_icd*.json
  _install fakeinstall/$_libdir/libvulkan_dzn.so
  _install fakeinstall/$_libdir/libspirv_to_dxil.so
  _install fakeinstall/$_libdir/libspirv_to_dxil.a
  _install fakeinstall/$_libdir/clon12compiler.so
  _install fakeinstall/usr/bin/spirv2dxil
xuangeyouneihan commented 2 weeks ago

In package_microsoft-dozen-driver()?

dmitry3l commented 1 week ago

In package_microsoft-dozen-driver()?

obv yes

jaxvanyang commented 6 days ago

mesa package maintainer has updated the PKGBUILD, the _install function is replaced by the new _pick function. So the workaround script need update too. And I created a fork here: https://gitlab.archlinux.org/jaxvanyang/mesa/-/blob/dozen/PKGBUILD. It should be enough to use.