AMD graphics

From LinuxReviews
Jump to navigationJump to search

AMD graphics cards and APUs are generally very well supported by GNU/Linux distributions.

GNU/Linux Support

There are two kernel modules for AMD graphics cards: radeon and ampgpu. Very old cards can only use radeon, all newer cards should use amdgpu. Some older cards and APUs can use both but will not get some features depending on which is used. Hardware video decoding is not supported when using the amdgpu kernel module on GCN gen1 and gen2 cards (Radeon HD 77xx–7900 Series) but Vulkan is - but Vulkan is not supported when using the radeon kernel module on those cards.

User-space support for OpenGL and Vulkan are provided by the Mesa graphics library. The radeonsi driver provides OpenGL 4.6 support and the RADV driver provides Vulkan 1.2 support. There are two Xorg drivers available: radeon and amdgpu. Use the one which is named the same as the kernel module you are using (probably amdgpu unless it is a very old GPU or APU).

HOWTOs

Avoiding Screen Tearing

Screen tearing can generally be avoided by using a compositing window manager. That does not solve tearing when a display is rotated and it does not solve tearing when the display manager is not doing compositing. Compositing does have a performance overhead which is significant on older APUs.

Both the amdgpu[1] and the radeon[2] drivers support an option called TearFree. Add either of these configuration files to a /etc/X11/xorg.conf.d/ folder (will exist on most distributions but you have to created it on Ubuntu and a few others):

File: /etc/X11/xorg.conf.d/20-amdgpu.conf
Section "Device"
   Identifier  "AMD Graphics"
   Driver      "amdgpu"
   Option      "TearFree"  "true"
EndSection

If you're using something rather old like a HD7850 you're using the "radeon" driver and you need:

File: /etc/X11/xorg.conf.d/20-radeon.conf
Section "Device"
   Identifier  "AMD Graphics"
   Driver      "radeon"
   Option      "TearFree"  "true"
EndSection

Overclocking

See HOWTO undervolt the AMD RX 4XX and RX 5XX GPUs. It includes information on overclocking.

Enabling The Experimental ACO Shader Compiler

Mesa 20 has a ACO shader compiler for Vulkan which is faster than the default LLVM shader compiler. You can enable it by setting export RADV_PERFTEST=aco

Troubleshooting

Totally Messed Up Colors In Some Applications

Some software, primarily the Chromium web browser, has issues with 10-bit colors. Chromium will look all messed up if you enable 10-bit color:

Chromium-can-not-do-10bit-color-on-linux.png
The Chromium browser on a desktop where 10-bit color is enabled. It is one of the few programs with this particular problem.

This is not only a problem if you enable 10-bit color on your desktop. It is also a problem with Chromium, and perhaps other software, if the Mesa version defaults to 10-bit color on certain GLX and EGL operations[3] (in later Mesa versions). This behavior makes Chromium show videos with all messed up colors[4] if the Chromium browser is built with VAAPI patches for hardware accelerated video playback and the video playback is using this feature.

Chromium-vaapi-messed-up.jpg
Chromium playing a video using Mesa 20 and VAAPI for hardware accelerated video playback.

The above video playback problem can be solved by creating a $HOME/.drirc file with the following contents:

<?xml version="1.0" standalone="yes"?>
<driconf>
    <!-- Please always enable app-specific workarounds for all drivers and
         screens. -->
    <device driver="radeonsi">
        <application name="Chromium" executable="chromium-freeworld">
            <option name="allow_rgb10_configs" value="false"/>
        </application>
    </device>
    <device driver="radeonsi">
        <application name="Chromium" executable="chromium-browser">
            <option name="allow_rgb10_configs" value="false"/>
        </application>
    </device>
</driconf>

You can, alternatively, put that in a file in /usr/share/drirc.d to make it system-wide.

Notes


Add your comment
LinuxReviews welcomes all comments. If you do not want to be anonymous, register or log in. It is free.