Windows 7 64bit, Qt 4: glGetVersion returns "1.1.0", nvogl32v.dll gets unloaded
|June 11, 2013||Posted by forumadmin under TechQns||
I’m developing 32bit application that uses Qt 4, and I”m working on Windows 7 64bit.
My program has main non-OpenGL widget, and QGLWidget which is optionally opened by the user.
When I create that
glGetVersion reports “1.1.0” (my hardware supports OpenGL 4.3.0). As a result many functions I need do not work at all (obviosuly, because they are not available in OpenGL 1). This problem happens “sometimes”.
IF I launch program using gDebugger everything works fine, and glGetVersion returns “4.3.0”, as expected.
Adding this line:
QGLFormat::OpenGLVersionFlags flags = QGLFormat::openGLVersionFlags();
at the beginning of main() function also fixes the problem.
The application works fine on WinXP 32bit.
I wrote OpenGL subsystem for this app 2..3 years ago and the guys who used it said they had similar problem on virtual machines (Win7 or vista guest), but I don’t remember how I dealt with this problem at that time.
OpenGL initialization is performed by Qt 4, without glew or extra libraries, using QGLWidget.
There’s only one QGLWidget in the program. To be precise, there’s a class derived from QGLWidget, its initalization looks like this:
DisplayWidget::DisplayWidget(QWidget* parent) : QGLWidget(QGLFormat(QGL::DoubleBuffer | QGL::DepthBuffer), parent)
OS: Windows 7 64bit.
Compiler: MSVC2008 express SP1.
Qt: Qt 4.8.1 (compiled from source with OpenSSL support using MSVC2008).
Windows SDK: Windows Server 2008 and .NET 3.5.
GPU: GeForce 460 GTX
What could be causing this problem?
“magical fix” (OpenGLVersionFlags) has stopped working after full rebuild, and now application constantly initializes software renderer, even when launched using gDebugger.
All other OpenGL applications on my machine work fine and can use shaders.
I use latest drivers.
After some testing I found that somehow google chrome and steam client affect all Qt application that use OpenGL.
If I have Google Chrome and Steam open, eventually all programs will stop working properly and will no longer be able to get hardware accelerated OpenGL.
If I close google chrome and keep steam open, every 2nd attempt to launch hardware accelerated program will fail.
If I close both steam and chrome, then every program launch will be successful.
Why could this be happening?
I’ve read through debugger output, and found a very interesting thing:
'vdclient.exe': Loaded 'C:\Windows\SysWOW64\nvoglv32.dll' First-chance exception at 0x777f47a5 (ntdll.dll) in vdclient.exe: 0xC0000005: Access violation reading location 0x05aa9000. 'vdclient.exe': Unloaded 'C:\Windows\SysWOW64\nvoglv32.dll'
Basically, when loading nvoglv32.dll, “something” crahses somewhere (debugger doesn’t react to this event, byt the way), and system decides to unload nvoglv32.dll. Judging by its name it is nvidia system/driver component, and without this component there can be no hardware acceleration.
When opengl works properly, this part of log looks like this:
'vdclient.exe': Loaded 'C:\Windows\SysWOW64\nvoglv32.dll' 'vdclient.exe': Loaded 'C:\Windows\SysWOW64\ntmarta.dll', Symbols loaded (source information stripped). 'vdclient.exe': Loaded 'C:\Windows\SysWOW64\Wldap32.dll', Symbols loaded (source information stripped). 'vdclient.exe': Loaded 'C:\Windows\SysWOW64\powrprof.dll', Symbols loaded (source information stripped). The thread 'Win32 Thread' (0x1744) has exited with code 0 (0x0). The thread 'Win32 Thread' (0x1740) has exited with code 0 (0x0). 'vdclient.exe': Unloaded 'C:\Windows\SysWOW64\powrprof.dll' The thread 'Win32 Thread' (0x1748) has exited with code 0 (0x0). The thread 'Win32 Thread' (0x174c) has exited with code 0 (0x0). 'vdclient.exe': Loaded 'C:\Windows\SysWOW64\uxtheme.dll', Symbols loaded (source information stripped).
|Asked By – SigTerm||Read Answers|