Using Nsight tool for profiling Qt5 applications (I’m running 5.12.1 prebuild 64-bit deskptop version) on Ubuntu 18.04 does not work at all (It will crash) with latest (4.15.27 ubuntu drivers).
After starting the application and then pressing “Capture for live analysis” will always end up Qt5 application crash with following message “Connection error detected communicating with target application. Shutting down connection.”.
When attaching gdb to running Qt5 application before starting live capture and then starting it, the gdb backtrace shows that the crash happens inside Nvidia driver libraries:
Thread 9 “QSGRenderThread” received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7f6f99d4a700 (LWP 4147)]
0x00007f6fc3deadc7 in ?? () from /usr/lib/x86_64-linux-gnu/libnvidia-glcore.so.415.27
(gdb) bt
#0 0x00007f6fc3deadc7 in () at /usr/lib/x86_64-linux-gnu/libnvidia-glcore.so.415.27
#1 0x00007f6fc3deca3e in () at /usr/lib/x86_64-linux-gnu/libnvidia-glcore.so.415.27
#2 0x00007f6fc4ec67b7 in () at /usr/lib/x86_64-linux-gnu/libGLX_nvidia.so.0
#3 0x00007f6fc4ec69b3 in () at /usr/lib/x86_64-linux-gnu/libGLX_nvidia.so.0
#4 0x00007f6fc4ef9e69 in () at /usr/lib/x86_64-linux-gnu/libGLX_nvidia.so.0
#5 0x00007f6fc90e0212 in () at /usr/lib/x86_64-linux-gnu/libGLX.so.0
#6 0x00007f6fc90e1f82 in () at /usr/lib/x86_64-linux-gnu/libGLX.so.0
#7 0x00007f6fc6341135 in () at /usr/local/NVIDIA-Nsight-Graphics-2019.1/target/linux-desktop-nomad-x64/libNvda.Graphics.Interception.so
#8 0x00007f6fc5489afe in () at /usr/local/NVIDIA-Nsight-Graphics-2019.1/target/linux-desktop-nomad-x64/libNvda.Graphics.Interception.so
#9 0x00007f6fc54cf5d3 in () at /usr/local/NVIDIA-Nsight-Graphics-2019.1/target/linux-desktop-nomad-x64/libNvda.Graphics.Interception.so
#10 0x00007f6fc5c67556 in () at /usr/local/NVIDIA-Nsight-Graphics-2019.1/target/linux-desktop-nomad-x64/libNvda.Graphics.Interception.so
#11 0x00007f6fc5d10d39 in () at /usr/local/NVIDIA-Nsight-Graphics-2019.1/target/linux-desktop-nomad-x64/libNvda.Graphics.Interception.so
#12 0x00007f6fc5d2c530 in () at /usr/local/NVIDIA-Nsight-Graphics-2019.1/target/linux-desktop-nomad-x64/libNvda.Graphics.Interception.so
#13 0x00007f6fc634f1f6 in () at /usr/local/NVIDIA-Nsight-Graphics-2019.1/target/linux-desktop-nomad-x64/libNvda.Graphics.Interception.so
#14 0x00007f6fa1b26e52 in QGLXContext::swapBuffers(QPlatformSurface*) (this=0x55560d18ad00, surface=0x55560d1bbf60) at qglxintegration.cpp:609
#15 0x00007f6fce5bceac in QOpenGLContext::swapBuffers(QSurface*) (this=0x7f6fb8006890, surface=) at kernel/qopenglcontext.cpp:1115
#16 0x00007f6fcee15cba in QSGRenderThread::syncAndRender() (this=this@entry=0x55560d1b8f20) at scenegraph/qsgthreadedrenderloop.cpp:652
#17 0x00007f6fcee1918c in QSGRenderThread::run() (this=0x55560d1b8f20) at scenegraph/qsgthreadedrenderloop.cpp:730
#18 0x00007f6fcd6a9db3 in QThreadPrivate::start(void*) (arg=0x55560d1b8f20) at thread/qthread_unix.cpp:361
#19 0x00007f6fcc6b46db in start_thread (arg=0x7f6f99d4a700) at pthread_create.c:463
#20 0x00007f6fccd9388f in clone () at …/sysdeps/unix/sysv/linux/x86_64/clone.S:95
(gdb)
Help is requested to resolve this issue, as we currently cannot use the Nsight graphics tool at all.