The trick already mentioned in the other answer is to check the "Force Full Composition Pipeline" option in the NVIDIA X Server Settings. This option has to be checked for each monitor. You can do this using the nvidia-settings
command to start the configuration GUI. If that option is not visible, you'll have to click on the "Advanced..." button first. After checking the checkbox, click on "Apply" to save the settings.

However, in order to run this automatically on startup you'll need a command line to set these options in crontab or your session startup. To get this command line you can simply query the current settings after setting them in the GUI using nvidia-settings --query CurrentMetaMode
. For my dual monitor setup, I got this output (formatted for better readability):
Attribute 'CurrentMetaMode' (mypcname:0.0):
id=50, switchable=no, source=RandR ::
DPY-2: nvidia-auto-select @1920x1080 +0+0
{
ViewPortIn=1920x1080,
ViewPortOut=1920x1080+0+0,
ForceCompositionPipeline=On,
ForceFullCompositionPipeline=On
},
DPY-6: nvidia-auto-select @1920x1080 +1920+0
{
ViewPortIn=1920x1080,
ViewPortOut=1920x1080+0+0,
ForceCompositionPipeline=On,
ForceFullCompositionPipeline=On
}
Everything from the third line can then be directly copy-pasted to the
nvidia-settings --assign CurrentMetaMode=...
command. So with the above example this would work:
nvidia-settings --assign CurrentMetaMode="
DPY-2: nvidia-auto-select @1920x1080 +0+0
{
ViewPortIn=1920x1080,
ViewPortOut=1920x1080+0+0,
ForceCompositionPipeline=On,
ForceFullCompositionPipeline=On
},
DPY-6: nvidia-auto-select @1920x1080 +1920+0
{
ViewPortIn=1920x1080,
ViewPortOut=1920x1080+0+0,
ForceCompositionPipeline=On,
ForceFullCompositionPipeline=On
}"
Theoretically, you could write these settings manually. The important thing is the ForceFullCompositionPipeline=On
part. But unfortunately, that option can't be set without specifying the arrangement of the monitors. And determining the desired geometry coordinates is a bit more troublesome to do by hand.