Closed harrisonmg closed 1 year ago
Moving to wslg
Fixed for now by downgrading to WSL 1.2.5
@harrisonmg, thanks for reporting the issue, do you see NVIDIA graphics drivers are shared from Windows host at /usr/lib/wsl/drivers on your system? For reference, I have WSL 2.0.0.0 pre-release with NVIDIA 537.42 driver, which is the latest for my NVIDIA board different from yours though, and it does not reproduce the issue, thanks!
@harrisonmg, thanks for reporting the issue, do you see NVIDIA graphics drivers are shared from Windows host at /usr/lib/wsl/drivers on your system? For reference, I have WSL 2.0.0.0 pre-release with NVIDIA 537.42 driver, which is the latest for my NVIDIA board different from yours though, and it does not reproduce the issue, thanks!
Unfortunately I can't check that dir as I've already downgraded
I did try upgrading to 537.34, which was the latest at the time
I also have both integrated GPU and dedicated GPU but I cannot reproduce this issue on my machine (I have WSL 2.0.1 installed):
With export MESA_D3D12_DEFAULT_ADAPTER_NAME=INTEL
or unset:
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 770) (0xffffffff)
Version: 23.0.4
Accelerated: yes
Video memory: 16393MB
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) UHD Graphics 770)
OpenGL core profile version string: 4.1 (Core Profile) Mesa 23.0.4-0ubuntu1~22.04.1
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.0.4-0ubuntu1~22.04.1
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.0.4-0ubuntu1~22.04.1
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.00
With export MESA_D3D12_DEFAULT_ADAPTER_NAME=NVIDIA
:
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 RTX 4070 Ti) (0xffffffff)
Version: 23.0.4
Accelerated: yes
Video memory: 28275MB
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 RTX 4070 Ti)
OpenGL core profile version string: 4.2 (Core Profile) Mesa 23.0.4-0ubuntu1~22.04.1
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.0.4-0ubuntu1~22.04.1
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.0.4-0ubuntu1~22.04.1
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.10
@hez2010, thanks for checking. The behavior you observed is expected when there is both integrated and dedicated GPU present. Currently it is configured to select integrated GPU by default (without MESA_D3D12_DEFAULT_ADAPTER_NAME
specified), and select dedicated GPU only when requested, thanks!
I will try and find time to test this with newer nvidia drivers, when I have the chance to re-upgrade and possibly re-downgrade WSL
@hideyukn88 I found the time to temporarily upgrade, and still no dice
~$ nvidia-smi
Fri Sep 29 13:36:46 2023
+---------------------------------------------------------------------------------------+
| NVIDIA-SMI 535.112 Driver Version: 537.42 CUDA Version: 12.2 |
|-----------------------------------------+----------------------+----------------------+
| GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|=========================================+======================+======================|
| 0 NVIDIA GeForce RTX 3050 ... On | 00000000:01:00.0 Off | N/A |
| N/A 44C P8 4W / 30W | 0MiB / 4096MiB | 0% Default |
| | | N/A |
+-----------------------------------------+----------------------+----------------------+
+---------------------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=======================================================================================|
| No running processes found |
+---------------------------------------------------------------------------------------+
~$ glxinfo -B
name of display: 192.168.64.1:0
display: 192.168.64.1:0 screen: 0
direct rendering: Yes
Extended renderer info (GLX_MESA_query_renderer):
Vendor: Mesa (0xffffffff)
Device: llvmpipe (LLVM 15.0.7, 256 bits) (0xffffffff)
Version: 23.1.7
Accelerated: no
Video memory: 7947MB
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
Memory info (GL_ATI_meminfo):
VBO free memory - total: 0 MB, largest block: 0 MB
VBO free aux. memory - total: 7424 MB, largest block: 7424 MB
Texture free memory - total: 0 MB, largest block: 0 MB
Texture free aux. memory - total: 7424 MB, largest block: 7424 MB
Renderbuffer free memory - total: 0 MB, largest block: 0 MB
Renderbuffer free aux. memory - total: 7424 MB, largest block: 7424 MB
Memory info (GL_NVX_gpu_memory_info):
Dedicated video memory: 0 MB
Total available memory: 7947 MB
Currently available dedicated video memory: 0 MB
OpenGL vendor string: Mesa
OpenGL renderer string: llvmpipe (LLVM 15.0.7, 256 bits)
OpenGL core profile version string: 4.5 (Core Profile) Mesa 23.1.7 - kisak-mesa PPA
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 23.1.7 - kisak-mesa PPA
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 23.1.7 - kisak-mesa PPA
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20
@harrisonmg, thanks for trying out. Regarding to /usr/lib/wsl/drivers folder, basically I would like you to see if Linux driver is provided in your driver installation (and loadable). For example, with my system...
1) Find NVIDIA display driver's class GUID on Windows's system.
c:\>pnputil /enum-drivers
...
Published Name: oem58.inf
Original Name: nvhdcwi.inf
Provider Name: NVIDIA
Class Name: Display
Class GUID: {4d36e968-e325-11ce-bfc1-08002be10318}
Driver Version: 09/12/2023 31.0.15.3742
Signer Name: Microsoft Windows Hardware Compatibility Publisher
...
2) Verify Linux driver is registered using above class GUID.
g:\>reg QUERY HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}\0000 /v UserModeDriverNameWsl
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}\0000
UserModeDriverNameWsl REG_MULTI_SZ C:\WINDOWS\System32\DriverStore\FileRepository\nvhdcwi.inf_amd64_337393e237204811\libnvwgf2umx.so
3) Make sure above Linux driver is present/visible from Linux side.
~$ ls /usr/lib/wsl/drivers/nvhdcwi.inf_amd64_337393e237204811/libnvwgf2umx.so -la
-r-xr-xr-x 1 root root 83261200 Sep 12 17:12 /usr/lib/wsl/drivers/nvhdcwi.inf_amd64_337393e237204811/libnvwgf2umx.so
4) (Optionally if driver presents) Verify the Linux driver is loadable (for checking dependencies).
~$ ldd /usr/lib/wsl/drivers/nvhdcwi.inf_amd64_337393e237204811/libnvwgf2umx.so
linux-vdso.so.1 (0x00007ffdbe733000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007ff1694c8000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007ff1694a5000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007ff169356000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007ff169350000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007ff169346000)
/lib64/ld-linux-x86-64.so.2 (0x00007ff16e69a000)
thanks!
Hi,
i have the same issue since upgrading to 2.0.x, i tried the last few preview versions 2.0.2, 2.0.3 and 2.0.4 With the previous 1.2.5 version the opengl driver was the nvidia driver.
I have tried many of the things that harrisonmg listed as well, also tried the mesa version from the kisak-mesa PPA, but nothing helped so far.
nvidia-smi/glxinfo:
~$ nvidia-smi
Fri Oct 6 12:05:04 2023
+---------------------------------------------------------------------------------------+
| NVIDIA-SMI 535.112 Driver Version: 537.42 CUDA Version: 12.2 |
|-----------------------------------------+----------------------+----------------------+
| GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|=========================================+======================+======================|
| 0 NVIDIA GeForce RTX 3070 Ti On | 00000000:2D:00.0 On | N/A |
| 0% 46C P5 27W / 310W | 7660MiB / 8192MiB | 32% Default |
| | | N/A |
+-----------------------------------------+----------------------+----------------------+
+---------------------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=======================================================================================|
| No running processes found |
+---------------------------------------------------------------------------------------+
~$ glxinfo -B
name of display: :0
display: :0 screen: 0
direct rendering: Yes
Extended renderer info (GLX_MESA_query_renderer):
Vendor: Mesa (0xffffffff)
Device: llvmpipe (LLVM 15.0.7, 256 bits) (0xffffffff)
Version: 23.0.4
Accelerated: no
Video memory: 32055MB
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
OpenGL renderer string: llvmpipe (LLVM 15.0.7, 256 bits)
OpenGL core profile version string: 4.5 (Core Profile) Mesa 23.0.4-0ubuntu1~22.04.1
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 23.0.4-0ubuntu1~22.04.1
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 23.0.4-0ubuntu1~22.04.1
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20
I did your described steps from the previous comment and it looks like the driver is present and loadable (or am I missing something?):
c:\>pnputil /enum-drivers
...
Veröffentlichter Name: oem9.inf
Originalname: nv_dispig.inf
Anbietername: NVIDIA
Klassenname: Grafikkarten
Klassen-GUID: {4d36e968-e325-11ce-bfc1-08002be10318}
Treiberversion: 09/12/2023 31.0.15.3742
Name des Signaturgebers: Microsoft Windows Hardware Compatibility Publisher
...
c:\> reg QUERY HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}\0000 /v UserModeDriverNameWsl
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}\0000
UserModeDriverNameWsl REG_MULTI_SZ C:\WINDOWS\System32\DriverStore\FileRepository\nv_dispig.inf_amd64_4e58e7ac1d277d04\libnvwgf2umx.so
~$ ls /usr/lib/wsl/drivers/nv_dispig.inf_amd64_4e58e7ac1d277d04/libnvwgf2umx.so -la
-r-xr-xr-x 1 root root 83261200 Sep 13 02:12 /usr/lib/wsl/drivers/nv_dispig.inf_amd64_4e58e7ac1d277d04/libnvwgf2umx.so
~$ ldd /usr/lib/wsl/drivers/nv_dispig.inf_amd64_4e58e7ac1d277d04/libnvwgf2umx.so
linux-vdso.so.1 (0x00007ffda47c1000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f4407d2b000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f4407d26000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f4407c3f000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f4407c3a000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f4407c35000)
/lib64/ld-linux-x86-64.so.2 (0x00007f440cf1c000)
@hideyukn88
I can only get my GPU to work correctly if I disable the MS packaged libraries by setting the (undocumented) wsl2.packagedGpuLibs = false
option in my .wslconfig
.
@mosullivan93, would you please share your WSL version? By wsl --version
from Windows's command prompt? Also, the version of your GPU driver? thanks!
WSL version: 2.0.6.0
Kernel version: 5.15.133.1-1
WSLg version: 1.0.59
MSRDC version: 1.2.4677
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.25880.1000-230602-1350.main
Windows version: 10.0.22000.2538
My GPU driver is 31.0.15.4592 according to the device properties, also known by Nvidia as v545.92. It is Maxwell (GTX970), so not officially supported for WSL2 by Nvidia. Before updating to the pre-release WSL2, glxinfo -B
would segfault. Now, it is detected correctly and can be used only when I disable the WSL packaged libraries.
@mosullivan93 Unrelated to the topic, but how did you install WSL version 2.0.6.0? My WSL2 goes up to 1.2.5.0 even though I have an insider build. And kernel version is lower too. I have the latest updates option enabled + updates from other Microsoft products. Thanks
@lashahub, you can install pre-release version of WSL by wsl --update --pre-release
from Windows's command prompt, thanks!
@hideyukn88 Great, thanks!
Fixed in 2.0.9
I also have both integrated GPU and dedicated GPU but I cannot reproduce this issue on my machine (I have WSL 2.0.1 installed):
With
export MESA_D3D12_DEFAULT_ADAPTER_NAME=INTEL
or unset: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 770) (0xffffffff) Version: 23.0.4 Accelerated: yes Video memory: 16393MB 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) UHD Graphics 770) OpenGL core profile version string: 4.1 (Core Profile) Mesa 23.0.4-0ubuntu1~22.04.1 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.0.4-0ubuntu1~22.04.1 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.0.4-0ubuntu1~22.04.1 OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.00
With
export MESA_D3D12_DEFAULT_ADAPTER_NAME=NVIDIA
: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 RTX 4070 Ti) (0xffffffff) Version: 23.0.4 Accelerated: yes Video memory: 28275MB 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 RTX 4070 Ti) OpenGL core profile version string: 4.2 (Core Profile) Mesa 23.0.4-0ubuntu1~22.04.1 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.0.4-0ubuntu1~22.04.1 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.0.4-0ubuntu1~22.04.1 OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.10
so, how to detect NVIDIA GPU automatically without using "export MESA_D3D12_DEFAULT_ADAPTER_NAME=NVIDIA"?
@edmondium, no there is no automatic way to select discrete GPU, NVIDIA in this case. mesa is configured to use integrated GPU by default. If discrete GPU needs to be selected, it has to use MESA_D3D12_DEFAULT_ADAPTER_NAME
, thanks!
Windows Version
Microsoft Windows [Version 10.0.19045.3448]
WSL Version
2.0.0.0
Are you using WSL 1 or WSL 2?
Kernel Version
5.15.123.1-1
Distro Version
Ubuntu 20.04
Other Software
Repro Steps
I updated to the WSL pre-release and it promptly stopped using my GPU in WSL apps, The GPU is still recognized by
nvidia-smi
as shown above, but not byglxinfo
. I didn't make this issue in the WSLg repo since this affects both WSLg and WSL + X server (I use a windows X server, VcXsrv).Fixes tried (and failed):
Various environment variable permutations
None seemed to help. Here is the previously working configuration.
Disabling
autoMemoryReclaim
I noticed in recent issues that
autoMemoryReclaim
seems to cause some issues, so I tried thedropcache
anddisable
options to no avail. My current.wslconfig
:Using WSLg
Setting
guiApplications=true
in.wslconfig
had no affect on the issue.Upgrading and downgrading Nvidia graphics drivers
I don't recall my original driver version, but I both updated to the newest version (537.34) and rolled back to 536.99 (Aug 8, GPU was working for me last month).
Upgrading to Ubuntu 22.04
This + switching to the mesa packages from the
oibaf/graphics-drivers
ppa, no dice.Trying a different computer
I updated two separate computers to the WSL pre-release (unfortunately, before I found this bug) and both have exhibited it in identical fashion. One of the computers has both an integrated Intel GPU and a dedicated Nvidia GPU, neither of which I could get Mesa to use. I understand that I may be able to use nvidia-prime to select a preferred device, but it seems that people for whom this solves their issue already have Mesa using one of their hardware devices, rather than being stuck on llvmpipe.
Expected Behavior
glxinfo -B
shows an NVIDIA or Intel device underExtended renderer info
andOpenGL renderer string
rather than llvmpipe.The dedicated GPU is used for GUI programs (WSLg or simply via X server).
Actual Behavior
Diagnostic Logs
No response