microsoft / wslg

Enabling the Windows Subsystem for Linux to include support for Wayland and X server related scenarios
MIT License
10.25k stars 307 forks source link

glxgears and glmark2 (multiple variants) segfault on Intel Arc A770 #946

Open DanaGoyette opened 1 year ago

DanaGoyette commented 1 year ago

I got an Intel Arc A770 GPU to play with, and under WSLg, GL applications are segfaulting. This may be an Intel driver bug, but I don't know off-hand how to get in touch with them about it. With LIBGL_ALWAYS_SOFTWARE=1, there's no segfault.

Intel Arc driver version is 31.0.101.4032.

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
dana@dana-desktop2:~$ EGL_LOG_LEVEL=debug LIBGL_DEBUG=verbose gdb glxgears
GNU gdb (Ubuntu 12.1-0ubuntu1~22.04) 12.1
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from glxgears...
(No debugging symbols found in glxgears)
(gdb) r
Starting program: /usr/bin/glxgears
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
libGL: MESA-LOADER: dlopen(/usr/lib/x86_64-linux-gnu/dri/swrast_dri.so)
libGL: Can't open configuration file /etc/drirc: No such file or directory.
libGL: Can't open configuration file /home/dana/.drirc: No such file or directory.
[New Thread 0x7fffe51ff640 (LWP 1384)]
[New Thread 0x7fffe49fe640 (LWP 1385)]
[New Thread 0x7fffe41fd640 (LWP 1386)]
[New Thread 0x7fffe39fc640 (LWP 1387)]
libGL: Can't open configuration file /etc/drirc: No such file or directory.
libGL: Can't open configuration file /home/dana/.drirc: No such file or directory.
[New Thread 0x7fffe31fb640 (LWP 1388)]

Thread 2 "glxgears" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffe51ff640 (LWP 1384)]
0x00007ffff7747e3d in std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_assign(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) () from /lib/x86_64-linux-gnu/libstdc++.so.6
(gdb) thread apply all bt

Thread 6 (Thread 0x7fffe31fb640 (LWP 1388) "glxgears:gdrv0"):
#0  __futex_abstimed_wait_common64 (private=0, cancel=true, abstime=0x0, op=393, expected=0, futex_word=0x7fffece95550) at ./nptl/futex-internal.c:57
microsoft/WSL#1  __futex_abstimed_wait_common (cancel=true, private=0, abstime=0x0, clockid=0, expected=0, futex_word=0x7fffece95550) at ./nptl/futex-internal.c:87
microsoft/WSL#2  __GI___futex_abstimed_wait_cancelable64 (futex_word=futex_word@entry=0x7fffece95550, expected=expected@entry=0, clockid=clockid@entry=0, abstime=abstime@entry=0x0, private=private@entry=0) at ./nptl/futex-internal.c:139
microsoft/WSL#3  0x00007ffff7b73ac1 in __pthread_cond_wait_common (abstime=0x0, clockid=0, mutex=0x7fffece95500, cond=0x7fffece95528) at ./nptl/pthread_cond_wait.c:503
microsoft/WSL#4  ___pthread_cond_wait (cond=0x7fffece95528, mutex=0x7fffece95500) at ./nptl/pthread_cond_wait.c:627
microsoft/WSL#5  0x00007ffff5d0485b in ?? () from /usr/lib/x86_64-linux-gnu/dri/swrast_dri.so
microsoft/WSL#6  0x00007ffff5d0448b in ?? () from /usr/lib/x86_64-linux-gnu/dri/swrast_dri.so
microsoft/WSL#7  0x00007ffff7b74b43 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
microsoft/WSL#8  0x00007ffff7c06a00 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81

Thread 5 (Thread 0x7fffe39fc640 (LWP 1387) "glxgears"):
#0  __futex_abstimed_wait_common64 (private=0, cancel=true, abstime=0x0, op=393, expected=0, futex_word=0x7fffdc000b98) at ./nptl/futex-internal.c:57
microsoft/WSL#1  __futex_abstimed_wait_common (cancel=true, private=0, abstime=0x0, clockid=0, expected=0, futex_word=0x7fffdc000b98) at ./nptl/futex-internal.c:87
microsoft/WSL#2  __GI___futex_abstimed_wait_cancelable64 (futex_word=futex_word@entry=0x7fffdc000b98, expected=expected@entry=0, clockid=clockid@entry=0, abstime=abstime@entry=0x0, private=private@entry=0) at ./nptl/futex-internal.c:139
microsoft/WSL#3  0x00007ffff7b73ac1 in __pthread_cond_wait_common (abstime=0x0, clockid=0, mutex=0x555555699ec0, cond=0x7fffdc000b70) at ./nptl/pthread_cond_wait.c:503
microsoft/WSL#4  ___pthread_cond_wait (cond=0x7fffdc000b70, mutex=0x555555699ec0) at ./nptl/pthread_cond_wait.c:627
microsoft/WSL#5  0x00007fffed5544cf in ?? () from /usr/lib/wsl/lib/libd3d12core.so
microsoft/WSL#6  0x00007fffed85384b in ?? () from /usr/lib/wsl/lib/libd3d12core.so
microsoft/WSL#7  0x00007fffed85402b in ?? () from /usr/lib/wsl/lib/libd3d12core.so
microsoft/WSL#8  0x00007ffff7b74b43 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
microsoft/WSL#9  0x00007ffff7c06a00 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81

