Check out our Monthly Survey Page to see what our users are running.

How To: An update on fixing screen-tearing on Linux with an NVIDIA GPU

By - | Views: 105,615
My original guide on how to help fix screen-tearing on Linux with an NVIDIA GPU is a bit dated, so here’s an even easier way.

Notes
You will likely need the 375.26 driver or newer for this to show up in "nvidia-settings".

These options may cause a loss in performance. For me personally, the loss is next to nothing.

It probably won't work with Optimus right now, but this may be fixed in future.

What to do
Previously you needed to edit config files, and it was a little messy. Thankfully, NVIDIA added options in nvidia-settings to essentially do it all for you. The options were added in a more recent NVIDIA driver version, so be sure you're up to date.

Load "nvidia-settings" and you will need to go to this screen and then hit “Advanced” at the bottom (my screenshot doesn't have the button, as this is what you see after you hit it):
image
Tick the boxes for “Force Composition Pipeline” and “Force Full Composition Pipeline” and then hit "Apply".

You can then enjoy a tear-free experience on Linux with an NVIDIA GPU. It really is that damn easy now.

Note: You will likely need to run nvidia-settings with “sudo” for the below to work.
If you want this applied all the time on startup (without needing to do anything), you can hit “Save to X Configuration File”. I have mine located at “/etc/X11/xorg.conf.d/xorg.conf” on Antergos, but your location may be different. I also recommend backing any existing xorg.conf file up if one exists.

This step isn't needed, but it's a fun and useful extra!
I also have mine set to a script and then to a keyboard shortcut, for those times when a game reverts the desktop to a low resolution after exiting, or when a game turns off a second monitor, this will turn it back on.

For that I manually set the resolution like so:
nvidia-settings --assign CurrentMetaMode="DVI-I-1:1920x1080_60 +0+0 { ForceFullCompositionPipeline = On }, HDMI-0:1920x1080_60 +1920+0 { ForceFullCompositionPipeline = On }"
Edit that for your details, like your resolution and monitor connections (you can see them by running "xrandr --query" in terminal), and then save it as an easy to remember filename. You can then set it as a custom shortcut, I use “CTRL+ALT+F4” as it’s not used for anything else.

This has been tested and works for me perfectly across Ubuntu Unity, Ubuntu MATE and Antergos KDE. Article taken from GamingOnLinux.com.
Tags: HOWTO, NVIDIA
11 Likes, Who?
We do often include affiliate links to earn us some pennies. We are currently affiliated with GOG and Humble Store. See more here.
About the author -
author picture
I am the owner of GamingOnLinux. After discovering Linux back in the days of Mandrake in 2003, I constantly came back to check on the progress of Linux until Ubuntu appeared on the scene and it helped me to really love it. You can reach me easily by emailing GamingOnLinux directly.
See more from me
The comments on this article are closed.
63 comments
Page: «5/7»
  Go to:

lukacl 12 Jan, 2017
Hi,

I have been struggling to remove tearing on my laptop with a GTX960m.

Has anyone tested the latest release for xorg-server?
Xorg-Server-1.19.1-Released


Last edited by lukacl on 12 January 2017 at 12:58 am UTC
yzmo 12 Jan, 2017
Okay, it seems like specifically upgrading that package worked. Somehow the package manager hadn't realised there was an update available. The boxes are now there. Thank you so much for the help. :)
14 12 Jan, 2017
View PC info
  • Supporter Plus
OMG it worked!
cxpher@gmail.com 12 Jan, 2017
An important point to note is that if you enable FCP, you might want to disable in game vsync. You'll encounter performance hits that can be pretty massive. In game vsync is no longer necessary.
staticx27 12 Jan, 2017
Being able to set brightness or contrast using this option (and using it in the past with my old GTX 660ti) does not work, In game or on the desktop (Redshift). Not sure why this is, but I thought people should be aware. Unfortunately this makes it not an option for me.


Last edited by staticx27 on 12 January 2017 at 3:48 am UTC
cxpher@gmail.com 12 Jan, 2017
Quoting: staticx27Being able to set brightness or contrast using this option (and using it in the past with my old GTX 660ti) does not work, In game or on the desktop (Redshift). Not sure why this is, but I thought people should be aware. Unfortunately this makes it not an option for me.

Likely a bug that needs to be reported to NVIDIA. I found that with this on, if you switch to another tty and back, redshift works again for that session until you reboot.
Kuduzkehpan 12 Jan, 2017
thx for fix.
monnef 12 Jan, 2017
Not working for me :(. *sadpanda*
I am using KDE (Kubuntu 16.04) and I have also tried setting to full redraw, activating VDPAU in player (it doesn't work in SMPlayer nor Firefox HTML5 player). I am quite annoyed by this - having nice (for me quite expensive) GPU GTX 1070, yet basic "feature" like vsync is broken :'(.

PS: Drivers version is 375.26.
wolfyrion 12 Jan, 2017
I dont think you can manage to have a tearing free distro if you dont have a compositor enabled but if you have Plasma/KDE you dont need these settings , you just need 2 things.

have the compositor enable in everything
(there was a bug that compositor was going disable if you launched anything related to opengl and that was causing tearing and many other problems.)
To fix that you had to create a rule to force the compositor on
Windows Rules: Appearance and Fixes --> Force Compositing --> Force --> No
(dont know if this bug still happens or is fixed)

Then you have to add these lines on /etc/profile

gedit /etc/profile

export __GL_SYNC_TO_VBLANK=1
export __GL_SYNC_DISPLAY_DEVICE=1
export __VDPAU_NVIDIA_SYNC_DISPLAY_DEVICE=1
export __GL_SYNC_DISPLAY_DEVICE=1
export KWIN_TRIPLE_BUFFER=1
export KWIN_USE_BUFFER_AGE=0


As you can see I dont have any of the settings mentioned enable and 0 tearing on everything I do.




Last edited by wolfyrion on 12 January 2017 at 7:03 am UTC
monnef 12 Jan, 2017
Thank you for your time to write down the tips. I tried it all, but it still behaves the same (I have enabled compositor).

I forgot to mention that I also tried:
export __GL_YIELD="USLEEP"
export __GL_THREADED_OPTIMIZATIONS=1


But without any luck. Also tried opengl renderer in SMPlayer, older drivers, but nothing seems to make any change. I am beginning to think that it's broken just for specific GPU serie or model, or some weird combination of package versions, because I see so many posts how to fix it and how it is working for everybody :( .

The tearing is very visible when watching full hd video. Sadly it is working fine in Windows 10 (dual boot), so it shouldn't be a hw issue.
While you're here, please consider supporting GamingOnLinux on:

Patreon, Liberapay or PayPal Donation.

We have no adverts, no paywalls, no timed exclusive articles. Just good, fresh content. Without your continued support, we simply could not continue!

You can find even more ways to support us on this dedicated page any time. If you already are, thank you!
The comments on this article are closed.