Screen Tearing on Ubuntu Xorg 20.04 with Intel Graphics

28,179

Solution 1

This didn't work for me, unfortunately. I was able to fix with modifying my /etc/X11/xorg.conf.d/20-intel-graphics.conf file to include DRI3, which I found here

Section "Module"
    Load "dri3"
EndSection

Section "Device"
    Identifier  "Intel Graphics"
    Driver      "intel"
    Option      "DRI"   "3"
EndSection

Solution 2

I resolved this issue by replacing /etc/X11/xorg.conf.d/20-intel.conf with /usr/share/X11/xorg.conf.d/20-intel.conf containing the following configuration:

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

I have no more tearing and I am able to use waylandfree Ubuntu. :)

Hope this helps anyone!

P.S.: I tested the tearing using this YouTube video (epilepsy warning!) and moving windows around as if I had a stroke.

Solution 3

None of the above worked for me, but I found something simple that did:

xrandr --output HDMI3 --transform 1,0,-1,0,1,-1,0,0,1

This shifts the screen one pixel down and one to the right. I do lose one row and one column of pixels, but it prevents the mouse pointer from hitting the left or top edges, which is what seems to trigger this behavior in my case.

Share:
28,179

Related videos on Youtube

René Jörg Spies
Author by

René Jörg Spies

I am a young dude from germany and I <3 to code. Currently working wholeheartedly on the myAudi App for Android!

Updated on September 18, 2022

Comments

  • René Jörg Spies
    René Jörg Spies almost 2 years

    I am fairly new to Linux and Ubuntu. Just swapped it with Windows 10 on my ASUS ZenBook S13 yesterday.

    I noticed a LOT of screen tearing, not only in videos with fast moves but even when I hover over files in the archive manager or scroll in Firefox (yes, I have already activated the Firefox internal VSync option).

    I tried a few things such as Tear Free true in the 20-intel.conf file. This option fixed my tearing issue and brought up another, bigger issue. Just look what it does to my desktop. But these are only on my desktop, not on other windows like the browser and they vary, sometimes they are 3.

    Wayland seems to fix this issue too, but there are several reasons why I don't want to use Wayland, such as no fractional scaling, worse anti-aliasing and a weird bug with the cursor where it is double the size on system windows like the Terminal or Settings.

    When I activate other options in the 20-intel.conf file, such as Triple buffer true or Accel method uxa, I am unable to log in, only when I use Wayland.

    My expectation is, that I can use normal Ubuntu (no Wayland) without any screen tearing.

    I have provided information about my VGA controller and the current state of my 20-intel.conf file below.

    00:02.0 VGA compatible controller: Intel Corporation UHD Graphics 620 (Whiskey Lake) (prog-if 00 [VGA controller])
            DeviceName: VGA
            Subsystem: ASUSTeK Computer Inc. UHD Graphics 620 (Whiskey Lake)
            Flags: bus master, fast devsel, latency 0, IRQ 146
            Memory at b0000000 (64-bit, non-prefetchable) [size=16M]
            Memory at a0000000 (64-bit, prefetchable) [size=256M]
            I/O ports at 3000 [size=64]
            Expansion ROM at 000c0000 [virtual] [disabled] [size=128K]
            Capabilities: <access denied>
            Kernel driver in use: i915
            Kernel modules: i915
    

    20-intel.conf:

    Section "Device"
        Identifier "Intel Graphics"
        Driver "intel"
    #   Option "AccelMethod" "uxa"
        Option "TearFree" "true"
    #   Option "TripleBuffer "true"
    EndSection
    
  • René Jörg Spies
    René Jörg Spies about 4 years
    Wait, don't mind this answer for now. I suspect the tearing issue comes with the fractional scaling I am using. When I turn that on, I have tearing again and the tearing is removed when fractional scaling is turned off. Let me investigate on this.
  • René Jörg Spies
    René Jörg Spies about 4 years
    Ok, just found out that I have no tearing without fractional scaling at all and no tearing with fractional scaling only when I don't move the mouse cursor. So, when I move my cursor, my screen just goes /////\\\////.
  • René Jörg Spies
    René Jörg Spies about 4 years
    The tearing occurs only when I scale my display to something rather odd like 125% using fractional scaling. It disappears when I scale it to 100% with activated fractional scaling.
  • René Jörg Spies
    René Jörg Spies about 4 years
    Alright, I am tired of testing now (because I need to reboot every time I change the config file and my login password is 23 characters long lol). I will just look if I can file some bugfile somewhere and see what happens (I also found out a bug with the fractional scaling thing where it scales my screen down to 50 or 25% because of Canonicals rather weak programming.)
  • stz184
    stz184 almost 4 years
    It works like a charm on my ThinkPad L480 with Intel Graphics 620.
  • NicolasSmith
    NicolasSmith almost 4 years
    It works fine on Ubuntu Mate 20.04 with Intel UHD 520.
  • Eren Seymen
    Eren Seymen over 3 years
    It works fine on Xubuntu 20.04 with Intel HD Graphics 4000.
  • Mikhail
    Mikhail over 3 years
    Hm, I don't have this file. I don't even see xorg.conf.d dir in /etc/X11.
  • Jkasnese
    Jkasnese over 3 years
    Me neither. It was edited by Jaroslav. Here is on /etc/X11/xorg.conf
  • Raceimaztion
    Raceimaztion over 3 years
    I added my own xorg.conf in /etc/X11 with this, and it fixed the screen tearing!
  • Jobu
    Jobu almost 3 years
    This does stop the tearing for me, but break a few applications. Firefox needs hardware acceleration disabled to work. Signal and others, just don't. As for @Rene, the location for my files was in /usr/share/X11/xorg.conf.d.
  • Fuseteam
    Fuseteam over 2 years
    stopped tearing for me, for some reason i had am 10-amdgpu.conf in /usr/share/X11/xorg.conf.d i just overwrote it's contents and it solved it (made a backup ofcourse)
  • Bach
    Bach over 2 years
    It stopped tearing, but no video application works (Zoom, cheese). It also broke vscode, but I could fix this by disabling hardware acceleration.
  • memoricab
    memoricab over 2 years
    Solved tearing for me as well on Debian. I never noticed tearing until I played some 4k videos on my 4k TV via HDMI. Weirdly I have intel chipset but my Debian runs 10-amdgpu.conf. I had a lot of trouble adding 20-intel.conf but whole my desktop env was crashed and system was prompting only command line after reboot. Then I did like @Fuseteam and solved. Why? Just, why does it take from 10-amdgpu.conf?
  • Admin
    Admin almost 2 years
    If "DRI" "3" is enabled without "TearFree" "true", there is still viaible tearing on i5-6500. I have to load dri3 and use both options to eliminate tearing completely.