Thread 4 (Thread 0x7fffe41fd640 (LWP 1386) "glxgears"):
#0  __futex_abstimed_wait_common64 (private=0, cancel=true, abstime=0x0, op=393, expected=0, futex_word=0x7fffdc000b98) at ./nptl/futex-internal.c:57
microsoft/WSL#1  __futex_abstimed_wait_common (cancel=true, private=0, abstime=0x0, clockid=0, expected=0, futex_word=0x7fffdc000b98) at ./nptl/futex-internal.c:87
microsoft/WSL#2  __GI___futex_abstimed_wait_cancelable64 (futex_word=futex_word@entry=0x7fffdc000b98, expected=expected@entry=0, clockid=clockid@entry=0, abstime=abstime@entry=0x0, private=private@entry=0) at ./nptl/futex-internal.c:139
microsoft/WSL#3  0x00007ffff7b73ac1 in __pthread_cond_wait_common (abstime=0x0, clockid=0, mutex=0x555555699ec0, cond=0x7fffdc000b70) at ./nptl/pthread_cond_wait.c:503
microsoft/WSL#4  ___pthread_cond_wait (cond=0x7fffdc000b70, mutex=0x555555699ec0) at ./nptl/pthread_cond_wait.c:627
microsoft/WSL#5  0x00007fffed5544cf in ?? () from /usr/lib/wsl/lib/libd3d12core.so
microsoft/WSL#6  0x00007fffed85384b in ?? () from /usr/lib/wsl/lib/libd3d12core.so
microsoft/WSL#7  0x00007fffed85402b in ?? () from /usr/lib/wsl/lib/libd3d12core.so
microsoft/WSL#8  0x00007ffff7b74b43 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
microsoft/WSL#9  0x00007ffff7c06a00 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81

Thread 3 (Thread 0x7fffe49fe640 (LWP 1385) "glxgears"):
#0  __futex_abstimed_wait_common64 (private=0, cancel=true, abstime=0x0, op=393, expected=0, futex_word=0x7fffdc000b98) at ./nptl/futex-internal.c:57
microsoft/WSL#1  __futex_abstimed_wait_common (cancel=true, private=0, abstime=0x0, clockid=0, expected=0, futex_word=0x7fffdc000b98) at ./nptl/futex-internal.c:87
microsoft/WSL#2  __GI___futex_abstimed_wait_cancelable64 (futex_word=futex_word@entry=0x7fffdc000b98, expected=expected@entry=0, clockid=clockid@entry=0, abstime=abstime@entry=0x0, private=private@entry=0) at ./nptl/futex-internal.c:139
microsoft/WSL#3  0x00007ffff7b73ac1 in __pthread_cond_wait_common (abstime=0x0, clockid=0, mutex=0x555555699ec0, cond=0x7fffdc000b70) at ./nptl/pthread_cond_wait.c:503
microsoft/WSL#4  ___pthread_cond_wait (cond=0x7fffdc000b70, mutex=0x555555699ec0) at ./nptl/pthread_cond_wait.c:627
microsoft/WSL#5  0x00007fffed5544cf in ?? () from /usr/lib/wsl/lib/libd3d12core.so
microsoft/WSL#6  0x00007fffed85384b in ?? () from /usr/lib/wsl/lib/libd3d12core.so
microsoft/WSL#7  0x00007fffed85402b in ?? () from /usr/lib/wsl/lib/libd3d12core.so
microsoft/WSL#8  0x00007ffff7b74b43 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
microsoft/WSL#9  0x00007ffff7c06a00 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81

