Screen tearing with a newer nVidia GPU

I couldn't find a good answer to why and how to fix screen tearing, so I will ask it myself.
I tried most of the stuff I found, but it was all for other versions of Linux, or 1-3 years old posts.
I have Manjaro KDE 18.0.4 and a GTX 1060 3GB, tried the method of editing the nvidia.conf file but it didn't work.
In the Hardware Configuration, I have video-nvidia installed (not open-source), video-linux (installed and open-source) and video-vesa (open-source)
Kernel is Linux 4.19.45-1 (linux419)

You didn't use the search function, did you?
There are literally a gazillion threads about screen tearing with nvidia...

Anyway, try with export KWIN_TRIPLE_BUFFER=1 in /etc/profile.d/ (again, there are lots of threads about that), as described for example here:

Didn't solve my problem :upside_down_face:

Did you try to enable "force full composition pipeline"?

Yep, and restarted, no effect

How did you do it?
At least one of the methods mentioned above should work.

Please also post output of inxi -G

Followed the steps that were listed first, tried stuff from the replies too.

Device-1: NVIDIA GP106 [GeForce GTX 1060 3GB] driver: nvidia v: 418.74
Display: x11 server: X.Org 1.20.4 driver: nvidia tty: N/A
OpenGL: renderer: GeForce GTX 1060 3GB/PCIe/SSE2 v: 4.6.0 NVIDIA 418.74

Don't just look at that single thread, which I only gave you as an example. As I said before, use the search function, there are many threads about this issue.

On the driver side, everything seems to be in order.

Also read this:

Just curious: Did you try with a different DE like xfce or cinnamon for example?

I did try other linux distros, but only tried Manjaro KDE

Ok. And the other distros did not have screen tearing with the same hardware?

How do you test for screen tearing? Which video player do you use? Does it happen with all video players?

I see it while scrolling through pages and while dragging windows.
Other distros did have screen tearing too.
Basically any vertical movement had screen tearing.

See this post, install kwin-lowlatency from AUR and configure as described.

Since you have tried using other ways to fix it, remember to delete the exports, nvidiarc config and return xorg config to default.

Check the compositor is enable

and you have force full composition pipeline checked, this needs to be done as root for it to stick after reboot.

This has regressions after the last kwin update. Refer to my post above if you want it working seamlessly. And using both Vsync from Compositor and enabling full composition pipeline has always been an overkill. Not only it induces more latency and doesn't correctly time the sync to vblank, but you get a huge performance hit on top.

Would upgrading my kernel version help?

I very much doubt a kernel upgrade would help.
I'd just stay with 4.19 - which is what I'm using too.

Not completely wrong, but for some people it was the only way to get rid of the tearing.
Although on KDE, triple buffer should be enough.

That depends on the applications. I'm not a proponent of FFCP either, but that is rather due to the increase of input lag.

Don't worry about the kernel at this point. I've only put it there because it doesn't work with 5.1+ which borks a lot of things for me personally.

It was, before they broke it

Who? nvidia?
Ah ok I think I misunderstood.

Triple buffer is enough here (KDE + GTX 1070), no FFCP.

The Glx swap buffers new code broke it in kwin. Legacy methods aren't working anymore. You can get half an adequate vsync with kwin's vsync and triple buffering, but it's costly and it messes up so much more. I guess you haven't experienced it because 1) your monitor is working at 60hz and you can't see it or 2) you are not a fan of gaming.

Give kwin-lowlatency a go. You'd be surprised :wink: