wslg: GUI app exit with segmentfault in NVIDIA GPU driver

Version

Microsoft Windows [版本 10.0.22598.1]

WSL Version

  • WSL 2
  • WSL 1

Kernel Version

5.10.102.1

Distro Version

Debian 11

Other Software

默认分发: Debian 默认版本: 2 WSL 版本: 0.58.1.0 内核版本: 5.10.102.1 WSLg 版本: 1.0.33 MSRDC 版本: 1.2.2924 Direct3D 版本: 1.601.0 Windows 版本: 10.0.22598.1

Repro Steps

run wsl from cmd. run glxinfo -B from wsl. run qtcreator from wsl.

Expected Behavior

glxinfo exits normally. And other GUI/qt app should work normally.

Actual Behavior

~$ 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 1650) (0xffffffff)
    Version: 22.0.1
    Accelerated: yes
    Video memory: 20024MB
    Unified memory: no
    Preferred profile: core (0x1)
    Max core profile version: 3.3
    Max compat profile version: 3.3
    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 1650)
OpenGL core profile version string: 3.3 (Core Profile) Mesa 22.0.1 - kisak-mesa PPA
OpenGL core profile shading language version string: 3.30
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile

OpenGL version string: 3.3 (Compatibility Profile) Mesa 22.0.1 - kisak-mesa PPA
OpenGL shading language version string: 3.30
OpenGL context flags: (none)
OpenGL profile mask: compatibility profile

OpenGL ES profile version string: OpenGL ES 3.1 Mesa 22.0.1 - kisak-mesa PPA
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.10

Segmentation fault

run qtcreator, close app, and get

~$ qtcreator
Segmentation fault

Diagnostic Logs

everything goes well before doing wsl --update, and after windows update(Windows 11 Insider Preview 22598.1 (ni_release)). dmeg:

qtcreator[341]: segfault at 7f9e2c5e4000 ip 00007f9e18405aca sp 00007f9e264e5db0 error 4 in libnvwgf2umx.so[7f9e17aba000+1415000]
[  235.082142] Code: 01 be 00 00 00 00 31 d2 45 31 f6 eb 1d 90 90 90 8b 45 10 48 8b 54 24 10 48 83 c2 01 89 c1 83 c6 01 48 39 ca 0f 83 56 01 00 00 <41> 8b 4c 95 00 0f b7 c9 3b 8c 95 44 04 00 00 74 dd 89 8c 95 44 04
[  235.083786] potentially unexpected fatal signal 11.
[  235.084190] CPU: 3 PID: 341 Comm: qtcreator Not tainted 5.10.102.1-microsoft-standard-WSL2 microsoft/WSL#1
[  235.084897] RIP: 0033:0x7f9e18405aca
[  235.085212] Code: 01 be 00 00 00 00 31 d2 45 31 f6 eb 1d 90 90 90 8b 45 10 48 8b 54 24 10 48 83 c2 01 89 c1 83 c6 01 48 39 ca 0f 83 56 01 00 00 <41> 8b 4c 95 00 0f b7 c9 3b 8c 95 44 04 00 00 74 dd 89 8c 95 44 04
[  235.086602] RSP: 002b:00007f9e264e5db0 EFLAGS: 00010246
[  235.087094] RAX: 000000000000000e RBX: 000000000135f000 RCX: 00000000013ca020
[  235.087889] RDX: 0000000000000000 RSI: 0000000000000000 RDI: 000000000135f000
[  235.088617] RBP: 00000000013c8be0 R08: 0000000000000000 R09: 00007ffe18a5c080
[  235.089205] R10: 000000000000aea4 R11: 0000000000000000 R12: 00007f9e264e5e28
[  235.089835] R13: 00007f9e2c5e4000 R14: 0000000000000000 R15: 00007f9e16ec2101
[  235.090474] FS:  00007f9e264e6700 GS:  0000000000000000
[  235.090978] dxgk:err: wait_for_complition failed: fffffe00
[  235.091020] dxgk:err: wait_for_complition failed: fffffe00
[  235.092278] dxgk:err: did not find packet to complete

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Reactions: 27
  • Comments: 75

Most upvoted comments