Thread 2 (Thread 0x7fffe51ff640 (LWP 1384) "glxgears"):
#0  0x00007ffff7747e3d in std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_assign(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) () from /lib/x86_64-linux-gnu/libstdc++.so.6
microsoft/WSL#1  0x00007fffea041c73 in ?? () from /usr/lib/wsl/drivers/iigd_dch_d.inf_amd64_49b17bc90a910771/libigc.so
microsoft/WSL#2  0x00007fffe9dca332 in ?? () from /usr/lib/wsl/drivers/iigd_dch_d.inf_amd64_49b17bc90a910771/libigc.so
microsoft/WSL#3  0x00007fffe9de9ef8 in ?? () from /usr/lib/wsl/drivers/iigd_dch_d.inf_amd64_49b17bc90a910771/libigc.so
microsoft/WSL#4  0x00007fffe73bc9d0 in llvm::FPPassManager::runOnFunction(llvm::Function&) () from /usr/lib/wsl/drivers/iigd_dch_d.inf_amd64_49b17bc90a910771/libLLVM-9.so
microsoft/WSL#5  0x00007fffe73bcacb in llvm::FPPassManager::runOnModule(llvm::Module&) () from /usr/lib/wsl/drivers/iigd_dch_d.inf_amd64_49b17bc90a910771/libLLVM-9.so
microsoft/WSL#6  0x00007fffe73bbc2c in llvm::legacy::PassManagerImpl::run(llvm::Module&) () from /usr/lib/wsl/drivers/iigd_dch_d.inf_amd64_49b17bc90a910771/libLLVM-9.so
microsoft/WSL#7  0x00007fffe9c449d1 in ?? () from /usr/lib/wsl/drivers/iigd_dch_d.inf_amd64_49b17bc90a910771/libigc.so
microsoft/WSL#8  0x00007fffe9c43a40 in ?? () from /usr/lib/wsl/drivers/iigd_dch_d.inf_amd64_49b17bc90a910771/libigc.so
microsoft/WSL#9  0x00007fffe9952a50 in ?? () from /usr/lib/wsl/drivers/iigd_dch_d.inf_amd64_49b17bc90a910771/libigc.so
microsoft/WSL#10 0x00007fffe995eb51 in ?? () from /usr/lib/wsl/drivers/iigd_dch_d.inf_amd64_49b17bc90a910771/libigc.so
microsoft/WSL#11 0x00007fffe994968d in ?? () from /usr/lib/wsl/drivers/iigd_dch_d.inf_amd64_49b17bc90a910771/libigc.so
microsoft/WSL#12 0x00007fffec6ec3df in ?? () from /usr/lib/wsl/drivers/iigd_dch_d.inf_amd64_49b17bc90a910771/libigd12um64xeh.so
microsoft/WSL#13 0x00007fffec6e1770 in ?? () from /usr/lib/wsl/drivers/iigd_dch_d.inf_amd64_49b17bc90a910771/libigd12um64xeh.so
microsoft/WSL#14 0x00007fffec6decb4 in ?? () from /usr/lib/wsl/drivers/iigd_dch_d.inf_amd64_49b17bc90a910771/libigd12um64xeh.so
microsoft/WSL#15 0x00007fffec6db39d in ?? () from /usr/lib/wsl/drivers/iigd_dch_d.inf_amd64_49b17bc90a910771/libigd12um64xeh.so
microsoft/WSL#16 0x00007fffec6fd8df in ?? () from /usr/lib/wsl/drivers/iigd_dch_d.inf_amd64_49b17bc90a910771/libigd12um64xeh.so
microsoft/WSL#17 0x00007fffec6fc4d6 in ?? () from /usr/lib/wsl/drivers/iigd_dch_d.inf_amd64_49b17bc90a910771/libigd12um64xeh.so
microsoft/WSL#18 0x00007fffec6fcbe0 in ?? () from /usr/lib/wsl/drivers/iigd_dch_d.inf_amd64_49b17bc90a910771/libigd12um64xeh.so
microsoft/WSL#19 0x00007fffed8538e0 in ?? () from /usr/lib/wsl/lib/libd3d12core.so
microsoft/WSL#20 0x00007fffed85402b in ?? () from /usr/lib/wsl/lib/libd3d12core.so
microsoft/WSL#21 0x00007ffff7b74b43 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
microsoft/WSL#22 0x00007ffff7c06a00 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81

Thread 1 (Thread 0x7ffff7990740 (LWP 1381) "glxgears"):
#0  __GI___ioctl (fd=4, request=3224389387) at ../sysdeps/unix/sysv/linux/ioctl.c:36
microsoft/WSL#1  0x00007fffeda45425 in D3DKMTMakeResident () from /usr/lib/wsl/lib/libdxcore.so
microsoft/WSL#2  0x00007fffed695a9e in ?? () from /usr/lib/wsl/lib/libd3d12core.so
microsoft/WSL#3  0x00007fffec7258f1 in ?? () from /usr/lib/wsl/drivers/iigd_dch_d.inf_amd64_49b17bc90a910771/libigd12um64xeh.so
microsoft/WSL#4  0x00007fffec7b1566 in ?? () from /usr/lib/wsl/drivers/iigd_dch_d.inf_amd64_49b17bc90a910771/libigd12um64xeh.so
microsoft/WSL#5  0x00007fffec801448 in ?? () from /usr/lib/wsl/drivers/iigd_dch_d.inf_amd64_49b17bc90a910771/libigd12um64xeh.so
microsoft/WSL#6  0x00007fffec65ebf1 in ?? () from /usr/lib/wsl/drivers/iigd_dch_d.inf_amd64_49b17bc90a910771/libigd12um64xeh.so
microsoft/WSL#7  0x00007fffed5fa175 in ?? () from /usr/lib/wsl/lib/libd3d12core.so
microsoft/WSL#8  0x00007fffed5f9f89 in ?? () from /usr/lib/wsl/lib/libd3d12core.so
microsoft/WSL#9  0x00007ffff67a9144 in ?? () from /usr/lib/x86_64-linux-gnu/dri/swrast_dri.so
microsoft/WSL#10 0x00007ffff67aa91e in ?? () from /usr/lib/x86_64-linux-gnu/dri/swrast_dri.so
microsoft/WSL#11 0x00007ffff67f3031 in ?? () from /usr/lib/x86_64-linux-gnu/dri/swrast_dri.so
microsoft/WSL#12 0x00007ffff67f3428 in ?? () from /usr/lib/x86_64-linux-gnu/dri/swrast_dri.so
microsoft/WSL#13 0x00007ffff67926e6 in ?? () from /usr/lib/x86_64-linux-gnu/dri/swrast_dri.so
microsoft/WSL#14 0x00007ffff624fd56 in ?? () from /usr/lib/x86_64-linux-gnu/dri/swrast_dri.so
microsoft/WSL#15 0x00007ffff624a37a in ?? () from /usr/lib/x86_64-linux-gnu/dri/swrast_dri.so
microsoft/WSL#16 0x00007ffff624ad5b in ?? () from /usr/lib/x86_64-linux-gnu/dri/swrast_dri.so
microsoft/WSL#17 0x00007ffff6250f38 in ?? () from /usr/lib/x86_64-linux-gnu/dri/swrast_dri.so
microsoft/WSL#18 0x00007ffff5db7bb7 in ?? () from /usr/lib/x86_64-linux-gnu/dri/swrast_dri.so
microsoft/WSL#19 0x00007ffff794e7a5 in ?? () from /lib/x86_64-linux-gnu/libGLX_mesa.so.0
microsoft/WSL#20 0x0000555555556dee in ?? ()
microsoft/WSL#21 0x00007ffff7b09d90 in __libc_start_call_main (main=main@entry=0x555555556800, argc=argc@entry=1, argv=argv@entry=0x7fffffffe3c8) at ../sysdeps/nptl/libc_start_call_main.h:58
microsoft/WSL#22 0x00007ffff7b09e40 in __libc_start_main_impl (main=0x555555556800, argc=1, argv=0x7fffffffe3c8, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffffffe3b8) at ../csu/libc-start.c:392
microsoft/WSL#23 0x00005555555572b5 in ?? ()
(gdb) cont
Continuing.
[Thread 0x7fffe31fb640 (LWP 1388) exited]
[Thread 0x7fffe39fc640 (LWP 1387) exited]
[Thread 0x7fffe41fd640 (LWP 1386) exited]
[Thread 0x7fffe49fe640 (LWP 1385) exited]
[Thread 0x7ffff7990740 (LWP 1381) exited]
[Thread 0x7fffe51ff640 (LWP 1384) exited]
[New process 1381]

Program terminated with signal SIGSEGV, Segmentation fault.
The program no longer exists.
(gdb) q
DanaGoyette commented 1 year ago

WslLogs-2023-01-04_10-46-53.zip

elsaco commented 1 year ago

This is with arc driver 31.0.101.4034 and A380:

toor@ARC:~$ 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) Arc(TM) A380 Graphics) (0xffffffff)
    Version: 22.0.5
    Accelerated: yes
    Video memory: 22240MB
    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 (Intel(R) Arc(TM) A380 Graphics)
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

With A770 the only way it works is to force the PCIe slot to Gen3 in BIOS. Funny, A380 is more stable than A770 for my setup. This could be an issue with my hardware though.

nullchilly commented 1 year ago

Thank you so much!! LIBGL_ALWAYS_SOFTWARE=1 glxgears saved me

zcobol commented 1 year ago

@nullchilly while LIBGL_ALWAYS_SOFTWARE=1 saved the day, that's software rendering. Yuck! You should be able to take advantage of hardware rendering inside WSL w/out any issues.