Monday, January 19, 2015

Fix screen tearing issues with Mint 17 and NVidia

I've been fighting screen tearing issues with Mint and my NVidia GTX 760 for the past year.  I use four monitors, and on each monitor there is a horizontal line where tearing will occur, but only on this line (usually tearing occurs randomly across the whole screen).  It affects full screen games, videos, and windows alike.  Toggling vsync in the nvidia-settings control panel had no effect.

The standard /etc/environment options could not resolve it:

CLUTTER_PAINT=disable-clipped-redraws:disable-culling
CLUTTER_VBLANK=True

I upgraded to Mint 17.1 which added a new option in the general settings menu to "Disable compositing for full-screen windows".  This didn't help either.  Finally I came across this thread which had the answer.  The key is to add "ForceFullCompositionPipeline = On" to the screen settings in xorg.conf.

Open up /etc/X11/xorg.conf.  If you don't have xorg.conf, run "sudo nvidia-settings", click "X Server Display Configuration" on the left, then click "Save to X Configuration File" at the bottom.

In /etc/X11/xorg.conf you should have a line that looks like:

Option "metamodes" "nvidia-auto-select +0+0"
Change this to :
"Option "metamodes" "nvidia-auto-select +0+0 { ForceFullCompositionPipeline = On }"

In my case I have multiple monitors, so mine looks like:

 Option         "metamodes" "DVI-I-1: nvidia-auto-select +1920+1050 { ForceFullCompositionPipeline = On }, HDMI-0: nvidia-auto-select +240+0 {rotation=invert, ForceFullCompositionPipeline = On }, DVI-D-0: nvidia-auto-select +3840+1050 { ForceFullCompositionPipeline = On }, DP-1: nvidia-auto-select +0+1050 { ForceFullCompositionPipeline = On }"
You also need to add (important!):
Option    "TripleBuffer" "True"

Finally my tearing issues are resolved for full screen games, windowed games, full screen video, and windowed video.  Tested on Mint 17.1 with an NVidia GTX 760 and NVidia driver version 346.35.

For reference, here is my full xorg.conf file.  I do not have CLUTTER_PAINT and CLUTTER_VBLANK set in /etc/environment.  I have Sync to VBlank turned on in nvidia-settings.  I do not have "Disable compositing for full-screen windows" checked in the Mint General Settings widget.

3 comments:

Marcin said...

OMG YOU ARE MY HERO !! I'm a bit new linux user and since i istalled linux mint 17.1 this nast tearing was the only thing i could now deal with.. i wasted so much time and efforg to deal with this... ano now You helped me - TNX !!

Bingus said...

Nice! This really helped, thanks heaps. I had seen similar fixes but only this explained the whole process (like creating xorg.conf for example).

krt said...

Hello, I tried many "fixes" for this but your solution really did it! THANKS !