Screen tearing in Ubuntu with Nvidia/Intel graphics

89,796

Solution 1

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

Section "Device"
   Identifier  "Intel Graphics"
   Driver      "intel"
   Option      "TearFree"    "true"
EndSection

That should fix everything.

Source is https://wiki.archlinux.org/index.php/Intel_graphics#Tear-free_video

Note: This only works if you're using bumblebee.


Note from comments: Since 10.10 the config file directory is now /usr/share/X11/xorg.conf.d

Starting from Ubuntu 16.04 LTS * you can use the following script to switch between NVIDIA and INTEL's graphics cards and besides it corrects the video/screen tearing on INTELs environment: https://github.com/bauca/graphics-switcher

Solution 2

Using Wayland on Ubuntu 18.04 gets rid of all tearing for me.

You can enable it by clicking on the cog on the password screen and selecting "Ubuntu on Wayland".

Share:
89,796

Related videos on Youtube

smit3119
Author by

smit3119

Updated on September 18, 2022

Comments

  • smit3119
    smit3119 almost 2 years

    I really hope someone here can help, because I'm very close to giving up and moving back to Windows. I have an MSI GT70 Dominator with an i7-4710MQ 2.5 GHz, Intel HD 4000 (I'm pretty sure) integrated graphics card, and a GeForce GTX 970M/PCle/SSE2 dedicated graphics card. I started with a stock install of Ubuntu 14.04.3, and there is terrible screen tearing in every program I've tried, from Chrome to Minecraft to L4D2. I'm using the proprietary Nvidia drivers (version 346.82 from nvidia-346) because I've heard they get the best performance. By screen tearing, I mean that it's as though vsync is off- when something is moving, you can see horizontal lines where the frames are off.

    I've tried going to Nvidia X Server Settings to turn on "Sync to VBlank", but the problem persists.

    I tried installing Bumblebee as well, but when using the optirun command to open a browser and going to a Youtube video, the screen tearing is still there.

    I've also tried going to usr/share/lightdm/lightdm.conf.d and editing the 5-xserver-command.conf to have the -bs option.

    After some advice from reddit, I upgraded to 15.04, but that didn't work.

    I tried setting my Nvidia power settings to high, no luck.

    I've tried Compton and Compiz, neither did squat.

    In nvidia-settings, the X Server Display Configuration, there is no screen displayed in "Layout", X Screen 0 is the only thing selectable in "Model", and whenever I try to Save to X Configuration File, it says "Failed to generate X config file!"

    I've tried this link, nada.

    I've rebooted after every attempted fix. I really want to use Ubuntu, but if this screen tearing persists, I might just have to go back to Windows, it's horribly distracting. Please, please, please help me. Any help anyone can give will be greatly appreciated, thanks!

    • Admin
      Admin almost 8 years
      tbh: How do I create the file /etc/X11/xorg.conf.d/20-intel.conf ?
    • Michal Polovka
      Michal Polovka almost 8 years
      Open your terminal and type: sudo gedit /etc/X11/xorg.conf.d/20-intel.conf. Then save the file normally.
  • smit3119
    smit3119 almost 9 years
    I used a variant of this. I added the "TearFree" option to /etc/X11/xorg.conf instead, under the Intel device section. Thanks!!
  • jarno
    jarno over 8 years
    Also works for bare Intel graphics (here 82Q963/Q965 Integrated Graphics Controller (rev 02)) with some software: Tearing stops in Firefox, but continues in Chromium.
  • Josh
    Josh over 8 years
    Note that since 10.10 the config file directory is now /usr/share/X11/xorg.conf.d (wiki.ubuntu.com/X/Config).
  • Dan Ross
    Dan Ross over 8 years
    Option "TearFree" "false" lol why does this setting even exist?
  • Hieu
    Hieu over 8 years
    Confirmed this works for Lubuntu 15.10 with intel graphic. I don't understand why you said This only works if you're using bumblebee
  • Riki137
    Riki137 about 8 years
    confirmed this works with nvidia driver after editing /etc/X11/xorg.conf
  • Vladimir Iliev
    Vladimir Iliev about 8 years
    Works on Linux Mint 17.03 as well! Thank you very much!
  • MttJocy
    MttJocy almost 8 years
    @DanRoss It's important to bear in mind that the X server has to deal with an array of different hardware, kernel and driver configurations thus containing numerous workarounds for various bugs originating elsewhere. Workarounds are however tricky as they can be the cause of issues with other system configurations that do things correctly and thus don't need them and testing every possible system configuration is impossible. Thus there are good reasons why it is important to be able to selectively disable workarounds and also allow developers to test fixes to underlying code.
  • Ionut-Cristian Florescu
    Ionut-Cristian Florescu over 7 years
    This worked on Linux Mint 18 (Cinnamon) too, on a laptop with Intel HD 4400 & Nvidia 750M.
  • Easton Bornemeier
    Easton Bornemeier almost 7 years
    This solution caused me to hang in boot of Ubuntu 16.04
  • Arkadiusz Wieczorek
    Arkadiusz Wieczorek almost 6 years
    Under Ubuntu 18.04.1 LTS and Intel HD 620, it works perfectly!
  • Prinzhorn
    Prinzhorn about 4 years
    Anyone got this working with 20.04? It worked perfectly in 19.10. With 20.04 I get weird artifacts and have to disable it again.