I have same issue, actually I got segfault when I exit any gui apps.

For what it is worth. Started having these segfaults at gl app exits (such as glxinfo) today after performing an ubuntu update. However, it only happens when selecting the Nvidia GPU. Setting either LIBGL_ALWAYS_SOFTWARE=1 or MESA_D3D12_DEFAULT_ADAPTER_NAME=Intel (my machine has an intel IGP + dedicated Quadro p1000) makes the apps exit without crash.

gdb also points to libnvwgf2umx.so causing the segfault for me.

Have tried updating the nvidia windows driver, but this does not seem to fix it.

WSL version: 1.0.3.0 Kernel version: 5.15.79.1 WSLg version: 1.0.47 MSRDC version: 1.2.3575 Direct3D version: 1.606.4 DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp Windows version: 10.0.19044.2486

Seems like segfault is back with latest wsl/wslg.

➤ wsl --version
WSL version: 2.1.1.0
Kernel version: 5.15.146.1-2
WSLg version: 1.0.60
MSRDC version: 1.2.5105
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.22621.3078
➤ 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 RTX 2060 SUPER) (0xffffffff)
    Version: 23.0.4
    Accelerated: yes
    Video memory: 24344MB
    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 2060 SUPER)
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

Segmentation fault

Same issue, no OpenGL required – just a simple display of an image using SDL2. On application exit there is the crash in the NVidia driver, at exactly the place shown in the lldb provided by @junaire.

wsl --version results:

WSL version: 1.1.0.0
Kernel version: 5.15.83.1
WSLg version: 1.0.48
MSRDC version: 1.2.3770
Direct3D version: 1.608.2-61064218
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.25284.1000

And error is literally:

* thread #2, name = 'game-thing', stop reason = signal SIGSEGV: invalid address (fault address: 0x7fffea7bc000)
    frame #0: 0x00007fffed23ef0a libnvwgf2umx.so`___lldb_unnamed_symbol196498$$libnvwgf2umx.so + 106
