Cannot profile Qt5 application

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.

Hello,

Sorry that you are running into this issue!

Would you be able to provide your system information and version of Nsight Graphics?

Also, it will greatly help reproduction if you can share your application/sample. Feel free to DM me w/ your app if this is possible!

Thanks,
Seth

Hi,

System is Ubuntu 18.04 with canonical provided Nvidia 415.27 drivers.

±----------------------------------------------------------------------------+
| NVIDIA-SMI 415.27 Driver Version: 415.27 CUDA Version: 10.0 |
|-------------------------------±---------------------±---------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|===============================+======================+======================|
| 0 GeForce 940MX Off | 00000000:02:00.0 Off | N/A |
| N/A 33C P0 N/A / N/A | 530MiB / 2004MiB | 1% Default |
±------------------------------±---------------------±---------------------+

Application: NVIDIA Nsight Graphics
Version: Version 2019.1.0.0 (Build 25644581) (public-release)

Thank you! I’ve submitted a bug and will let you know once we are able to successfully repro the issue. (DG-4090, For internal tracking)

Just wanted to let you know that is issue is fixed and will be available in our next release. Stay tuned!

Okay thanks! So when is the next release coming out? Also out of curiosity, what was the reason? Is there workaround for the current release?

Hi Pasi,

It’s out now! Should be fixed in 2019.2

Cheers,
Seth