The Battle of V-SYNC. OpenGL on NVIDIA vs ATI

7/20/2009 5:13:39 PM

By RetroRalph

As some of you would know, RetroCopy is somewhat 3D based, and I decided to use OpenGL for the backend. I recently got a new graphics card in the form of an ATI/AMD 4870 and was not surprised at something I noticed about VSYNC.

I have been seeing this for a few years on NVIDIA based hardware - on Windows platforms with VSYNC enabled in an OpenGL application you experience 100% CPU utilization of the thread which renders (or presents) the video. In RetroCopy this manifested as near 100% total utilization on dual core hardware, with the emulator thread using close to 100% and the rendering thread utilizing 100% itself. I haven't traced the code myself, but it seems obvious NVIDIA drivers would be doing a "while(!VSYNC) {}" type loop waiting for VSYNC instead of handling this in a more appropriate manner.

The "odd" thing is that DirectX applications do not suffer from this penalty, so NVIDIA drivers clearly implement two different ways of handling V-SYNC, the OpenGL way and the Microsoft way. I'm not sure if NVIDIA are doing this on purpose but it has been mentioned multiple times to NVIDIA for at least 3-4 years with no fix.

So it has been something that has been a problem for quite a while, with no fix in sight. AMD/ATI hardware does not seem to suffer from it (my 4870 is fine, as was other Radeon hardware of which I have 3 generations), and on Linux it seems NVIDIA hardware is fine (though I haven't tested it myself, just heard from other developers).

So the question to be asked is why has NVIDIA done nothing about this? Is it intentional crippling of OpenGL on Windows platforms to force DirectX usage? It clearly isn't a hardware issue if OpenGL on Linux doesn't suffer from the flaw and it isn't a Windows issue if ATI hardware can manage it. I had implemented a kludge to fix the NVIDIA problem, giving CPU time back as much as I could, but a much better solution is something which understands the hardware in question and has more information (like a driver).

RetroCopy was originally going to use DirectX on Windows platforms due to issues like this but I decided against it just so I could maintain a singular OpenGL codebase going forward. I have experienced numerous bugs in NVIDIAs OpenGL implementation with various driver sets, and RetroCopy isn't even an intensive OpenGL application. If you own NVIDIA hardware you might want to go to their forums and send them a bit of feedback about this issue. Alternatively you could show them with your wallets and make your next upgrade an ATI part.

1 responses to The Battle of V-SYNC. OpenGL on NVIDIA vs ATI

MarshMellow wrote:

7/21/2009 3:25:21 PM

I have seen this issue come and go on Ubuntu with my 7600GT so I wouldnt say Linux is perfect on this issue.

Add Comment
RetroCopy: Making emulation easy and fun.
  |   RetroCopy © 2011