nvoglv32 consuming a ton of cpu

Hi All,

I’m developing a 32-bit OpenGL based game and testing on Windows 8.1 with a GeForce GT 640M (with latest driver). Once in every 3-4 launches of the game, the fps is quite low (and cpu quite high) and never improves. The rest of the time, the game runs fine at 60fps and reasonable cpu usage.

I’m using GLFW as the OpenGL window manager and I’ve tried changing swapInterval, calling glflush, glfinish, and pretty much everything suggested online. Nothing helps.

After profiling the game while it was running sluggishly I noticed that nvoglv32.dll is consuming a ton of cpu. When the game is running smoothly nvoglv32.dll consumes much less cpu.

Is this a known driver bug? Is there something that I might be doing wrong? Here’s the relevant part of the source code: https://github.com/Sheado/cocos2d-x/blob/v3-sheado/cocos/platform/desktop/CCGLViewImpl-desktop.cpp

Any suggestions greatly appreciated!
Thanks

A little more detail from my latest testing/profiling:

After profiling a bit, I’ve been able to identify one anomaly that occurs when the sluggishness is happening. If when the OpenGL window is created 2 threads titled nvoglv32.dll are launched, then everything is ok. But on the occasion 3 threads titled nvoglv32.dll are spawned - then there’s sluggishness the entire time the app is running.

To reproduce, you can run simple.c from the GLFW examples: https://github.com/glfw/glfw/blob/master/examples/simple.c
Place a debug breakpoint just after glfwCreateWindow(…) and take a look at the threads after that function is called. Sometimes you will see 2 nvoglv32.dll threads - other times you’ll see 3. When there’s 3, you can notice that performance is nearly 50% of what it should be.

Digging around some more in the GLFW code, the problem is happening after the call to:

nativeCount = DescribePixelFormat(window->wgl.dc,
                                          1,
                                          sizeof(PIXELFORMATDESCRIPTOR),
                                          NULL);

Sometimes 2 nvoglv32.dll threads are spawned, other times 3. When it’s 3, performance is terrible.

Same problem here: I’m developing a game with cocos2d-x on PC on my main computer (Windows 7, CPU 8 threads, GTX 970, latest NVidia drivers). In the main menu, which is very simple, the game consumes nearly all the time 25% of the cpu (2 threads at 100%).

When doing a cpu profile, the whole time is spent only in nvoglv32.dll.

Note that when I’m testing the game on a laptop with an Intel chipset, the CPU usage is under 1%.

Same thing on a netbook AMD C-50 the CPU is under 2%.

Thanks for the response haddock86,
Sorry for the late reply.

Just wanting to confirm this still happens on the same machine with Windows 10 upgrade and latest drivers.
Have you had any luck with this issue?

Hi again,

Updating with the latest I’ve discovered…

There’s a chance this is related to the “threaded optimizations” setting in the Nvidia control panel. Setting that to off instead of auto seems to have made the issue go away (at least so far in my testing). I can’t ask people to change their settings, so I was wondering if there’s any way to request no optimization via code? Or if there’s anything else that can be done to prevent the extra thread from spawning?

Getting this behavior too with one CPU thread being pegged at 100% with OpenGL app. Disabling the “threaded optimizations” drops it down to 1% nicely.

same thing for me
is there something that should be called on opengl to prevent this ?
or maybe it’s just happenning because running the performance analyzer?