eliminating tearing, for web browsers, using xfce and nvidia

I’m using the official Nvidia 390.25 driver.

The magic cure for tearing:
nvidia-settings -> x server display configuration -> advanced -> force composition pipeline

Magic comes at a cost of course. ;-]

Without “force composition pipeline”:

I observed that keeping applications on different desktops (workspaces) helps,
i.e. don’t have one window ontop of another.
Also, certain websites on other tabs could cause tearing,
i.e. keep tabs to a minimum.

For firefox it helped to turn off smooth scrolling. (preferences->advanced->smooth scrolling).

With “force composition pipeline”:

Chromium 64.0.3282.140 is having some performance issues (stuttering while scrolling).

qutebrowser v1.1.1 (6f028e9) doesn’t have performance issues, using (Py)Qt5.10 Webengine (Chromium 61.0.3163.140).

Firefox 52.6.0 doesn’t have performance issues.

It seems that adding “force composition pipeline”
to /etc/X11/xorg.conf makes xfce hang on startup.
I can solve it by: ctrl+alt+f1 then ctrl+alt+f7
but maybe I’ll just enable it manually. >_<

I found I can programmatically set it with:

nvidia-settings --assign CurrentMetaMode="nvidia-auto-select +0+0 { ForceCompositionPipeline = On }"

http://www.thelinuxrain.com/articles/got-tearing-with-proprietary-nvidia-try-this

Although, this leaves the screen black and I need to do ctrl+alt+f1 then ctrl+alt+f7.

To solve this, I installed xrefresh and made a script:

nvidia-settings --assign CurrentMetaMode="nvidia-auto-select +0+0 { ForceCompositionPipeline = On }"
xrefresh

This could be your graphic card issue. What nvidia card do you have.
I am using xfce w/ nvidia gtx 650 Ti kind of old card now but I am not having a tearing issue.
I use xfwm4 and sometimes kwin with one led monitor, one lcd monitor and one lcd tv.

Edit:
I am using kernel 4.14.14 and 390.25 nvidia driver.

It probably is. I have problems on plasma and openbox too.
At least I finally have a solution. ;-]

GTX 750
Linux 4.4.104-39

Create /home/<username>/bin/fcp


nvidia-settings --assign CurrentMetaMode="nvidia-auto-select +0+0 { ForceCompositionPipeline = $1 }"
xrefresh

chmod +x /home/<username>/bin/fcp

On:
fcp 1

Off:
fcp 0