Disable vertical sync for glxgears
The vblank_mode
environment variable does the trick. You should then get several hundreds FPS on modern hardware. And you are now able to compare the results with others.
$> vblank_mode=0 glxgears
If you're using the NVIDIA closed-source drivers you can vary the vertical sync mode on the fly using the __GL_SYNC_TO_VBLANK
environment variable:
~$ __GL_SYNC_TO_VBLANK=1 glxgears
Running synchronized to the vertical refresh. The framerate should be
approximately the same as the monitor refresh rate.
299 frames in 5.0 seconds = 59.631 FPS
~$ __GL_SYNC_TO_VBLANK=0 glxgears
123259 frames in 5.0 seconds = 24651.678 FPS
This works for me on Ubuntu 14.04 using the 346.46 NVIDIA drivers.
For Intel graphics and AMD/ATI opensource graphics drivers
Find the "Device" section of /etc/X11/xorg.conf
which contains one of the following directives:
Driver "intel"
Driver "radeon"
Driver "fglrx"
And add the following line to that section:
Option "SwapbuffersWait" "false"
And run your application with vblank_mode
environment variable set to 0
:
$ vblank_mode=0 glxgears
For Nvidia graphics with the proprietary Nvidia driver
$ echo "0/SyncToVBlank=0" >> ~/.nvidia-settings-rc
The same change can be made in the nvidia-settings
GUI by unchecking the option at X Screen 0 / OpenGL Settings / Sync to VBlank
. Or, if you'd like to just test the setting without modifying your ~/.nvidia-settings-rc
file you can do something like:
$ nvidia-settings --load-config-only --assign="SyncToVBlank=0" # disable vertical sync
$ glxgears # test it out
$ nvidia-settings --load-config-only # restore your original vertical sync setting