Eliminate Screen Tearing with AMD GPU on Ubuntu

While I normally post about Arch Linux, as that’s what I currently use, a friend recently asked how to get rid of his screen tearing issues. He’s using an AMD graphics card, and is running Ubuntu Gnome with open source AMD drivers. Currently for Ubuntu 16.04, no proprietary drivers are being offered for AMD cards (note this method is only intended for open source drivers anyhow). Basing myself off my previous post, I had him setup a configuration file to correct the tearing.

Update: Seems this configuration is effective for many different systems, according to feedback, including Mint, OpenSUSE and Gentoo. I expect it will work with most systems, with the exception of those with hybrid graphics. It’s most likely using Xorg-server 1.19 or Wayland may correct such issues.

In /usr/share/X11/xorg.conf.d/ directory, edit (or create) a file called 20-radeon.conf (look for amdgpu.conf for users with the amdgpu drivers) with the following contents:

Section "Device"
    Identifier "Radeon"
    Driver "radeon"
    Option "TearFree" "on"
EndSection

The key here is the TearFree option. After saving this, restart the X server (running restart gdm can suffice). Be sure to save any work and close applications first, as this will log out any users utilizing the graphical front-end. A modified version of this configuration may also improve performance, by utilizing DRI (direct rendering infrastructure)  3, which has certain improvements for the way the X server handles rendering. Also enabling Glamor (if not enabled already by default) can  improve 2D rendering tasks, performing them through Mesa’s OpenGL libraries. Note older AMD cards will not support Glamor. The enhanced configuration is as follows:

Section "Device"
    Identifier "Radeon"
    Driver "radeon"
    Option "TearFree" "on"
    Option "DRI" "3"
    Option "AccelMethod" "glamor"
EndSection

