Support me on Patreon to keep GamingOnLinux (and me) alive.

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

Posted by , 11 January 2017 at 3:57 pm UTC / 16058 views
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.
Comments
Page: «3/7»
  Go to:

stan commented on 11 January 2017 at 7:18 pm UTC

For those who don’t know already, you can also use Compton to disable tearing, which may work with more than just the nvidia drivers:
compton --vsync opengl-swc --backend glx
Compton is a compositor so you’ll want to disable your window manager’s compositor first, if it has one. Alternatively, some WMs have an integrated vsync option (but in the case of Xfwm 4.12, it doesn’t work).


renegat0x0 commented on 11 January 2017 at 7:27 pm UTC

I am wondering if the title/description is OK. If it is a fix for all nvidia cards, or if for some cards only. I found the solution several days ago and I must say that it not only fixes tearing but overall performance in Linux gaming. The stutter in Saints row the third was unbearable. For the past few months I have been using openbox with compton, but it is better to fix that in xorg. However if I plug/unplug monitors it may be cumbersome to rewrite xorg, or to be force to update the setting each and every time.

Still better than windows.

Yesterday I was backupping external drive storage, which took a while. Unfortunately for me windows decided to install updates and my process was blocked half-through. Thank you Microsoft.


knotted10 commented on 11 January 2017 at 7:32 pm UTC

Not working on my optimus laptop, I have the same problem @Twomby has, even with the latest drivers (375.26)

I think that I'll need to wait until xorg server 1.19 comes out to stop seeing the damn annoying screen tearing


rea987 commented on 11 January 2017 at 8:12 pm UTC

TwombyWasn't able to upgrade to latest version. Got a bunch of issues with the installer under Mint 18.1. Reverted back to 367.57 for the time being, but will definitely try again when I have more time on my hands. Thanks for this article and for the support provided by commenters!

You most probably have Nvidia/Intel hybrid laptop just like me. I am having the same "x screen 0 (no scanout)" screen name with GeForce 940M on Ubuntu 16.04 based Mint 18.1 for no reason. I can even use my Philips 32" TV as a HDMI output via system's default "mate-display-properties" while using proprietary Nvidia drivers. I have Nvidia driver 375.26 installed via "Proprietary GPU Drivers : “Graphics Drivers” team" PPA. I even tried several lower version drivers; no go... I will try Ubuntu Mate 16.10 soon, but I do not expect any difference; cause the problem exists also in Mint 17.3...


natewardawg commented on 11 January 2017 at 8:21 pm UTC

Thanks, this has been something really annoying to me for a while now


tuubi commented on 11 January 2017 at 8:24 pm UTC
View PC info
  • Supporter

stanFor those who don’t know already, you can also use Compton to disable tearing, which may work with more than just the nvidia drivers:
compton --vsync opengl-swc --backend glx
Compton seems to be a popular choice for Xfce users like us, and for me it works pretty much perfectly, but looking at this I think the optimal settings might be different for different graphics hardware. In fact the guide suggests that it might be better to use VSync options provided by the driver over Compton's own, if available.

The new Mint 18.1 Xfce actually includes a setting to use Compton as the compositor instead of Xfwm's own, making the switch as easy as clicking a checkbox, but I haven't looked at their default Compton config.

BTW: Compton's VSync guide also has this to say about NVidia's ForceFullCompositionPipeline option:
QuoteHowever it’s indicated that it introduces huge (~30%) performance loss on some OpenGL applications.
I guess this info could be old and obsolete though?


knotted10 commented on 11 January 2017 at 8:35 pm UTC

rea987
TwombyWasn't able to upgrade to latest version. Got a bunch of issues with the installer under Mint 18.1. Reverted back to 367.57 for the time being, but will definitely try again when I have more time on my hands. Thanks for this article and for the support provided by commenters!

You most probably have Nvidia/Intel hybrid laptop just like me. I am having the same "x screen 0 (no scanout)" screen name with GeForce 940M on Ubuntu 16.04 based Mint 18.1 for no reason. I can even use my Philips 32" TV as a HDMI output via system's default "mate-display-properties" while using proprietary Nvidia drivers. I have Nvidia driver 375.26 installed via "Proprietary GPU Drivers : “Graphics Drivers” team" PPA. I even tried several lower version drivers; no go... I will try Ubuntu Mate 16.10 soon, but I do not expect any difference; cause the problem exists also in Mint 17.3...

I've made a research about this issue, it will be fixed on the release for xorg server 1.19, having kernel 4.5+ and latests would fix every screentearing issue for optimus laptops
I'm actually waiting for the moment that the arch linux release that xorg version to the stable repos and i'll switch to manjaro right away


iplaygameswearingatux commented on 11 January 2017 at 8:39 pm UTC

Guys who have laptops with two graphics cards: don't waste your time reinstalling drivers. As for now, Nvidia isn't really bothering with optimizing drivers for laptops. Editing xorg.conf seems like the only way to go for us; but I don't know if it would work.
Edit: Read the comment about x.org 1.19. Really hope it would fix the issue.


Last edited by iplaygameswearingatux at 11 January 2017 at 8:43 pm UTC


rea987 commented on 11 January 2017 at 8:49 pm UTC

knotted10I've made a research about this issue, it will be fixed on the release for xorg server 1.19, having kernel 4.5+ and latests would fix every screentearing issue for optimus laptops
I'm actually waiting for the moment that the arch linux release that xorg version to the stable repos and i'll switch to manjaro right away

That's interesting. Cause, Linux Mint will stick with kernel 4.4 for 2 years until the next LTS of Ubuntu released. Of course it will be possible to install backports but it still will be a hassle for end users.

iplaygameswearingatuxGuys who have laptops with two graphics cards: don't waste your time reinstalling drivers. As for now, Nvidia isn't really bothering with optimizing drivers for laptops. Editing xorg.conf seems like the only way to go for us; but I don't know if it would work.

Yeah, I figured that out long time ago. But finding a magical xorg.conf for the exact hardware is quite hard...


liamdawe commented on 11 January 2017 at 8:59 pm UTC

knotted10Not working on my optimus laptop, I have the same problem @Twomby has, even with the latest drivers (375.26)

I think that I'll need to wait until xorg server 1.19 comes out to stop seeing the damn annoying screen tearing
I don't think this works om Optimus chips.

tuubiBTW: Compton's VSync guide also has this to say about NVidia's ForceFullCompositionPipeline option:
QuoteHowever it’s indicated that it introduces huge (~30%) performance loss on some OpenGL applications.
I guess this info could be old and obsolete though?
That's very outdated information, my own tests have shown it to be a 2-3FPS difference, so that can be written off for benchmark differences each time you run it. Old cards may have more of an impact, but it hasn't been a problem for quite some time.


  Go to:

Due to spam you need to Register and Login to comment.


Or login with...

Games & Release Calendar
Livestreams & Videos
Popular this week
View by Category
Contact
Latest Forum Posts
Facebook