ArchWSL icon indicating copy to clipboard operation
ArchWSL copied to clipboard

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?

Open RayneScofield opened this issue 1 year ago • 17 comments

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?

RayneScofield avatar May 20 '24 07:05 RayneScofield

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

dmitry3l avatar May 22 '24 20:05 dmitry3l

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

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

RayneScofield avatar May 23 '24 14:05 RayneScofield

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

dmitry3l avatar May 24 '24 08:05 dmitry3l

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. 图片

reflyable avatar Jun 04 '24 12:06 reflyable

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?

dmitry3l avatar Jun 07 '24 09:06 dmitry3l

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.

图片

reflyable avatar Jun 07 '24 09:06 reflyable

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

dmitry3l avatar Jun 07 '24 09:06 dmitry3l

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.

reflyable avatar Jun 07 '24 09:06 reflyable

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

dmitry3l avatar Jun 07 '24 09:06 dmitry3l

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

AreamanM avatar Jun 07 '24 20:06 AreamanM

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?

xuangeyouneihan avatar Jun 14 '24 05:06 xuangeyouneihan

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

dmitry3l avatar Jun 16 '24 12:06 dmitry3l

In package_microsoft-dozen-driver()?

xuangeyouneihan avatar Jun 17 '24 02:06 xuangeyouneihan

In package_microsoft-dozen-driver()?

obv yes

dmitry3l avatar Jun 19 '24 09:06 dmitry3l

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.

jaxvanyang avatar Jun 25 '24 02:06 jaxvanyang

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.

Cannot this be a separate pkg that only install de Microsoft dependencies? using this are installing all vulkan libraries to me, so a I have to remove the ones that doesn't fit (intel e afins)

freedxmgxd avatar Nov 05 '24 10:11 freedxmgxd

May I ask how did you manage to get the D3D12 driver working at all?

On a fresh install for me absolutely nothing works. It's defaults to llvmpipe.

Edit: Misunderstood the premise. AFAIK building dozen into mesa shouldn't be required, as the d3d12 driver is already there. Dozen is just for Vulkan support.

zoltan-magyar avatar Jan 22 '25 15:01 zoltan-magyar