71 thoughts on “Eliminate Screen Tearing with AMD GPU on Ubuntu

  1. I have Linux Mint 18 KDE with Plasma 5.6 running on a Radeon R9 290. By adding this configuration instead of adjusting the compositor settings, I get better benchmark results with glmark2. All desktop effects are maxed out and it works flawless.

    Like

  2. Ok,let me explain my problem.I have 17inch HP laptop with hybrid(dual amd)grapics.I have AMD Radeon HD 8610G (APU graphics)and AMD Radeon R7 M260 dedicated GPU.Now opensource/libre drivers work without any problem regarding 2D gaming but some of the OpenGL shader options are disabled,so 3D gaming work partially and with downgraded performance(may vary from game to game).Now when i install fglrx or fglrx-updates proprietary drivers,i get faster runtime on some of the games,but there are certain effects that cause screen tearing on 2D games and some effects can cause lags on 3D games(much more lower on number).For example Heroes of Newerth runs better on opensource/libre graphics drivers while with it i can not play DOTA2,and when i install closed source drivers DOTA2 works but HON have some lags on specific graphics effects.The same goes for Frogatto,2D game which works perfect with opensource drivers while closed source ones cause screen tearing on certain places.Now i am using Ubuntu based distros 14.04.x(tested on multiple versions,trying to see which one works better,and x number does matter because later ones(14.04.5)can not accept proprietary drivers for some reason at the moment.Moving away from unity does help,but not that much,and yes,there were in both cases screen tearing on videos that you can find on youtube regarding tests for tearing,and also tearing with windows(but there were on tearing if window would overlap another window application),weird right.Any solution would be helpful.Regards and reply if you need more info!!!

    Like

    • The fglrx drivers are considered broken/deprecated by most modern and up-to-date Linux distributions, which is why you cannot install them. Unfortunately for your setup it’s likely the info I have here will not work, as you have hybrid graphics. Such setups are known to be prone to screen tearing while using Xorg (at least with current release versions). The next update to it is expected to provide better PRIME (i.e. hybrid graphics) support, though the extent of this is beyond my knowledge. Even so, I doubt this version will be available with Ubuntu until 17.04. The only recommendation I can make for you is to check options listed on the Arch Wiki page for ATI/AMD drivers: https://wiki.archlinux.org/index.php/ATI. Alternatively, you could try using a Desktop Environment that uses Wayland, which has been designed to avoid screen tearing entirely. Considering you’re on 14.04 though, I don’t know that you’d be able to install one.
      Best of luck~

      Like

  3. When it comes to Ubuntu 16.04 LTS driver support is horrible .Some distros may not boot at all,some would hang on specific function when installed while some of those may do the same live while doing specific task.Now when it comes to Ubuntu 14.04 distros only problem that i run on is that some of the distros may cause freeze at some point which i still do test on when and why it does happen.All those above(in arch wiki link) stand for opensource drivers while with closed source i seem to be left behind.I may switch back to opensource drivers if freeze problem persist.I did done edit in grub menu https://help.ubuntu.com/community/HybridGraphics and added radeon in tag(GRUB_CMDLINE_LINUX_DEFAULT=”quiet splash XXX.modeset=1″ ) because it seems that freeze error happens when system switch from discrete to integrated card or when battery is low on power.Its still something that needs to be tested further since freeze can happen totally random,even after few hours of work.Now i could be much more detailed regarding these problems but my job is not to troubleshoot the systems so i can not do this whole day,i just get machine to run properly more or less so it could run with tasks needed to be done.I learned my lesson and i will pay more attention on which systems are supported in the future.There is also sound lag but that is whole another story.Regards

    Like

  4. I already had all of that in my config file except for the tear free part… added that and am now watching The Grand Tour in 1080p without tearing nice!

    Like

  5. Awesome easy trick! I had a little tearing on my older laptop with ATI mobility hd 4670. running OpenSuse leap 42.2. This completely eliminated the tearing and now i love my suse system even more. Thanks buddy 🙂

    Like

    • While I can’t say for certain, as I do not have a GPU which can use it, I suspect some of the users who have left comments may be using it. If you try for yourself and it does work, feel free to leave a note here so that I may update the post accordingly.

      Like

      • When I repĺace “Radeon” / “radeon” with “AMDgpu” / “amdgpu” it somewhat seems to work with my HD 7850. There’s still some light tearing, at least with the Flash Player.

        Like

  6. On ubuntu Gnome 16.10 I was stuck in a login loop because of this. Any ideas? The tearing is unbearable since i updated from 16.04(.01). I’m typing this on a laptop with the following (lspci):

    00:00.0 Host bridge: Intel Corporation Haswell-ULT DRAM Controller (rev 09)
    00:02.0 VGA compatible controller: Intel Corporation Haswell-ULT Integrated Graphics Controller (rev 09)
    00:03.0 Audio device: Intel Corporation Haswell-ULT HD Audio Controller (rev 09)
    00:14.0 USB controller: Intel Corporation 8 Series USB xHCI HC (rev 04)
    00:16.0 Communication controller: Intel Corporation 8 Series HECI #0 (rev 04)
    00:1b.0 Audio device: Intel Corporation 8 Series HD Audio Controller (rev 04)
    00:1c.0 PCI bridge: Intel Corporation 8 Series PCI Express Root Port 3 (rev e4)
    00:1c.3 PCI bridge: Intel Corporation 8 Series PCI Express Root Port 4 (rev e4)
    00:1c.4 PCI bridge: Intel Corporation 8 Series PCI Express Root Port 5 (rev e4)
    00:1d.0 USB controller: Intel Corporation 8 Series USB EHCI #1 (rev 04)
    00:1f.0 ISA bridge: Intel Corporation 8 Series LPC Controller (rev 04)
    00:1f.2 SATA controller: Intel Corporation 8 Series SATA Controller 1 [AHCI mode] (rev 04)
    00:1f.3 SMBus: Intel Corporation 8 Series SMBus Controller (rev 04)
    01:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8101/2/6E PCI Express Fast/Gigabit Ethernet controller (rev 07)
    02:00.0 Network controller: Broadcom Limited BCM43142 802.11b/g/n (rev 01)
    03:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Venus PRO [Radeon HD 8850M / R9 M265X] (rev ff)

    TBH. I don’t even know which GPU is actually doing rendering for Gnome, but I suspect it’s the Radeon one, since it’s mostly visible on secondary display (like, an actual diagonal tear line through most of it when scrolling – drives me nuts).

    Like

    • Considering you have hybrid graphics, it’s very likely you’re only using your integrated Intel graphics card. If however your external display is connected via HDMI, then it’s possible you’re only using AMD graphics. As you’re using an Ubuntu derivative, I doubt you have the latest versions of Gnome or xorg server, so I don’t see how it would be possible for you to be using integrated graphics for your main display and discrete for external. The X11 standard doesn’t support this, and (last I checked) xorg server nor Gnome on Wayland do either. You can run this command to find out for sure: glxinfo | grep “OpenGL renderer”
      If it’s running AMD drivers, are you unable to boot simply with the TearFree option added? Or, if it’s intel, you can try adding that to a similar file, except with 20-intel.conf as the name, and contents as follows:

      Section “Device”
      Identifier “Intel Graphics”
      Driver “intel”
      Option “TearFree” “on”
      EndSection

      Like

  7. I tried this before on Ubuntu and it worked perfectly, but now I am on Manjaro Linux KDE with Kernel 4.4 LTS and a Radeon R9 290 using the “video-radeon+” driver. Do I have to change Driver “radeon” to Driver “video-radeon+” to make this take effect on my system? Thanks!

    Like

    • I haven’t used Manjaro before, so I may not be correct with my response. As far as I understand, using the radeon+ driver still falls into the “radeon” category, and that might only change if you’d use the amdgpu driver instead. That being said, Manjaro seems to use configuration files in “/etc/X11/xorg.conf.d/90-mhwd.conf” instead of the one I have listed in this guide. See if changing that works.

      Like

      • Thank you for your reply.

        “/etc/X11/xorg.conf.d/90-mhwd.conf” is a shortcut to “/etc/X11/mhwd.d/radeon.conf”. This file is automatically generated by mhwd with the following content:

        Section “Device”
        Identifier “Device0”
        Driver “radeon”
        Option “AccelMethod” “glamor”
        BusID “PCI:1:0:0”
        EndSection

        Adding <> and <> or changing Identifier from “Device0” to “Radeon” doesn’t seem to change anything.

        On Ubuntu, your “20-radeon.conf”-modification caused a “glmark2” benchmark improvement from 10,000 points to 17,000 points. Now on Manjaro, the benchmark doesn’t exceed 10,000 points with or without the modification.

        I came across your article since I had tearing issues on Ubuntu (I think it was Mint 17.3 Cinnamon) and the benchmark improvement was rather an acceptable side-effect. On Manjaro, tearing never was an issue, but I was hoping to get that performance improvement 🙂

        Like

      • The only options that should affect performance are the usage of glamor, and DRI3. With the xf86-video-ati package (might be named differently for you) on newer versions, this is enabled by default. Considering you’re using Manjaro I’d expect you to be using a newer version. The only reason I would see it not being used is if it wasn’t supported by the hardware, which is unlikely.

        Like

  8. Thanks again. I found this article in the Arch Wiki (https://wiki.archlinux.org/index.php/ATI). So I played around again and I found out that even deleting /etc/X11/xorg.conf.d/90-mhwd.conf and /etc/X11/mhwd.d/radeon.conf had no effect whatsoever, the system started normally without these files. Nevertheless, creating 20-radeon.conf had the expected effects, so it seems that your advice here is also applicable to Arch / Manjaro and my performance problem must be related to something else.

    Like

  9. Adding the parameter:

    “`
    Option “TearFree” “on”
    “`

    Crashed Xorg and prevented it from booting back

    More Info on my machine:
    Linux Kernel 4.9.0
    Debian Stretch OS
    Driver: Xorg AMDGPU (Open source)
    GPU: AMD RX 460

    Like

    • Can you try, instead of using “on” using “true”? I’m seeing some places listing this option with the newer AMDGPU drivers, and I’m curious if that will make a difference. If that is the case, I will update my post accordingly. If not, would you be able to send a link to error logs?

      Like

      • Hello 🙂 Thanks for getting back to me! yes I tried the “true” value and the same exact thing happened,
        Here’s a link to my logs: https://pastebin.com/Kgxz3L0W

        The freezing happened at 23:12:~ at the boot up screen: no new characters appear after this secrtion:

        23:12:08 systemd: Started Update UTMP about System Runlevel Changes.
        23:12:08 systemd: Starting Update UTMP about System Runlevel Changes…
        23:12:08 systemd: Reached target Graphical Interface.
        23:12:08 systemd: Reached target Multi-User System.
        23:12:08 systemd: Started LSB: minidlna server.
        23:12:08 systemd: Started TeamViewer remote control daemon.

        I hope that’s helpful! XD

        Like

      • (This is going to be frustrating because I can’t reply to re-replies). Your log ends at 23:11:45. Is the part you put directly in the comment all you get after that point?

        Like

  10. Thanks a lot you’re a god !!!
    I have an acer netbook (aspire v5-123) with an amd apu E1 that i use to média center that turn on xubuntu 16.04 with kodi krypton for video and deadbeef for audio.
    So in kodi i had tearing with enable or desable vdpau or vaapi. I searched for a solution and today i learn that artefac is tearing and searching for résolve it. I found your post and testing it. It works very well so a big thanks for your fix

    Like

  11. Thank you!

    I am running Lubuntu 16.04 LTS. My APU chipset is “kaveri” and APU name is “Radeon R7 Graphics”. I have been using Lubuntu for many years now because a lot of hardware I use is pretty old (and I like Ubuntu). Lubuntu doesn’t have a default compositor, so I expected screen tearing. And I knew I could always install a compositor if needed. I signed up for Netflix the other day and decided it was time to fix the tearing.

    During my research I came across your post. I think it might have saved me a lot of time. While I have used linux for a number of years I’m not an expert. One other URL that I found to be very useful:
    https://help.ubuntu.com/community/RadeonDriver

    It helped me determine what I actually had installed in my PC. It also showed my that there was “manpage” for my driver “man radeon”. Reading the manpage helped me to understand some of the options (or at least led me to Google other questions I had).

    After reading some other pages I am under the impression that DRI3 is enabled by default on other distros. On mine it was not. Here was the command I used: “cat /var/log/Xorg.0.log | grep -i DRI3”. And the output was: [ 26.707] (==) RADEON(0): DRI3 disabled. So I enabled it using the option you listed. I did not specify “glamor” because according to the manpage it was enabled by default (chipsets after “Tahiti”). The only other thing I did differently was logout and log back in instead of using the command “restart gdm”. I *think* I needed to use “sudo restart lightdm”. But I was impatient and knew logging out would do the trick.

    Thanks again for your post. And sorry for the verbosity, I wanted to layout what I had to do.

    Like

    • I’m glad the extra stuff I put in was also useful! Logging out and back in might work, though it doesn’t normally restart the display manager. None the less, if the results are there you’re good to go!

      Like

  12. In openSUSE Tumbleweed doesn’t work. What works is:
    Filename: 10-amdgpu.conf
    Content:
    Section “OutputClass”
    Identifier “Radeon”
    Driver “amdgpu” #but always will load Radeon, so you can replace it with Radeon
    EndSection

    Like

    • As far as I’m aware the instructions should apply similarly to Debian. It is possible the x.org configuration files are in a different location, though generally most distributions use the same locations. The only other reason this “wouldn’t work” is if you’re using Wayland instead of X.org, though in that case you would not experience screen tearing regardless.

      Like

  13. thanks, but tearing is still more than present in my system Ubuntu 17.10 Radeon R7 260x (my mobo also have a gpu, but no other monitors connected to it. well, i’m not even sure all graphic deivers are working correctly. my system is really slow, and it was not like this with windows 10. i could easily play some demanding games with medium settings. (4gb ram, athlon 64 5000+ x2) it is my old pc, but i’d like to use it like normal when i have to. i’m noob of linux but i can’t figure out what to do (looks like the amd drivers are not yet ready for ubuntu 17.10)

    Like

    • Firstly, I recommend you make sure your system is up-to-date. In the terminal, run sudo apt-get update && sudo apt-get upgrade. Assuming this installed any drivers, reboot your pc and see if that makes any difference. Another solution would be to switch to the Wayland session instead of X.org. Just click the settings gear on the login screen, and choose the option that isn’t Xorg (see this guide for an example: https://itsfoss.com/switch-xorg-wayland/). By design, Wayland shouldn’t experience any screen tearing, though there are still a few minor issues and some applications may not work as expected. That being said, from my experience it has been fairly reliable.

      Like

    • I know you posted this a long time ago but for those having issues with slow system and bad performances on games make sure to install the ” linux-firmware-nonfree ” package that contain firmware for GPU and other good stuff. It’s non-free (wich also means you’ll have to unable non-free in your /etc/apt/source.list configuration file if you’re using a Debian based distro to be able to install it) but it’s required to use most of the recent GPUs.

      Like

  14. Hi. I would like to express my gratitude for this simple yet perfectly working solution to this headache inducing problem.
    I’ve been trying a lot of the usual suggestions you find around the web which involves installing application X or Y, changing this or that, and they never happened to work right, making me waste a lot of time for nothing.
    My problem was with a lubuntu 16 LTS x64 installation on an AMD APU (an A8 or an A10, forgot which since it wasn’t mine) and it worked perfectly well.

    Thanks!

    Liked by 1 person

  15. Ugh, why is this still useful on the latest stable release of Ubuntu, two years later? Why isn’t this the default?

    It worked. Thank you.

    [AMD/ATI] Barts XT [Radeon HD 6870]
    Ubuntu 16.04.4 LTS

    Like

  16. Doing what is written here didn’t work for me. I followed instructions from https://ubuntuforums.org/showthread.php?t=1850578 to obtain xorg.conf file settings. Activate the TearFree option in xorg.conf file, where ever it shows up (it has comment sign # in front and set the value to “True”). Copy the xorg.conf to /etc/X11/ and reboot or restart X server. Check the tearing with youtube tearing test and it should be fine.

    Like

  17. Just fixed my media PC with this file thanks so much as was so annoying after installing a new clean version of Peppermint with Kodi 18 everything was working great till I started watching local or streaming video via Kodi & had a permanent tear a third of the way down the screen 😦 I was about to go buy a newer video card so you saved me some of my hard earned cash & enabled me to get a bit more life out of my video card thanks again 🙂

    Like

Leave a comment