I’m trying to run a program that uses wgpu under Nsight Graphics, and it crashes when it tries to load libEGL.so. I’ve created a minimal example that reproduces the problem:
#include <dlfcn.h>
void main() {
dlopen("libEGL.so", RTLD_NOW);
}
If I run this normally, the crash doesn’t occur:
$ LD_DEBUG=files ./a.out
file=libc.so.6 [0]; needed by ./a.out [0]
file=libc.so.6 [0]; generating link map
dynamic: 0x00007f6d4f212940 base: 0x00007f6d4f000000 size: 0x000000000021cb70
entry: 0x00007f6d4f027980 phdr: 0x00007f6d4f000040 phnum: 16
calling init: /lib64/ld-linux-x86-64.so.2
calling init: /usr/lib/libc.so.6
initialize program: ./a.out
transferring control: ./a.out
file=libEGL.so [0]; dynamically loaded by ./a.out [0]
file=libEGL.so [0]; generating link map
dynamic: 0x00007f6d4f399bb8 base: 0x00007f6d4f389000 size: 0x00000000000114a8
entry: 0x00007f6d4f389000 phdr: 0x00007f6d4f389040 phnum: 11
file=libGLdispatch.so.0 [0]; needed by /usr/lib/libEGL.so [0]
file=libGLdispatch.so.0 [0]; generating link map
dynamic: 0x00007f6d4f37fd10 base: 0x00007f6d4f310000 size: 0x00000000000782c0
entry: 0x00007f6d4f310000 phdr: 0x00007f6d4f310040 phnum: 12
calling init: /usr/lib/libGLdispatch.so.0
calling init: /usr/lib/libEGL.so
opening file=/usr/lib/libEGL.so [0]; direct_opencount=1
calling fini: [0]
calling fini: /usr/lib/libEGL.so [0]
closing file=; direct_opencount=2
calling fini: /usr/lib/libGLdispatch.so.0 [0]
closing file=; direct_opencount=1
calling fini: /usr/lib/libc.so.6 [0]
calling fini: /lib64/ld-linux-x86-64.so.2 [0]
But if I try to run it in Nsight Graphics’ GPU Trace Profiler (with LD_DEBUG=files), I get
Attempting to automatically connect...
Searching for attachable processes on localhost:49152-49215...
file=libc.so.6 [0]; needed by ./a.out [0]
file=libc.so.6 [0]; generating link map
dynamic: 0x00007fb9d4e12940 base: 0x00007fb9d4c00000 size: 0x000000000021cb70
entry: 0x00007fb9d4c27980 phdr: 0x00007fb9d4c00040 phnum: 16
calling init: /lib64/ld-linux-x86-64.so.2
calling init: /usr/lib/libc.so.6
file=/opt/nsight-graphics/NVIDIA-Nsight-Graphics-2026.2/target/linux-desktop-nomad-x64/libWarpViz.Injection.so [0]; dynamically loaded by /usr/lib/libc.so.6 [0]
file=/opt/nsight-graphics/NVIDIA-Nsight-Graphics-2026.2/target/linux-desktop-nomad-x64/libWarpViz.Injection.so [0]; generating link map
dynamic: 0x00007fb9d4ad4b80 base: 0x00007fb9d4000000 size: 0x0000000000adbf70
entry: 0x00007fb9d4000000 phdr: 0x00007fb9d4000040 phnum: 10
file=libpthread.so.0 [0]; needed by /opt/nsight-graphics/NVIDIA-Nsight-Graphics-2026.2/target/linux-desktop-nomad-x64/libWarpViz.Injection.so [0]
file=libpthread.so.0 [0]; generating link map
dynamic: 0x00007fb9d4e6fdc8 base: 0x00007fb9d4e6c000 size: 0x0000000000004010
entry: 0x00007fb9d4e6c000 phdr: 0x00007fb9d4e6c040 phnum: 13
file=librt.so.1 [0]; needed by /opt/nsight-graphics/NVIDIA-Nsight-Graphics-2026.2/target/linux-desktop-nomad-x64/libWarpViz.Injection.so [0]
file=librt.so.1 [0]; generating link map
dynamic: 0x00007fb9d4e6adb8 base: 0x00007fb9d4e67000 size: 0x0000000000004010
entry: 0x00007fb9d4e67000 phdr: 0x00007fb9d4e67040 phnum: 13
file=libdl.so.2 [0]; needed by /opt/nsight-graphics/NVIDIA-Nsight-Graphics-2026.2/target/linux-desktop-nomad-x64/libWarpViz.Injection.so [0]
file=libdl.so.2 [0]; generating link map
dynamic: 0x00007fb9d4e65dc8 base: 0x00007fb9d4e62000 size: 0x0000000000004010
entry: 0x00007fb9d4e62000 phdr: 0x00007fb9d4e62040 phnum: 13
file=libutil.so.1 [0]; needed by /opt/nsight-graphics/NVIDIA-Nsight-Graphics-2026.2/target/linux-desktop-nomad-x64/libWarpViz.Injection.so [0]
file=libutil.so.1 [0]; generating link map
dynamic: 0x00007fb9d4e60dc8 base: 0x00007fb9d4e5d000 size: 0x0000000000004010
entry: 0x00007fb9d4e5d000 phdr: 0x00007fb9d4e5d040 phnum: 13
file=libm.so.6 [0]; needed by /opt/nsight-graphics/NVIDIA-Nsight-Graphics-2026.2/target/linux-desktop-nomad-x64/libWarpViz.Injection.so [0]
file=libm.so.6 [0]; generating link map
dynamic: 0x00007fb9d3ffeb48 base: 0x00007fb9d3ecd000 size: 0x0000000000132148
entry: 0x00007fb9d3ecd000 phdr: 0x00007fb9d3ecd040 phnum: 13
file=libgcc_s.so.1 [0]; needed by /opt/nsight-graphics/NVIDIA-Nsight-Graphics-2026.2/target/linux-desktop-nomad-x64/libWarpViz.Injection.so [0]
file=libgcc_s.so.1 [0]; generating link map
dynamic: 0x00007fb9d4e5bbd8 base: 0x00007fb9d4e30000 size: 0x000000000002c1e8
entry: 0x00007fb9d4e30000 phdr: 0x00007fb9d4e30040 phnum: 12
activating NODELETE for /usr/lib/librt.so.1 [0]
calling init: /usr/lib/libgcc_s.so.1
calling init: /usr/lib/libm.so.6
calling init: /usr/lib/libutil.so.1
calling init: /usr/lib/libdl.so.2
calling init: /usr/lib/librt.so.1
calling init: /usr/lib/libpthread.so.0
calling init: /opt/nsight-graphics/NVIDIA-Nsight-Graphics-2026.2/target/linux-desktop-nomad-x64/libWarpViz.Injection.so
opening file=/opt/nsight-graphics/NVIDIA-Nsight-Graphics-2026.2/target/linux-desktop-nomad-x64/libWarpViz.Injection.so [0]; direct_opencount=1
initialize program: ./a.out
transferring control: ./a.out
file=libEGL.so [0]; dynamically loaded by ./a.out [0]
file=libEGL.so [0]; generating link map
dynamic: 0x00007fb9d4b9ebb8 base: 0x00007fb9d4b8e000 size: 0x00000000000114a8
entry: 0x00007fb9d4b8e000 phdr: 0x00007fb9d4b8e040 phnum: 11
file=libGLdispatch.so.0 [0]; needed by /usr/lib/libEGL.so [0]
file=libGLdispatch.so.0 [0]; generating link map
dynamic: 0x00007fb9d4b84d10 base: 0x00007fb9d4b15000 size: 0x00000000000782c0
entry: 0x00007fb9d4b15000 phdr: 0x00007fb9d4b15040 phnum: 12
file=/opt/nsight-graphics/NVIDIA-Nsight-Graphics-2026.2/target/linux-desktop-nomad-x64/libWarpVizTarget.so [0]; dynamically loaded by /opt/nsight-graphics/NVIDIA-Nsight-Graphics-2026.2/target/linux-desktop-nomad-x64/libWarpViz.Injection.so [0]
file=/opt/nsight-graphics/NVIDIA-Nsight-Graphics-2026.2/target/linux-desktop-nomad-x64/libWarpVizTarget.so [0]; generating link map
dynamic: 0x00007fb9d3c8f430 base: 0x00007fb9d2800000 size: 0x00000000014d10b0
entry: 0x00007fb9d2800000 phdr: 0x00007fb9d2800040 phnum: 10
calling init: /opt/nsight-graphics/NVIDIA-Nsight-Graphics-2026.2/target/linux-desktop-nomad-x64/libWarpVizTarget.so
opening file=/opt/nsight-graphics/NVIDIA-Nsight-Graphics-2026.2/target/linux-desktop-nomad-x64/libWarpVizTarget.so [0]; direct_opencount=1
file=/usr/lib64/libEGL.so.1 [0]; dynamically loaded by /opt/nsight-graphics/NVIDIA-Nsight-Graphics-2026.2/target/linux-desktop-nomad-x64/libWarpVizTarget.so [0]
opening file=/usr/lib/libEGL.so [0]; direct_opencount=2
/usr/lib/libEGL.so: error: symbol lookup error: undefined symbol: eglSwapBuffersWithDamageEXT (fatal)
Launch process exited. Searching for attachable child processes...
Searching for attachable processes on localhost:49152-49215...
Failed to connect. The target process may have exited.
I have been able to get it to partly work by running the executable separately, manually passing in the environment variables and then attaching in Nsight, but it seems to only work properly for 1 frame.
Weirdly though, the crash doesn’t occur directly after the symbol lookup error, it occurs later in LockDispatch, because __glvndPthreadFuncs.mutex_lock is null due to glvndSetupPthreads not being called.