I am developing an OpenGL application using the Qt framework, and I can not debug this application using the nSight Visual Studio debugger. The HUD doesn’t show and the application freezes when I hit Ctrl+Z to show the toolbar. I have a parallel application using GLFW that works just fine. From an OpenGL perspective the Qt adds only two extra calls for each frame other than wglSwapBuffers(). It adds wglGetCurrentContext() and wglGetCurrentDC() at the beginnning of each frame (on Windows). Does this make a difference for nSight?
I was hoping that someone had experience using nSight with Qt, but searching google and theese forums nets me zip results. If a dev is curious to figure this one out I would be happy to supply a bare bones example for tinkering.
i am having the same issue as sunefred. I am using Qt 5.2 with a minimal hello world example, and the HUD simply doesn’t show up.
I ran the application through gdebugger and it is definetly creating GL contexts and swapping the back buffer correctly (and it draws correctly).
It’s possible that the way Qt initializes its OpenGL context confuses nSight, but I wouldn’t know how to fix it since nSight (even in TRACE level) doesn’t really log much useful information.
To double check, I ran the nSight HUD on other OpenGL applications that are not using Qt 5, and the HUD as well as frame debugging work in these applications. In addition, I tried to create a compat-log with the launcher, but it was simply empty after running the launcher (the application was successfully launched, but the HUD was still missing).
Please let me know if I can provide you with any assistance tracking this problem down. build-Desktop-Release.zip (15.6 MB)
I am back with a downloadable “Hello World” level Qt5.2 sample application. You can download it from github at GitHub - sunefred/Gravity3D: The Attractive 3D Engine There are executables with debug information as well as MSVC2012 project files if you want to build it on your own. If you do, you will need to download Qt 5.2, glew 1.10.0, glfw 3.0.3 and newmat 1.1. For convenience I have made these available in my Vendor repository.
The application has Maya style navigation, i.e Alt+LM for rotate, Alt+MM for translate, Alt+RM for zoom and Alt+Scroll for zoom. You can also change tessellation level with the scroll wheel.
Finally thanks to shartte for joining with samples. Lets hope there is an easy solution for you guys at nVidia!
I should add that before deciding to use Qt 5.2 I was using the latest 4.x release, the 4.8.5 and I had exactly the same problem. I would assume solving one would fix the other.
I’m using Qt 4.7.3 for a stereo application and the app crashes when I try to use the graphics debugger. The performance analysis does work however. Hope there is a fix soon and thanks!
Thanks for the reports with the projects. We are able to reproduce the HUDs not showing up (thanks Shartte) and will start looking into it.
I’ll keep you posted on what we find out.
draj, we have not seen the app crash you mentioned though. If you have any details on how to reproduce this, please let me know.
A quick update on the HUDs not showing up (reproducible from shartte), we now have a fix and will be going through testing. Assuming no issues in QA, we should have this fix in the new release coming up soon.
That is great news rafi! If you wouldn’t mind telling, it would be interesting to know what differs for a Qt application that made it incompatible with the current build. As far as I could see (running it through gDebugger from remedy) it had no weird calls or setup code. It could help get some insight in the overhead of a Qt application versus a custom context creator.
No problem sunefred. Basically, it was a bad assumption on our side.
When an app creates an OpenGL context (HGLRC) through WGL, Nsight creates an object that corresponds to the HGLRC, and it remembers the original HDC as well as the last HDC that was used with MakeCurrent and this context (current HDC). Later on we were using the original HDC for other operations, but this is invalid as the original HDC may have been deleted. It is correct to use the current HDC in most situations.
A potential workaround for now is to try avoiding the deletion of HDCs, and/or by just creating a single HDC and using that always. I am not sure if you have control over that.
As for why it didn’t show up in gDebugger, I can only guess, but as Nsight has a way to scrub back (and forth) in time in one frame, we need to keep track of more objects and states, therefore more room for issues.
Thank you for your response. I don’t have control over the device contexts, I let Qt handle all that. It is just good to know that Qt doesn’t do anything extraordinarily weird in this regard. Although, admittedly, it is a little bit odd that Qt would release any HDC, when all I use it for in my “Hello World” example is to create a top level window.
I can not wait for the next release, with this fix and VS 2013 support my dev platform will be fully functional.