PDA

View Full Version : forcing vsync off



mogumbo
03-30-2017, 10:28 AM
I'm dealing with a fairly complex program under Linux/NVidia using multiple subwindows made with Qt and VTK. Every subwindow waits on vsync, giving me a very slow framerate (60Hz / number of windows). I can turn off vsync with Qt-only windows using some Qt API calls that wrap glSwapInterval. But the windows using VTK keep it on all the time. Using nvidia-settings or __GL_SYNC_TO_VBLANK have no effect (glSwapInterval appears to have priority). Does anyone know another way to use xorg or driver settings to force vsync off?

Dark Photon
03-31-2017, 06:50 AM
I've not seen cases where __GL_SYNC_TO_VBLANK didn't work. Have you seen this work properly for you on your (or other apps)? Just verifying that you're using it properly (e.g. "export __GL_SYNC_TO_VBLANK=0 on sh/bash, or setenv __GL_SYNC_TO_VBLANK 0 on csh/tcsh).

You may be able to add one of these to the nvidia Device section of your xorg.conf file, but I confess to have never tried them. Just found them in a quick websearch just now:

Option "SwapbuffersWait" "false"
Option "Sync To VBlank" "false"

mogumbo
04-03-2017, 09:16 AM
__GL_SYNC_TO_VBLANK and nvidia-settings have the desired effect on glxgears, but not on the program I'm working on. They do have an effect on one subwindow after I have turned off its vsync using Qt's glSwapInterval wrapper. Unfotunately, I still can't turn it off for the other subwindows.

Thanks for the Option suggestions. No effect, though. I didn't expect much since those terms don't appear anywhere in my /usr/share/doc directory tree.

I'll dig some more after I get current tasks out of the way....