Setup NSight for Qt5.1-Project

Hello,

I have a Qt 5.1 Project imported in Visual Studio 2012. The project runs fine in debug mode and runs correctly outside of VS. When I hit the “Start Graphics Debugging” Button, nothing is rendered and the viewport has the clear-color. When I then click “Pause and Capture Frame” an info box pops up, saying:

Cannot enter frame debugging. NSight only supports frame debugging for D3D9, D3D11, and OpenGL 4.2.
Reason: Trying to draw without a program bound. To find all incompatibilities, run …\Monitor\Common\Nvda.Launcher.exe -compatlog C:\nvcompat.txt myapp.exe

When I run Nvda.Launcher.exe and the log path requires administrator privileges, my app does not draw. When I start Nvda.Launcher.exe as an administrator my app draws correctly and the log is created (but is empty).
My app uses the Qt5.1-wrapped functions of OpenGL core profile 4.2 and runs without admin privileges when started directly.

I installed the newest version of NSight and driver version 326.80, win8.

When I tried to port another project nsight complained about glEnable(cap = 0x000092e0) which is “GL_DEBUG_OUTPUT”. I disabled Qt’s OpenGL Debug features and the program draws.
I still can’t see the HUD and can not set breakpoints/pause and capture frame. No error message is shown.

I’m getting a very similar problem. The project I am attempting to use with NSight is the example one given by a Qt developer on this blog post.

Running the application via NSight causes only the clear colour to show. This is also the case when running via the command suggested by the “Cannot enter frame debugging” message that pops up as mentioned in the OP. However the nvcompatlog.txt shows the following:

glEnable (cap = 0x00000DE1): 0x000003E8
                                 glEnable (cap = 0x00000B50): 0x00000064
                                 glEnable (cap = 0x00008620): 0x00000064
                                 glEnable (cap = 0x00008804): 0x00000064
                                                glMatrixMode: 0x000003E8
                                                glPushMatrix: 0x000003E8
                                              glLoadIdentity: 0x000003E8
                                                     glOrtho: 0x00000064
                                                     glBegin: 0x00000064
                                                   glColor4f: 0x00000064
                                                  glVertex2f: 0x000186A0
                                                       glEnd: 0x00000064
                                                 glPopMatrix: 0x000003E8

This is despite me using just a 4.2 Core context. Does NSight just pre-emptively scan the executable for banned GL calls, instead of actually worrying about these functions only if they are ever called? If that’s the case, it will be a bit difficult to try and find the part of Qt responsible. After a preliminary search of the source I cannot find which lines all of these calls correspond to.

Hi Epxzz,

Could I possibly see your setProfile and setVersion code?

Thanks,

-Jeff

QSurfaceFormat format;
format.setVersion( 4, 2 );

(…)
// CompatibilityProfile is used so QtQuick works together with OpenGL 4.2
format.setProfile( QSurfaceFormat::CompatibilityProfile );

if(DEBUG_OPENGL_ENABLED)
{
	format.setOption( QSurfaceFormat::DebugContext );
}

DEBUG_OPENGL_ENABLED is 0, because I heard the debugging extension is not compatible with nsight.

I’m using a modified version of the same example that ZRM mentioned.
One problem of the original demo could be, that it binds a shader once after OpenGL initialization. At the moment I bind/release the shader every frame. This makes “QtQuickView” work nicely with the scene.

It would help a lot if someone could successfully use nsight with the KDAB-Example.