How to force OpenGL Vsync if game does not provide an option ?

Hi,
I’m running on GTX770 with latest 361.28 driver, xorg-server 1.18.1.

Crusader Kings II does not provide vsync option on linux actually, and playing it makes my GPU very hot (80°C) because it runs between 200 and 400 fps.

“Sync to vblank” is activated in nvidia settings.

I searched for a solution and nothing I found worked for me.

  • I tried those in my xinitrc, or before running the game:
    export __GL_SYNC_TO_VBLANK=1
    export __GL_SYNC_DISPLAY_DEVICE=DP-1
    export __VDPAU_NVIDIA_SYNC_DISPLAY_DEVICE=DP-1

  • I tried those options in xorg.conf:
    Option “metamodes” “nvidia-auto-select +0+0 { ForceFullCompositionPipeline = On }”
    Option “TripleBuffer” “On”

  • I tried activating application profiles with GLSyncToVblank rule.

  • I tried compton compositor with --vsync opengl.

I can make it without tearing, but I cant find a way to reduce fps in this particular game.

I did report my problem to game tech support and they redirected me here.

Thanks for any help you could provide.

Have you tried starting the game with:__GL_SYNC_TO_VBLANK=1 ?

Yes I tried “__GL_SYNC_TO_VBLANK=1 %command%” as steam launch option, tried without the launcher, and also directly in a terminal, it’s not working.

Vsync was working in older versions of the game, devs are now aware of it but it will probably take time until it goes back to the game… Meanwhile I can’t find a solution.

I’m still without solution to this problem, any others ideas please ?

If there is sh file that runs the actual executable you can insert the “export __GL_SYNC_TO_VBLANK=1” command before it runs. I can’t confirm though because vsync is just not possible for the my current setup.

Remove the TripleBuffer line - TripleBuffer On will break vsync.

What are you saying? “Without tearing” indicates that vsync is on, which is presumably what you are trying to achieve - so what is the problem?

What is reporting that frames-per-second figure?

Steam overlay provides an fps counter, in other games with vsync active it runs at constant 60fps.
I need to limit frame rate because this game vsync option is actually broken, and I was looking for alternatives before it gets fixed.