Easy VSync with nvidia-xrun
I use nvidia-xrun to enable my optimus dGPU on demand, the only thing that was missing was actually working vsync.
After RTFM I finally found the solution: the nvidia-xrun script can be easily modified to enable vsync.
Just add modeset=1 to the line
execute "sudo modprobe nvidia_drm"
so it says
execute "sudo modprobe nvidia_drm modeset=1"
I suggest making a user copy of the script for this.
That's it, working on-demand power with vsync.
If you are not using nvidia-xrun: that parameter can also be set as a kernel boot option: nvidia-drm.modeset=1
There is a guide on the arch wiki, this works too but you have to load the nvidia modules at boot for that. Arch and derivates make that easy via mkinitcpio, no clue how it works on other distros.
I use Manjaro with kernel 4.19 and nvidia 415.25.
Posted Dec 30, 2018, 9:31 AM UTC
https://github.com/Witko/nvidia-xrun/issues/75 September
Hadn't seen that, good to see it's probably coming as a switch.