What to do when your request to disable / enable vysync is not working. (Linux / Windows + Nvidia)

Well it turns out that when you set your option to disable or enable vsync in your config.prc file, its actually a request that the gpu you are using can deny!

So if these setting are not working:

loadPrcFileData("", "sync-video #t")
loadPrcFileData("", "sync-video #f")

It means your gpu is not honoring that request. On linux, with an nvidia gpu, this can be configured in the the Nvidia Setting panel.

Open Nvidia Setting โ†’ Select X Screen 0 (your number may be different) โ†’ Select OpenGL Settings โ†’ Check or uncheck Sync to VBlank depending on your needs.

Screenshot from 2023-07-13 13-43-59

Windows and other gpus have similar settings panels and and settings for vsync. Hopefully others will comment details of their system on here.

Thank you ppl in the IRC chat for the help and as always, Happy Hacking.

1 Like

On Windows you can use the NVIDIA Control Panel (in case you have an NVIDIA gpu) and set the parameter
Vertical sync to Use the 3D application setting
in combination with sync-video #f in panda to disable vsync.

2 Likes

Actually you can force the driver to sync the video or not from your program, but you must use proprietary environment variables : __GL_SYNC_TO_VBLANK for NVidia and vblank_mode for Intel and AMD (Thankfully you can use the same value for both, 1 to sync and 0 to disable it)

You can find the discussion in this issue : VSync does not work on Linux with NVidia drivers ยท Issue #963 ยท panda3d/panda3d ยท GitHub

2 Likes