Fix GNU/Linux Screen Tearing

Screen Tearing means that during video motion, the edges of objects fail to line up. It is especially obvious when you are playing games, vertically scrolling a web page in browsers such as Firefox, Chrome, watching videos, etc.

To test screen tearing, drag a window horizontally. If you see the vertical edges of the window fail to line up, you can say screen tearing occurs. Here is how you can solve it on GNU/Linux.


Method 1 (the best): With Driver

Intel GPU

Edit /etc/X11/xorg.conf.d/20-intel.conf as follows. If this file doesn't exist, create it. Otherwise make sure "TearFree" is TRUE.

Section "Device"
    Identifier  "Intel Graphics"
    Driver      "intel"
    Option      "TearFree" "true"
EndSection
Then relogin or reboot.


AMD GPU

For GPU newer than Radeon HD2000 series (released in 2007):

Edit /etc/X11/xorg.conf.d/20-radeon.conf as follows. If this file doesn't exist, create it. Otherwise make sure "TearFree" is TRUE.

Section "Device"
    Identifier  "Radeon"
    Driver      "radeon"
    Option      "TearFree" "on"
EndSection
Then relogin or reboot.

For Radeon HD2000 series or older GPU:

Edit /etc/X11/xorg.conf.d/20-radeon.conf as follows. If this file doesn't exist, create it. Otherwise make sure "EXAVSync" is TRUE.

Section "Device"
    Identifier  "Radeon"
    Driver      "radeon"
    Option      "EXAVSync" "yes"
EndSection
Then relogin or reboot.


Nvidia GPU

Run the following command as root. This will auto-generate a config file.

# nvidia-xconfig
Edit /etc/X11/xorg.conf. Add the 3 following options inside Section "Screen".
    Option         "metamodes" "nvidia-auto-select +0+0 {ForceCompositionPipeline=On, ForceFullCompositionPipeline=On}"
    Option         "AllowIndirectGLXProtocol" "off"
    Option         "TripleBuffer" "on"
Then relogin or reboot. For more info, see this.


Note

  • (IMPORTANT) If you switch the GPU to another from a different manufacture, you need to remove the configuration file for the previous GPU, otherwise you may not be able to boot properly.
  • In xorg's config, boolean options may optionally have a value specified. When no value is specified, the option's value is TRUE. The following boolean option values are recognized as TRUE:
    1, on, true, yes
  • All Option values, not just strings, must be enclosed in quotes.

Method 2: With Compositor

XFCE's compositor (if you are using XFCE)

Click

Applications -> Settings -> Window Manager Tweaks
Under the Compositor tab, select Enable display compositing and Synchronize drawing to the vertical blank.

Known issue: Can not be enabled on Fedora 28.


Compton:

Disable your desktop's compositor.

Install compton.

Try running

compton --vsync [method]

There are 3 methods: drm, opengl, opengl-oml. Try and find the one that works for you.

You can daemonize compton by "-b" and autostart the command on boot:

compton --vsync [method] -b

for more info, visit https://github.com/chjj/compton/wiki/vsync-guide.


Autostart Compton

If you are using XFCE, to autostart compton, click

Applications -> Settings -> Session and Startup
Under Application Autostart tab, add the command above.


Related

Comments

Popular

Intel 7th and 8th generation processor graphics driver for Windows 7/8/8.1

AV1 vs VP9 vs AVC (h.264) vs HEVC (h.265): Part II - Fidelity

AV1 vs VP9 vs AVC (h.264) vs HEVC (h.265): Part I - Lossless

AV1 vs VP9 vs AVC (h.264) vs HEVC (h.265): Part IV - Decode

AV1 vs VP9 vs AVC (h.264) vs HEVC (h.265): Part III - Quality

OBS Studio settings for best quality (loseless) recording

Install VMAF on Fedora, CentOS/Red Hat (RHEL)