Question glXSwapBuffers sometimes takes 30 50ms ( nV News Forums NVIDIA Linux ) Updated: 2008-11-23 09:40:06 (3)
glXSwapBuffers sometimes takes 30 50ms
I'm using a GTX 260 board with 177.82 drivers (also tested with 180.08). I get quite noticeable stuttering in my OpenGL programs when vsync is off that I did not experience on my 6600GT on another computer. When vsync is on, things run smoothly but skip every few seconds. The skipping is caused by glXSwapBuffers for some reason occasionally taking 30-50ms to execute instead of the <1ms (no vsync) or ~16ms (vsync) it takes the rest of the time. Lowering the resolution eases the problem to some extent, especially without vsync.
Answers: glXSwapBuffers sometimes takes 30 50ms ( nV News Forums NVIDIA Linux )
I threw together a simple test program as you suggested (attached). The stuttering is much less rapid than in the other programs I was testing (which are more graphically intense) for some unknown reason, but the time glXSwapBuffers takes to run still reaches about 30ms.
For each call to SwapBuffers that takes >2ms, the program prints out the frame number and the time taken by the call in milliseconds. Here's some sample output with vsync off under a non-compositing WM and only a terminal running: