18

So I have recently switched to Ubuntu 18.04. LTS and I'm getting a lot of screen tearing especially during video playback on e.g. YouTube. Could anybody help me fix this? Note that I'm completely new to Linux.

3
  • 3
    What's your video card? Nvidia, AMD, or Intel? May 7, 2019 at 17:04
  • 2
    Have you installed any video drivers? Open Software & Updates, Additional Drivers tab, and tell me what you see.
    – heynnema
    May 7, 2019 at 18:46
  • I've never made it work when using Nvidia, however if you use intel video cards, you can follow this trick here: github.com/bauca/graphics-switcher
    – Bruno
    May 20, 2022 at 14:02

6 Answers 6

19

For Firefox do this:

  • Type "about:config" on the address bar.
  • Search for layers.acceleration.force-enabled (default is false). This forces Hardware Acceleration to turn on.
  • Change it to true by double-clicking.
  • Save and restart Firefox.
2
  • Worked like a charm. Thanks! Mar 28, 2020 at 0:31
  • 5
    What is this actually doing?
    – Ross
    Jul 26, 2020 at 2:01
7

There is a video here that fixed it for me. The short version for Ubuntu 19, is that I had to open "Startup Applications" and add a new item with the command:

nvidia-settings --assign CurrentMetaMode="nvidia-auto-select +0+0 { ForceFullCompositionPipeline = On }"
3
  • 1
    This helped on Kde Plasma with tearing when dragging windows and also on chrome when scrolling and watching videos.
    – Ralf
    May 25, 2020 at 10:02
  • 2
    If you have a dual monitor setup, you'll need something like: nvidia-settings --assign CurrentMetaMode="DP-0: nvidia-auto-select +1680+0 { ForceFullCompositionPipeline = On }, DVI-I-0: nvidia-auto-select +0+0 { ForceFullCompositionPipeline = On }"
    – Greg Bell
    Jan 3, 2021 at 2:34
  • 1
    I believe you can fix this permanently (without setting a startup app). Open NVIDIA X Server Settings app -> X Server Display Configuration -> click 'Advanced' and then set the "Force Composition Pipeline" and "Force Full Composition Pipeline" checkboxes. Apply. To make permanent click Save X Configuration File. (NB for that to work I had to sudo chmod u+x /usr/share/screen-resolution-extra/nvidia-polkit)
    – Sujimichi
    Apr 24, 2022 at 14:14
5

Make sure that you have hardware acceleration enabled in your browser and supported by your GPU driver.

Google Chrome / Chromium

  1. Go to SettingsAdvancedSystem.
  2. Check Use hardware acceleration when available.

For debug open this URL (paste it into your address bar):

chrome://gpu/

Firefox

  1. Go to PreferencesPerformance.
  2. Un-check Use recommended performance settings.
  3. Check Use hardware acceleration when available.

For debugging, open this URL (paste it into your address bar):

about:support

and look for Graphics info.

Checking GPU drivers

To check what driver is in use open terminal and run:

lspci -v | less

then press /, type VGA and press ENTER.

In the VGA section you'll see your video card model, available drivers and drivers in-use.

Example:

01:00.0 VGA compatible controller: NVIDIA Corporation [GeForce] (rev a1) (prog-if 00 [VGA controller])
(...)
        Kernel driver in use: nvidia
        Kernel modules: nvidiafb, nouveau, nvidia_drm, nvidia

Depending on your graphics card you may want to switch between open source and proprietary driver.

Open source drivers are better for 2D rendering, but have lower performance for 3D acceleration.

Switching drivers

Go to System settingsUpdatesSettingsAdditional drivers.

You should be able to also open this tab via terminal with:

/usr/bin/python3 /usr/bin/software-properties-gtk --open-tab 2

Then you can switch between drivers, then reboot your PC.

Intel graphics

For Intel integrated graphics go to: https://01.org/linuxgraphics/downloads/

NVIDIA screen tearing

You may find these answers useful:

1
  • 1
    For chrome I needed to also enable flag chrome://flags/#enable-accelerated-video-decode
    – vozman
    Dec 3, 2020 at 20:48
3

If you have an Intel driver (check with lspci command) simply create a file:

/etc/X11/xorg.conf.d/20-intel.conf

with content:

Section "Device"
  Identifier "Intel Graphics"
  Driver "intel"
EndSection

Then reboot.

This helped me to remove screen tearing and flickering.

1
  • 1
    I think, we need to run "sudo update-initramfs -u" command after writing that content as suggested. Unless I am wrong but AM I WRONG?
    – Pranav
    May 8, 2020 at 5:24
0

I used to have the same problem and I fixed it just simply by changing the refresh rate in the display settings. Instead of using 60Hz I used 59.96Hz

Display Settings screen shot

0
0

I get fixed by turning off hardware acceleration in browser setting. I experienced youtube tearing every time with every version of anything. My system was Intel i3-4th gen with intel HD graphics.

1
  • Could you be more specific on how to turn off hardware acceleration? Is it specific to a certain browser? May 4, 2022 at 11:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.