AMD graphics

From LinuxReviews
Jump to navigationJump to search
Amdlogo.png

AMD graphics cards and APUs are generally very well supported by GNU/Linux distributions. The avast majority will work fine out of the box. Some older AMD cards require special kernel parameters to enable features like Vulkan support. Screen tearing can be a problem in setups. That can problem be fixed using a X configuration file if it is an issue.

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

Choosing The "Right" Kernel Driver

You will not have to care in the vast majority of cases, amdgpu is the right choice for all newer graphics cards and the kernel will choose that automatically. There are two generations of olders AMD graphics cards and APUs where amdgpu is optional and radeon is the default: "Southern Islands" and "Sea Islands".

"Southern Islands" is a special case where hardware video decoding will only work with radeon while Vulkan will only work if amdgpu is used.

Which you kernel prefer can be selected by using kernel boot parameters OR a module configuration file /etc/modprobe.d/amdgpu.conf

Graphics Card Family Names APUs/GPUs parameters forcing amdgpu
kernel amdgpu.conf
Southern Islands CAPE VERDE,
PITCAIRN,
TAHITI,
OLAND,
HAINAN
HD7750-HD7970, HD8550M-HD8790M
R9 270, R7 240, R7 250, R9-280, R9 370X
radeon.si_support=0 amdgpu.si_support=1 options radeon si_support=0
options amdgpu si_support=1
Sea Islands BONAIRE,
KABINI,
MULLINS,
KAVERI,
HAWAII
HD7790, HD8180-HD8400
R7 260, R9 290
AMD E1-6010, Athlon 5350, ++
radeon.cik_support=0 amdgpu.cik_support=1 options radeon cik_support=0
options amdgpu cik_support=0

The x.org Feature Matrix for Free Radeon Drivers page has a list of code-names for AMD graphics chips.

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.