# How do I remove screen tearing in 16.04 with nvidia GTX 960 M?

My 16.04 installation suffers from quite bad screen tearing. If I drag a window, for example, sideways across the screen, it fragments so that the bottom of it is quite a bit behind the top, and when watching a video, the bottom of the screen is a few frames behind the top.

I've tried the solutions given in the following questions, but neither has helped, unfortunately:

My graphics card is an Nvidia GeForce GTX 960M, I am using NVIDIA binary driver - version 361.42 from nvidia-361.

This problem was also present when I was running 15.10.

• literally nothing seems to work to fix this. Only switching to intel graphics, which sucks. – Riki137 Apr 23 '16 at 16:26
• @Riki137 How does one switch back to intel graphics? – user3728501 Jun 30 '16 at 17:24
• What happened 15.10/16.04 to prevent local edits working anymore was due to a supposed mesa bug. The so called fix was to go to modesetting for Intel while using the nvidia drivers via nvidia-prime. The tearfree option cannot work with modesetting & one is prevented from switching to sna. It is possible to get around this by modifying ubuntu-drivers-common & altering the time to sleep for unity greeter to work around the mesa bug. But will not post as an answer here as not 100% clean solution. (may have a post in UF) There is a fix in xserver, could show up next year in Ubuntu. (or use 14.04 – doug Oct 16 '16 at 22:41
• I also had this problem with Nvidia Quadro M1200, even after updating the driver (to version 381.09), which was only solved by switching to the Intel GPU as in @qwr's answer below. – Garrett Apr 19 '17 at 21:03

Easy fix I found on /g/. Add this command to your startup commands

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


Of course this works if you're using Nvidia drivers.

EDIT: So for multimonitor setups I would suggest using the Nvidia X server settings program, go to X Server Display Configuration and use Save to X configuration file. Now seek out /etc/X11/xorg.conf and add { ForceCompositionPipeline = On} after each monitor setting (the +0+0 and +something+someting)

Additionally you can do sudo apt install compton and add compton to your startup commands.

EDIT: I don't know how long this has been the case but the NVIDIA X Server Settings program nvidia-settings has an option to do ForceFullCompositionPipeline graphically. In the 'X Server Display Configuration' menu click on 'Advanced...', tick 'Force Full Composition Pipeline' and hit 'Save to X Configuration File'. If you have no predefined path to the configuration file, type /etc/X11/xorg.conf to the file path text box and save.

• Thanks, this worked but it also turned one of my monitors black.. – nana Jan 21 '17 at 20:43
• ...So if that happens just go ahead and enable that display in Displays again. – nana Jan 21 '17 at 20:49
• What do you mean by /g/? – Garrett Apr 19 '17 at 21:07
• For other noobs out there, keep in mind you can test this in your terminal to see if it works (before adding it to your startup script and re-logging in). Unfortunately, this didn't work for me (Nvidia Quadro M1200, nVidia version 381.09). – Garrett Apr 19 '17 at 22:19
• Also didn't work for me. Running GF940M. Seems like M chips or computers with enabled integrated graphics can't do this. – dat tutbrus Aug 31 '17 at 2:14

The only solution I've tried so far that's done anything isn't great, but it's something: Use the Intel GPU instead of Nvidia GPU. It reduces most screen tearing.

In Nvidia X Server settings (nvidia-settings) go to PRIME Profiles and select Intel (Power Saving Mode). Alternatively sudo prime-select intel.

I'm using nvidia-370, which is the current official release, with Nvidia 940MX. It seems like ironically their driver is still worse than Intel drivers. On the bright side, my battery life nearly doubled, so it was a pretty good trade off.

Update: Using the default Intel drivers for kernel 4.7.0, there are no screen tearing issues at all. nvidia-387 with nomodeset in grub seems to be fine but brightness changing is disabled, so I'm not using it for now.

This comes a little bit late, but I would honestly suggest you to switch to XFCE4 or similar non-compositing DE. At least in my case (Lenovo Y580, opensuseLeap 42.1 + bumblebee), this how I got rid of screen tearing and slow scrolling in firefox. Cheers!!!!

• Shipping around a problem and solving a problem are different things. but it is nice that you share your experience here. Welcome to AskUbuntu! – mook765 Oct 10 '16 at 17:39
• Thanks for the suggestion - even XFCE couldn't solve my screen tearing woes. I think my laptop might just be cursed. Hope this workaround can help someone else though. – Gilly Oct 11 '16 at 21:34

I've had this problem for ages, now I just have the nouveau driver installed. Try the solution from this post, I'd be interested to know if it works: http://ubuntuforums.org/showthread.php?t=2235382

Also this maybe? But it didn't work for me... https://psyq123.wordpress.com/2015/09/20/another-way-to-fix-tearing-and-vsync-issues-using-the-nvidia-driver/

Ok, took some doing, but I fixed it as follows:

Open a CLI and do:

sudo nvidia-xconfig


Then:

sudo nvidia-settings


Set your screen resolution and refresh rate in the Xserver settings (I set mine to 1920x1200 @60hz) and save it to xorg.conf

Then do:

sudo nano /etc/X11/xorg.conf


Edit the device section thusly:

Section "Device"
Identifier "Device0"
Driver "nvidia"
VendorName "NVIDIA Corporation"
BoardName "GeForce GTX 650"
Option "RegistryDwords" "PerfLevelSrc=0x2222"
Option "TripleBuffer" "True"
EndSection


This sets the card to performance mode and enables triple buffering.

In nvidia-settings/OpenGL set:

Sync to Vblank
Allow Flipping
Use Conformant Texture Clamping


Save your configuration and restart the X-server.

• I couldn't find an option to change the refresh rate within nvidia settings, and neither could I find the option to set Sync to Vblank, Allow Flipping or Use Conformant Texture Clamping. Changing my xorg.conf didn't help, perhaps because I have more than one Device section. Thanks for the reply though! – Gilly Apr 28 '16 at 17:27
• Really frustrating problem... more on it here: youtube.com/watch?v=-55y5sgHcbo (also doesn't work for me) – draoi Apr 30 '16 at 14:45
• Didn't work for me either, unfortunately. I'm just using Intel graphics for now and hoping this gets fixed in an update. There seems to be a lot of people affected by this and similar problems. – Gilly May 1 '16 at 16:41
• Where is the "Vblank Allow Flipping Use Conformant Texture Clamping"? – user3728501 Jun 30 '16 at 22:23
• I don't know, looks like if that option ever existed it's gone. At least from the nvidia driver that installs through the driver manager. Maybe you could try installing the nvidia driver from the nvidia website, but you run the risk of hosing your system. – draoi Jul 6 '16 at 1:48