Intel screen tearing - Ubuntu 18.04

37,625

Solution 1

Do

sudo mkdir -p /etc/X11/xorg.conf.d/
sudo vim /etc/X11/xorg.conf.d/20-intel.conf

Then paste this to the file

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

Reboot

Source

Solution 2

If your laptop is quite new (I have Broadwell i7 for example) you can remove the Intel driver:

sudo apt purge xserver-xorg-video-intel

as the actual driver used is modesetting.

See more about here: ubuntuforums.org.

Doing:

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

will block you from using nvidia proprietary drivers as nvidia-prime is based on modesetting.

But for me, removing xserver-xorg-video-intel fixed the intel tearing issue. If you have Ubuntu 18.04.2, or already moved to Hardware Enablement stack, the command to remove intel driver is:

sudo apt purge xserver-xorg-video-intel-hwe-18.04

As a last resort, you can try to put in /etc/X11/xorg.conf.d/20-intel.conf

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

This didn't affect my nvidia switching capabilities, but I don't use it since I don't need it.

Solution 3

Setting the Intel driver options TearFree and TrippleBuffer to true worked for me, until I had to remove xserver-xorg-video-intel as suggested in these answers to run the latest Google Earth and other GL apps.

Switching to modesetting brought back screen tearing though, and I couldn't find a fix. Other issues have been reported too. For anyone else who's stuck: I ended up reinstalling xserver-xorg-video-intel and using an Intel config that works for everything:

/etc/X11/xorg.conf.d/20-intel-graphics.conf (create if needed):

Section "Module"
   Load "dri3"
EndSection

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

   # Required by Google Earth, other modern GL apps:
   Option      "DRI"   "3"

   # Fixes screen tearing:
   Option      "TripleBuffer" "true"
   Option      "TearFree"     "true"
EndSection

Restart. Works on Ubuntu 18.04 + Intel HD Graphics 4000 (IVB GT2). Whatever performance issues this causes aren't noticable for me.

Share:
37,625

Related videos on Youtube

Scoon McPherson
Author by

Scoon McPherson

Updated on September 18, 2022

Comments

  • Scoon McPherson
    Scoon McPherson almost 2 years

    I have a bad screen tearing issue with 18.04. Config posted below. I'm not sure how to fix this issue as I've googled it several times and there doesn't seem to be much information relating to 18.04 on this issue. Thanks in advance for your answers.

    ubuntu@ubuntu:/etc$ inxi -F
    System:    Host: ubuntu Kernel: 4.15.0-20-generic x86_64 bits: 64 Desktop: Gnome 3.28.1 Distro: Ubuntu 18.04 LTS
    Machine:   Device: laptop System: HP product: HP ProBook 640 G2 serial: N/A
               Mobo: HP model: 80FD v: KBC Version 22.64 serial: N/A UEFI: HP v: N76 Ver. 01.06 date: 11/01/2016
    Battery    BAT0: charge: 17.9 Wh 42.8% condition: 41.9/41.9 Wh (100%)
    CPU:       Dual core Intel Core i5-6200U (-MT-MCP-) cache: 3072 KB
               clock speeds: max: 2800 MHz 1: 1292 MHz 2: 1131 MHz 3: 1061 MHz 4: 1070 MHz
    Graphics:  Card: Intel HD Graphics 520
               Display Server: x11 (X.Org 1.19.6 ) driver: i915 Resolution: [email protected]
               OpenGL: renderer: Mesa DRI Intel HD Graphics 520 (Skylake GT2) version: 4.5 Mesa 18.0.0-rc5
    Audio:     Card Intel Sunrise Point-LP HD Audio driver: snd_hda_intel Sound: ALSA v: k4.15.0-20-generic
    Network:   Card-1: Intel Ethernet Connection I219-V driver: e1000e
               IF: enp0s31f6 state: down mac: 40:b0:34:13:1c:f0
               Card-2: Intel Wireless 8260 driver: iwlwifi
               IF: wlp2s0 state: up mac: 34:f3:9a:dd:f7:02
    Drives:    HDD Total Size: 515.8GB (1.2% used)
               ID-1: /dev/sda model: HGST_HTS725050A7 size: 500.1GB
               ID-2: USB /dev/sdb model: Cruzer_Switch size: 15.7GB
    Partition: ID-1: / size: 3.8G used: 1.3G (37%) fs: overlay dev: N/A
    RAID:      No RAID devices: /proc/mdstat, md_mod kernel module present
    Sensors:   System Temperatures: cpu: 38.5C mobo: 0.0C
               Fan Speeds (in rpm): cpu: N/A
    Info:      Processes: 220 Uptime: 1:04 Memory: 2131.1/7636.1MB Client: Shell (bash) inxi: 2.3.56 
    
  • LondonRob
    LondonRob almost 5 years
    Maybe worth noting that this source for this tip says that this option "may increase memory allocation considerably and reduce performance". I've certainly experienced that. Much worse than the screen tearing.
  • Bas Lamerichs
    Bas Lamerichs over 4 years
    THIS is the solution for 2 of my desktop pcs. one of them is very very old (2005) and has a Intel Integrated graphics card, but this solution also applies for that old system! the other is newer and has Intel HD. The performance will reduce on slower machines, results will be visible as stuttering in games for instance, it takes around 30% of the performance away. but it DOES work !! thanks
  • Antony Thomas
    Antony Thomas over 4 years
    modesetting does not have a "tearfree" option
  • Renan Cunha
    Renan Cunha over 4 years
    "It takes around 30% of the performance away". What is this performance?
  • Geppettvs D'Constanzo
    Geppettvs D'Constanzo about 4 years
    Your solution helped me to fix this: askubuntu.com/questions/1222084/…, Thank you very much.
  • Peter Dam
    Peter Dam about 4 years
    Thank you, though this answer seems blunt it was an useful reminder for me and it actually fixed my problem.
  • kontextify
    kontextify over 3 years
    Installing drivers from a random PPA should be a last resort. At least mention what it is and what it does in your answer. A lot of people will just copy paste this without thinking.
  • kontextify
    kontextify over 3 years
    WARNING: switching from intel to modesetting actually brought back screen tearing for me, and there are other issues too.
  • Tobia
    Tobia over 3 years
    For me, intel driver and TearFree option are the way to go. Thank you