Solve video tearing on nVidia + GNOME 3

NOTE – Although I have tested this method on Fedora 16, it should work on any computer with an nVidia GPU and a Linux distribution that uses GNOME 3.

There was a time when video tearing on Linux was easily solvable by forcing your desktop environment and/or GPU to enable VSync, and turning compositing off in a window manager like Compiz. The introduction of GNOME 3, which relies on compositing, has made it a little more difficult than it used to be.

If you have an nVidia chipset, and are using GNOME 3 as your desktop environment, I will be detailing the steps necessary to get your videos working like they should have in the first place (yeah, smooth fullscreen flash isn’t a dream anymore!)

Before we begin, here are the specs of the machine I tested these steps on. While they should work on any computer with an nVidia GPU, your mileage may vary.

Test machine – Dell Inspiron 1520
Specs – Intel Core 2 Duo T5450 @ 1.66 GHz
GeForce 8600M GT/PCI/SSE2
2 GB DDR2 RAM

OS – 32 bit Fedora 16 running GNOME 3
Drivers – Proprietary nVidia drivers installed using this guide (version 290.10)

If you’re wondering why I’ve not chosen to go with the default nouveau drivers (open source) instead, it’s cause they suck IMHO. They’re not ready for primetime yet, leaving us at nVidia’s mercy.

Without further ado, here are the necessary steps –

STEP I – nVidia X Server settings

Open nVidia X Server settings by pressing the Windows key and typing nv in the search box that appears.

In the window that opens up, you should see two sections titled “X Server XVideo Settings” and “OpenGL Settings” to the left. Under each of these, enable the “Sync to VBlank” setting and quit.

STEP II – CompizConfig Settings Manager

Open CompizConfig Settings Manager by pressing the Windows key and typing ccsm in the search box that appears.

In the window that opens up, under the “OpenGL” section, enable the “Sync to VBlank” setting.

Under the “Composite” section, disable “Detect Refresh Rate” and “Unredirect Fullscreen Windows”. Also set the refresh rate manually to about twice the maximum refresh rate supported by your display (for example, if you have a monitor capable of 60 Hz, set it at 120).

STEP III – Startup Applications

Open Startup Applications Preferences. On Fedora this can be achieved by pressing Alt+F2 and typing

gnome-session-properties

Add a startup application to this list. Give it any name you desire (for example, nVidia config) and under the command field type

nvidia-settings --load-config-only

You may leave the comment field empty. Add this entry and quit.

Hang in there, we’re almost done!

STEP IV – Editing your environment variables file

Open up a terminal window and gain root access by typing

su

Enter the root password when prompted.
Next, type

echo CLUTTER_PAINT=disable-clipped-redraws:disable-culling >> /etc/environment

to add the setting for the environment variable CLUTTER_PAINT to the /etc/environment file.

We’re done! Reboot your PC to enjoy tear-free video playback.

14 thoughts on “Solve video tearing on nVidia + GNOME 3

  1. Thanks a lot. It seems like it really solved the video tearing problem on my ASUS G51JX running Ubuntu 11.10 with Gnome 3.

  2. Hey dude! You’ve been saying “thank you” to spambots. Except for comment #1, who is an actual person posting a comment about this article (same reason why I came here, and it’s been really helpful, thank you very much), all the others are automated spam. It happens.

    • Thanks a lot🙂 I found out about the spambots very recently, they seemed very convincing at the time! Guess you learn with experience😀

      EDIT – Finally cleaned up all the spam lying around on my blog🙂

  3. Hello, same issues here. Searched days for solutions, but this should fixed the problem. After insert the text in environment, the problem is gone. But I have to test some other situations. AMD II X4, AsRock970 extreme3, Palit 650 TI and Dell P2212H Monitor. I let you know how it goes.

  4. This is an ESSENTIAL trick for all my Archlinux installations!
    Worked both on a Nvidia 9300 (or something like that, the notebook was HP DV5 1170EL) and on this new Samsung ultrabook (lspci just reports:
    00:02.0 VGA compatible controller: Intel Corporation 3rd Gen Core processor Graphics Controller (rev 09)
    )
    I really owe you a big one!

  5. This post is nearly two years old but still relevant! I’m using Ubuntu 12.04 LTS with GNOME 3 on a GTX670 and was experiencing horrible animation lag/judder. After following this guide it is now 90% better! I’m going to put the rest down to the underlying system code etc. though.. that or it’s because my drivers are the 331.xxx ones rather than the suggested ones (which are now very old). Nonetheless, thanks!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s