Application performs better with Nsight Debugging

Hello everyone,

I am writing my own deferred shading engine in C++ and I already have a geometry and light passes, everything renders correctly. Except performance wise, whenever i use Nsight to debug the application I see an increase of FPS from 20 fps average to 90 average which doesnt make much sense since Nsight is a debugger and should add overhead to the application.
The nsight profiling tells me that my bottleneck comes from frame buffer but then it works perfectly with the debugger enabled.

Some help please just to try and understand why the NSight debugger is increasing the performance of my application.

Hi tottz,

I do have a similar problem.
I’m rendering offscreen to a framebuffer as fast as possible.
One particular test case takes ~42s.
But running it inside Nsight with any of the OpenGL tracing options enabled is getting me over 5x the performance (the test case completes in ~8s).
Since Nsight isn’t helping me much with my slow case I don’t know where to start debugging.
(This is on an OpenGL 4.5 core context with no single warning from the debug callback. GTX970, Win8.1)

During regular CPU profiling it seems the driver is stalling in different places. In some runs it is a PBO transfer, sometimes a draw call…

My current workaround is to reduce some FBO size in my rendering process which gets me up to 10% below running-in-Nsight performance. But without knowing what’s going on it’s difficult to actually fix this.