libnvwgf2umx.so`___lldb_unnamed_symbol196498$$libnvwgf2umx.so:
->  0x7fffed23ef0a <+106>: movl   (%r13,%rdx,4), %ecx
    0x7fffed23ef0f <+111>: movzwl %cx, %ecx
    0x7fffed23ef12 <+114>: cmpl   0x44c(%rsi,%rdx,4), %ecx
    0x7fffed23ef19 <+121>: je     0x7fffed23eef8            ; <+88>

I added some extra debugging to the program I was testing (just a quick&dirty bit to re-familiarize myself with SDL and get comfortable with SDL2 after a long period of doing a lot of systems work) and it reaches the final return 0 of main() (or thereabouts) and then crashes. This occurs after releasing everything that was allocated and making output about such.

Note: I did add a breakpoint in lldb and single-step and it did not crash on that run, so this might be a timing issue where one of the threads tries a use-after-free, but… I have no clue, as I didn’t write any code for extra threads in the quick test program.

You can update it with wsl --update --pre-release

$ wsl --update --pre-release
Checking for updates.
Updating Windows Subsystem for Linux to version: 1.3.11.

I can confirm that the crash appears to be gone for me, too, once WSL was updated to 1.3.11.

It is solved after sudo chmod 666 /dev/dri/*. I hope this helps. https://github.com/microsoft/WSL/issues/9523#issuecomment-1403671300

Update: There is still the same error inside a Docker container in WSL2.

Update 2: Docker is working following this https://github.com/microsoft/wslg/blob/main/samples/container/Containers.md but with unofficial mesa drivers update. https://github.com/microsoft/WSL/issues/7507#issuecomment-950235017

Have done a lot more digging and this looks to, actually, be coming up out of the event poll loop – quite literally the top call on that specific thread (apparently created just for event polling by LibSDL2 without me specifically doing it) is a call to the glibc poll function – see:

libc.so.6!__GI___poll(struct pollfd * fds, nfds_t nfds, int timeout) (\build\glibc-SzIz7B\glibc-2.31\sysdeps\unix\sysv\linux\poll.c:29)
libnvwgf2umx.so![Unknown/Just-In-Time compiled code] (Unknown Source:0)
libpthread.so.0!start_thread(void * arg) (\build\glibc-SzIz7B\glibc-2.31\nptl\pthread_create.c:477)
libc.so.6!clone() (\build\glibc-SzIz7B\glibc-2.31\sysdeps\unix\sysv\linux\x86_64\clone.S:95)

So it looks like about 5 threads are started for handling various bits of DirectX interaction and in the one that interacts directly with the NVidia driver code we get the exception. I grabbed the above from a breakpoint (and thanks, MS, for the nice debugger integration in VSCode - first time I’ve used a GUI debugger that worked this well) and, well… that is what I’ve found. The other 4 extra threads (that do not interact with the actual root thread of the code) are all a lot of calls to libpthread and a single call to libd3d12core.so

Basically… This looks more and more like a race condition or conflict – though I’ve been unable to replicate the “successful completion without exception after single-stepping” again.

Still present for me as well.

PS C:\Users\ikono> wsl --version
WSL version: 1.0.3.0
Kernel version: 5.15.79.1
WSLg version: 1.0.47
MSRDC version: 1.2.3575
Direct3D version: 1.606.4
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.22621.963
ikonone@devbot:~$ 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 RTX 3060 Laptop GPU) (0xffffffff)
    Version: 22.0.5
    Accelerated: yes
    Video memory: 26335MB
    Unified memory: no
    Preferred profile: core (0x1)
    Max core profile version: 3.3
    Max compat profile version: 3.3
    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 3060 Laptop GPU)
OpenGL core profile version string: 3.3 (Core Profile) Mesa 22.0.5
OpenGL core profile shading language version string: 3.30
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile

OpenGL version string: 3.3 (Compatibility Profile) Mesa 22.0.5
OpenGL shading language version string: 3.30
OpenGL context flags: (none)
OpenGL profile mask: compatibility profile

OpenGL ES profile version string: OpenGL ES 3.1 Mesa 22.0.5
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.10

Segmentation fault
ikonone@devbot:~$
(gdb) run -B
Starting program: /usr/bin/glxinfo -B
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
name of display: :0
[Detaching after vfork from child process 161]
[New Thread 0x7fffe9699640 (LWP 163)]
[New Thread 0x7fffe3fff640 (LWP 164)]
[New Thread 0x7fffe37fe640 (LWP 165)]
[New Thread 0x7fffe2ffd640 (LWP 166)]
[New Thread 0x7fffe27fc640 (LWP 167)]
[New Thread 0x7fffe16fb640 (LWP 168)]
display: :0  screen: 0
direct rendering: Yes
Extended renderer info (GLX_MESA_query_renderer):
    Vendor: Microsoft Corporation (0xffffffff)
    Device: D3D12 (NVIDIA GeForce RTX 3060 Laptop GPU) (0xffffffff)
    Version: 22.0.5
    Accelerated: yes
    Video memory: 26335MB
    Unified memory: no
    Preferred profile: core (0x1)
    Max core profile version: 3.3
    Max compat profile version: 3.3
    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 3060 Laptop GPU)
OpenGL core profile version string: 3.3 (Core Profile) Mesa 22.0.5
OpenGL core profile shading language version string: 3.30
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
[New Thread 0x7fffe0efa640 (LWP 169)]
[Thread 0x7fffe16fb640 (LWP 168) exited]

OpenGL version string: 3.3 (Compatibility Profile) Mesa 22.0.5
OpenGL shading language version string: 3.30
OpenGL context flags: (none)
OpenGL profile mask: compatibility profile
[New Thread 0x7fffe16fb640 (LWP 170)]
[Thread 0x7fffe0efa640 (LWP 169) exited]

OpenGL ES profile version string: OpenGL ES 3.1 Mesa 22.0.5
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.10

[Thread 0x7fffe16fb640 (LWP 170) exited]

Thread 2 "glxinfo" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffe9699640 (LWP 163)]
0x00007fffec15bf0a in ?? () from /usr/lib/wsl/drivers/nvamig.inf_amd64_e3bf6f587f5b65de/libnvwgf2umx.so
(gdb)

any progress here? I have the same problem.

Same issue

glxinfo and glxgears both run, but always end with segmentation fault. other graphics applications that require openGL fail to run altogether

WSL version: 1.0.3.0
Kernel version: 5.15.79.1
WSLg version: 1.0.47
MSRDC version: 1.2.3575
Direct3D version: 1.606.4
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.19045.2486
> LIBGL_DEBUG=VERBOSE glxinfo -B
name of display: :0
libGL: Can't open configuration file /etc/drirc: No such file or directory.
libGL: Can't open configuration file /home/tweckx/.drirc: No such file or directory.
libGL: Can't open configuration file /etc/drirc: No such file or directory.
libGL: Can't open configuration file /home/tweckx/.drirc: No such file or directory.
display: :0  screen: 0
direct rendering: Yes
Extended renderer info (GLX_MESA_query_renderer):
    Vendor: Microsoft Corporation (0xffffffff)
    Device: D3D12 (NVIDIA GeForce RTX 2070 Super) (0xffffffff)
    Version: 22.0.5
    Accelerated: yes
    Video memory: 24258MB
    Unified memory: no
    Preferred profile: core (0x1)
    Max core profile version: 3.3
    Max compat profile version: 3.3
    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 2070 Super)
OpenGL core profile version string: 3.3 (Core Profile) Mesa 22.0.5
OpenGL core profile shading language version string: 3.30
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile

OpenGL version string: 3.3 (Compatibility Profile) Mesa 22.0.5
OpenGL shading language version string: 3.30
OpenGL context flags: (none)
OpenGL profile mask: compatibility profile

OpenGL ES profile version string: OpenGL ES 3.1 Mesa 22.0.5
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.10

Segmentation fault

i’m getting segfaults in libnvwgf2umx.so running Intellij IDEA.

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007f8d5a7c73a1, pid=1065, tid=1120
#
# JRE version: OpenJDK Runtime Environment JBR-11.0.15.10-2043.56-jcef (11.0.15+10) (build 11.0.15+10-b2043.56)
# Java VM: OpenJDK 64-Bit Server VM JBR-11.0.15.10-2043.56-jcef (11.0.15+10-b2043.56, mixed mode, tiered, compressed oop
s, parallel gc, linux-amd64)
# Problematic frame:
# C  [libnvwgf2umx.so+0x1a463a1]
#
# Core dump will be written. Default location: Core dumps may be processed with "/usr/share/apport/apport -p%p -s%s -c%c
 -d%d -P%P -u%u -g%g -- %E" (or dumping to /home/chrisng/core.1065)
#
# If you would like to submit a bug report, please visit:
#   https://bugreport.java.com/bugreport/crash.jsp
#

and THREAD details:

Host: Intel(R) Core(TM) i7-8700K CPU @ 3.70GHz, 12 cores, 15G, Ubuntu 22.04 LTS
Time: Fri Jul  8 10:23:08 2022 BST elapsed time: 711.917453 seconds (0d 0h 11m 51s)

---------------  T H R E A D  ---------------

Current thread is native thread

Stack: [0x00007f8d3685c000,0x00007f8d3705b000],  sp=0x00007f8d37059d90,  free space=8183k
Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code)
C  [libnvwgf2umx.so+0x1a463a1]

[error occurred during error reporting (printing native stack), id 0xb, SIGSEGV (0xb) at pc=0x00007f8e927ba292]


siginfo: si_signo: 11 (SIGSEGV), si_code: 1 (SEGV_MAPERR), si_addr: 0x00007f8d530b1000

yes, I can also confirm that both intel and nvidia working as expected, unlike previously tested[1]

[1] https://github.com/microsoft/wslg/issues/715#issuecomment-1937349068

I just applied the latest apt upgrade and the problem appears to be fixed now. Can anyone else confirm?

Setting up libglapi-mesa:amd64 (23.2.1-1ubuntu3.1~22.04.2) ...
Setting up mesa-va-drivers:amd64 (23.2.1-1ubuntu3.1~22.04.2) ...
Setting up libgl1-mesa-dri:amd64 (23.2.1-1ubuntu3.1~22.04.2) ...
Setting up libegl-mesa0:amd64 (23.2.1-1ubuntu3.1~22.04.2) ...
Setting up ubuntu-release-upgrader-core (1:22.04.19) ...
Setting up libglx-mesa0:amd64 (23.2.1-1ubuntu3.1~22.04.2) ...

Same versions as you.

Crashes with nvidia works with intel.

$ MESA_D3D12_DEFAULT_ADAPTER_NAME="INTEL" glxinfo -B
<snip>
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.0.4-0ubuntu1~22.04.1
OpenGL core profile shading language version string: 4.10
<snip>

$ MESA_D3D12_DEFAULT_ADAPTER_NAME="NVIDIA" glxinfo -B
<snip>
OpenGL vendor string: Microsoft Corporation
OpenGL renderer string: D3D12 (NVIDIA T500)
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
<snip>
Segmentation fault

Seems like segfault is back with latest wsl/wslg.

➤ wsl --version
WSL version: 2.1.1.0
Kernel version: 5.15.146.1-2
WSLg version: 1.0.60
MSRDC version: 1.2.5105
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.22621.3078
➤ 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 RTX 2060 SUPER) (0xffffffff)
    Version: 23.0.4
    Accelerated: yes
    Video memory: 24344MB
    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 2060 SUPER)
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

Segmentation fault

Two weeks. and no one is looking to this?

↪ ~ ➤ nvidia-smi
Tue Jul 11 21:07:53 2023
+---------------------------------------------------------------------------------------+
| NVIDIA-SMI 535.54.06              Driver Version: 536.40       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 2060 ...    On  | 00000000:08:00.0  On |                  N/A |
| 37%   41C    P8              17W / 175W |   1250MiB /  8192MiB |      4%      Default |
|                                         |                      |                  N/A |
+-----------------------------------------+----------------------+----------------------+

+---------------------------------------------------------------------------------------+
| Processes:                                                                            |
|  GPU   GI   CI        PID   Type   Process name                            GPU Memory |
|        ID   ID                                                             Usage      |
|=======================================================================================|
|    0   N/A  N/A        48      G   /Xwayland                                 N/A      |
+---------------------------------------------------------------------------------------+
↪ ~ ➤ 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 RTX 2060 SUPER) (0xffffffff)
    Version: 22.2.5
    Accelerated: yes
    Video memory: 24359MB
    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 2060 SUPER)
OpenGL core profile version string: 4.2 (Core Profile) Mesa 22.2.5-0ubuntu0.1~22.04.3
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 22.2.5-0ubuntu0.1~22.04.3
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 22.2.5-0ubuntu0.1~22.04.3
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.10

↪ ~ ➤

@andreear-23

$ nvidia-smi
Tue Jul 11 22:26:22 2023
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 527.92.01    Driver Version: 528.02       CUDA Version: 12.0     |
|-------------------------------+----------------------+----------------------+
| 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 ...  On   | 00000000:01:00.0  On |                  N/A |
|  0%   34C    P8    14W / 285W |   1178MiB / 12282MiB |      1%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|    0   N/A  N/A        23      G   /Xwayland                       N/A      |
|    0   N/A  N/A        23      G   /Xwayland                       N/A      |
|    0   N/A  N/A        26      G   /Xwayland                       N/A      |
+-----------------------------------------------------------------------------+

$ 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 RTX 4070 Ti) (0xffffffff)
    Version: 22.2.5
    Accelerated: yes
    Video memory: 44341MB
    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 22.2.5-0ubuntu0.1~22.04.3
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 22.2.5-0ubuntu0.1~22.04.3
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 22.2.5-0ubuntu0.1~22.04.3
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.10

@andreear-23 I’ve been using the latest driver release using Geforce Experience – thats it, entirely. Though I’m also, IIRC, using an older Ubuntu install as I’ve had it going since WSL2 first became available, so that might be it.

Waiting on wsl --update --pre-release to finish right now (14:11 EST) after the last run saw no change and WSL still reporting itself as 1.2.5…

… …

No crash on any test programs exit! Looks like this bug is truly fixed. Hurrah!

Here’s 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 RTX 3070) (0xffffffff)
    Version: 21.2.6
    Accelerated: yes
    Video memory: 40748MB
    Unified memory: no
    Preferred profile: core (0x1)
    Max core profile version: 3.3
    Max compat profile version: 3.1
    Max GLES1 profile version: 1.1
    Max GLES[23] profile version: 3.0
OpenGL vendor string: Microsoft Corporation
OpenGL renderer string: D3D12 (NVIDIA GeForce RTX 3070)
OpenGL core profile version string: 3.3 (Core Profile) Mesa 21.2.6
OpenGL core profile shading language version string: 3.30
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile

OpenGL version string: 3.1 Mesa 21.2.6
OpenGL shading language version string: 1.40
OpenGL context flags: (none)

OpenGL ES profile version string: OpenGL ES 3.0 Mesa 21.2.6
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.00

And wsl --version:

WSL version: 1.3.11.0
Kernel version: 5.15.90.2-3
WSLg version: 1.0.54
MSRDC version: 1.2.4240
Direct3D version: 1.608.2-61064218
DXCore version: 10.0.25880.1000-230602-1350.main
Windows version: 10.0.25393.1

Apparently v1.3.10.0 fixed the segfault. I only tried glxinfo -B couple of times, and it ended successfully without segfault at the end. (off-topic: Though this version nukes systemd user sessions). Other who have extensive graphics tests ready might want to run them in v1.3.10.0

Yup, I can also confirm that installing 1.3.11.0 fixed the problem even with systemd enabled.

do I have to have windows insider to be able to upgrade my wslg to this version? doing wsl --upgrade and checking apps and features it looks like I still have v1.2.5.0. instructions for installation seem to stop at “get windows subsystem for linux and make sure you are on version 2.”

context, I am trying to use the helloscala starter app to verify my environment is set up for for android development with scala through wsl2 following this guide https://docs.scala-lang.org/tutorials/scala-on-android.html and this segfault is the latest snag I’ve hit. using WSL2 with Ubuntu 22.04.2 on Windows 11 OS host.

No, you just need to install https://github.com/microsoft/WSL/releases/download/1.3.11/Microsoft.WSL_1.3.11.0_x64_ARM64.msixbundle

Apparently v1.3.10.0 fixed the segfault. I only tried glxinfo -B couple of times, and it ended successfully without segfault at the end. (off-topic: Though this version nukes systemd user sessions).

Other who have extensive graphics tests ready might want to run them in v1.3.10.0

Another observation: if we use systemd bottle, genie / distrod, the segfault occurs for more apps / occasions. For example android emulator always segfaults for me when inside systemd. But outside systemd It open once or twice over ~20 tries. As the crush is happening from libnv... .so, I wonder if its even fixable from wslg? Who maintains those nvidia linux wsl drivers?

I also encountered this problem on IntelliJ IDEA right after enabling systemd. It never did for months when systemd wasn’t there.

I think I have encountered the same problem when using SDL2.

Test code:

#include <SDL2/SDL.h>
int main() {
    SDL_Init(SDL_INIT_VIDEO);
    SDL_Quit();
    return 0;
}

Compile & run using gcc test.c -lSDL2 -g && gdb a.out gives to following result:

Thread 2 "a.out" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffe6ee1640 (LWP 7593)]
0x00007fffe998ca6c in ?? () from /usr/lib/wsl/drivers/nvhmi.inf_amd64_5f5af535a7a77378/libnvwgf2umx.so
(gdb) bt
#0  0x00007fffe998ca6c in ?? () from /usr/lib/wsl/drivers/nvhmi.inf_amd64_5f5af535a7a77378/libnvwgf2umx.so
#1  0x00007fffe998b70e in ?? () from /usr/lib/wsl/drivers/nvhmi.inf_amd64_5f5af535a7a77378/libnvwgf2umx.so
#2  0x00007fffe998b686 in ?? () from /usr/lib/wsl/drivers/nvhmi.inf_amd64_5f5af535a7a77378/libnvwgf2umx.so
#3  0x00007ffff7c7cb43 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
#4  0x00007ffff7d0ea00 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81

And this works for me

Setting either LIBGL_ALWAYS_SOFTWARE=1 or MESA_D3D12_DEFAULT_ADAPTER_NAME=Intel (my machine has an intel IGP + dedicated Quadro p1000) makes the apps exit without crash.

wsl --version:

WSL version: 1.1.5.0
Kernel version: 5.15.90.1
WSLg version: 1.0.50
MSRDC version: 1.2.3770
Direct3D version: 1.608.2-61064218
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.22624.1465

apt search libsdl | grep installed:

libsdl2-2.0-0/jammy-updates,now 2.0.20+dfsg-2ubuntu1.22.04.1 amd64 [installed,automatic]
libsdl2-dev/jammy-updates,now 2.0.20+dfsg-2ubuntu1.22.04.1 amd64 [installed]
libsdl2-image-2.0-0/jammy,now 2.0.5+dfsg1-3build1 amd64 [installed,automatic]
libsdl2-image-dev/jammy,now 2.0.5+dfsg1-3build1 amd64 [installed]

And what about those of us who are using, say, ubuntu-20.04 because it’s a pain to migrate a large $HOME to a new WSL setup and make sure all the tools and libraries that are in use have gotten installed proper?

First, don’t worry about it because it seems like it didn’t actually solve it. You can create another fresh ubuntu 22.04 instance to check if wslg is really working there for your hardware.

Second, if the issue does really become solved using a newer mesa libraries, you can get those in ubuntu 20.04 too, from a ppa. Ex: https://launchpad.net/~kisak/+archive/ubuntu/kisak-mesa

This is fixed for me today with ubuntu-22.04 latest update, glxinfo no longer crashes.

Well, glxinfo looks good but what about glxgears? This is what happens to me.

image

This is fixed for me today with ubuntu-22.04 latest update, glxinfo no longer crashes.

Same issue with IntelliJ crashes on my NVIDIA laptop. On my AMD desktop I don’t experience this.

  • Windows 11 22621.232
  • Nvidia driver version 516.59

WSL version: 0.64.0.0 Kernel version: 5.10.102.1 WSLg version: 1.0.40 MSRDC version: 1.2.3213 Direct3D version: 1.601.0 DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp Windows version: 10.0.22621.232

$ 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 RTX 2060 SUPER) (0xffffffff)
    Version: 22.0.1
    Accelerated: yes
    Video memory: 24371MB
    Unified memory: no
    Preferred profile: core (0x1)
    Max core profile version: 3.3
    Max compat profile version: 3.3
    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 2060 SUPER)
OpenGL core profile version string: 3.3 (Core Profile) Mesa 22.0.1
OpenGL core profile shading language version string: 3.30
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile

OpenGL version string: 3.3 (Compatibility Profile) Mesa 22.0.1
OpenGL shading language version string: 3.30
OpenGL context flags: (none)
OpenGL profile mask: compatibility profile

OpenGL ES profile version string: OpenGL ES 3.1 Mesa 22.0.1
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.10

Segmentation fault

Anyone got any workarounds? I had to resort back to VcXsrv and disablw wslg 😦

I’ve made some upgrades recently:

  • Windows Insiders Build 25163
  • NVidia Graphics 516.59

Still crashing on exit in the very same way:

❯ 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 MX130) (0xffffffff)
    Version: 22.0.1
    Accelerated: yes
    Video memory: 10126MB
    Unified memory: no
    Preferred profile: core (0x1)
    Max core profile version: 3.3
    Max compat profile version: 3.3
    Max GLES1 profile version: 1.1
    Max GLES[23] profile version: 3.1
OpenGL vendor string: Microsoft Corporation
OpenGL renderer string: D3D12 (NVIDIA GeForce MX130)
OpenGL core profile version string: 3.3 (Core Profile) Mesa 22.0.1
OpenGL core profile shading language version string: 3.30
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile

OpenGL version string: 3.3 (Compatibility Profile) Mesa 22.0.1
OpenGL shading language version string: 3.30
OpenGL context flags: (none)
OpenGL profile mask: compatibility profile

OpenGL ES profile version string: OpenGL ES 3.1 Mesa 22.0.1
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.10

[1]    1519 segmentation fault  glxinfo -B