Ubuntu – How to remove screen tearing in 16.04 with nvidia GTX 960 M

16.04graphicsnvidia

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.

Best Answer

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.