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.

Overview

Family GFX core Display Core ISA Code-name Brands OpenGL Vulkan OpenCL
R600 GFX3 DCE 2 VLIW5 R600, RV610, RV630, RV620, RV635, RV670, RS780, RS880 HD2400 - HD4290 Dialog-ok.svg Dialog-cancel.svg Dialog-cancel.svg
R700 GFX3 VLIW5 DCE 3.1 RV770 HD4330 - HD5165, HD5xxV
DCE 3.2 RV710, RV730, RV740
Evergreen GFX4 VLIW5 DCE 4 CEDAR, REDWOOD, JUNIPER, CYPRESS HD5430 - HD5970, all HD6000 not listed under Northern Islands, HD7350
DCE 4.1 PALM (Wrestler/Ontario), SUMO (Llano), SUMO2 (Llano)
Northern Islands GFX5 VLIW4 DCE 5 BARTS, TURKS, CAICOS, CAYMAN HD6450, HD6570, HD6670, HD6790 - HD6990, HD64xxM, HD67xxM, HD69xxM, HD7450 - HD7670
DCE 5.1 ARUBA (Trinity/Richland),
Southern Islands GFX6 GCN 1 DCE 6 CAPE VERDE, PITCAIRN, TAHITI, HD7750 - HD7970,

R9 270, R9-280, R7 240, R7 250, HD 8000M-series, R5 330-R7 350, FirePro W600, FirePro W4100 FirePro W5000, FirePro W7000, FirePro W8000, FirePro W9000

Dialog-ok.svg Dialog-ok.svg 1.2 (Mesa Clover)
DCE 6.4 OLAND, HAINAN
Sea Islands GFX7 GCN DCE 8.1 KAVERI HD7790, R7 260, R9 290, R9 295X2, R9 290X, FirePro W2100, FirePro W5100, FirePro W8100, FirePro W9100, FirePro W4300
DCE 8.2 BONAIRE
DCE 8.3 KABINI, MULLINS
DCE 8.5 HAWAII Dialog-ok.svg 2.0
(ROCm)
Volcanic Islands GFX8 GCN DCE 10 TONGA FIJI R9 285, R9 380, R9 Nano, R9 Fury X, FirePro W7100 Dialog-ok.svg 1.2 (Mesa Clover)
DCE 11 CARRIZO, STONEY, ICELAND/TOPAZ
DCE 11.2 POLARIS10, POLARIS11, POLARIS12, VEGAM RX 460-480, RX 560-590 Dialog-ok.svg 2.0
(ROCm)
Vega GFX9 GCN 5 DCE 12.0 VEGA10, VEGA12 Vega 3, 6, 8, RX Vega 10-11, RX Vega 56, RX Vega 64, Radeon VII
DCE 12.1 VEGA20
DCN 1.0 RAVEN Athlon 200GE-240GE, Athlon 3000G, Ryzen 3 2200G, Ryzen 5 2400G Dialog-ok.svg 1.2 (Mesa Clover)
ARCTURUS[1]
DCN 2.1 RENOIR Ryzen 3 4300G & 4350G, Ryzen 5 4600 & 4650G, Ryzen 7 4700G & 4750G
Navi GFX10 RDNA DCN 2.0 NAVI10, NAVI12, NAVI14 Dialog-ok.svg 2.0
(ROCm)
GFX10.3[2] RDNA2 DCN 3.0[3]
  • Sienna Cichlid
  • Navy Flounder[4][5]
  • Dimgrey Cavefish
Blond-anime-girl-with-red-questionmark.png
Vangogh[6] GFX10.3[2] RDNA2 DCN 3.0 Vangogh Blond-anime-girl-with-red-questionmark.png Blond-anime-girl-with-red-questionmark.png Blond-anime-girl-with-red-questionmark.png Blond-anime-girl-with-red-questionmark.png

GNU/Linux Support

There are two kernel modules for AMD graphics cards: radeon and ampgpu. Really old cards can only use radeon. All fairly recent (2010+) cards can use the amdgpu driver

Vulkan is supported on all GCN cards when using the amdgpu kernel driver. The deprecated radeon kernel driver can't into Vulkan.

Support for hardware video decoding on older GCN gen one and two cards (Southern Islands) with the amdgpu driver did not arrive until Linux 5.9. Those with older AND graphics cards will have to choose between hardware video decoding OR Vulkan support if they use an earlier kernel.

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.

Hardware Video Decoding / Encoding

Applications like OBS Studio, Jellyfin, mpv and other video video software can use VAAPI to utilize the hardware video decoding and encoding capabilities on AMD hardware. You need the libva library to make it work. The vainfo tool from the libva-utils package can tell you what your hardware does and does not support.

AMD Hardware Video Decoding / Encoding Support
ARUBA (Trinity/Richland), TAHITI CAPE VERDE, PITCAIRN, OLAND KAVERI, KABINI, MULLINS, BONAIRE, HAWAII TONGA, FIJI CARRIZO STONEY POLARIS10, POLARIS11, POLARIS12, VEGAM VEGA10, VEGA12 VEGA20 RAVEN NAVI10, NAVI14, RENOIR
Decoder
Hardware
UVD3.2 UVD4.0 UVD4.2 UVD5.0 UVD6.0 UVD6.2 UVD6.3 UVD7.0 UVD7.2 VCN1.0 VCN2.0
Encoder
Hardware
VCE1.0 VCE2.0 VCE3.0 VCE3.1 VCE3.4 VCE3.4 VCE4.1 VCE4.2 VCN1.0 VCN2.0
MPEG-2 Dialog-ok.svg Dialog-ok.svg Dialog-ok.svg Dialog-ok.svg Dialog-ok.svg Dialog-ok.svg Dialog-ok.svg Dialog-ok.svg Dialog-ok.svg Dialog-ok.svg Dialog-ok.svg
H264/MPEG-AVC Dialog-ok.svg 2K Dialog-ok.svg 2K Dialog-ok.svg 2K Dialog-ok.svg 4K Dialog-ok.svg 4K Dialog-ok.svg 4K Dialog-ok.svg 4K Dialog-ok.svg 4K Dialog-ok.svg 4K Dialog-ok.svg 4K Dialog-ok.svg 4K
VC-1 Construction.png Decode only Construction.png Decode only Construction.png Decode only Construction.png Decode only Construction.png Decode only Construction.png Decode only Construction.png Decode only Construction.png Decode only Construction.png Decode only Construction.png Decode only Construction.png Decode only
JPEG Dialog-cancel.svg Dialog-cancel.svg Dialog-cancel.svg Dialog-cancel.svg Dialog-ok.svg Dialog-ok.svg Dialog-ok.svg Dialog-ok.svg Dialog-ok.svg Dialog-ok.svg Dialog-ok.svg
VP8 Dialog-cancel.svg Dialog-cancel.svg Dialog-cancel.svg Dialog-cancel.svg Dialog-cancel.svg Dialog-cancel.svg Dialog-cancel.svg Dialog-cancel.svg Dialog-cancel.svg Dialog-cancel.svg Dialog-cancel.svg
HEVC Dialog-cancel.svg Dialog-cancel.svg Dialog-cancel.svg Dialog-cancel.svg Construction.png Decode only, 4K Construction.png Decode only, 4K Dialog-ok.svg 4K Dialog-ok.svg 4K Dialog-ok.svg 4K Dialog-ok.svg 4K Dialog-ok.svg 4K
HEVC 10-bit Dialog-cancel.svg Dialog-cancel.svg Dialog-cancel.svg Dialog-cancel.svg Dialog-cancel.svg Construction.png Decode only, 4K Construction.png Decode only, 4K Dialog-ok.svg Dialog-ok.svg Dialog-ok.svg Dialog-ok.svg
HEVC 12-bit Dialog-cancel.svg Dialog-cancel.svg Dialog-cancel.svg Dialog-cancel.svg Dialog-cancel.svg Dialog-cancel.svg Dialog-cancel.svg Dialog-cancel.svg Dialog-cancel.svg Dialog-cancel.svg Dialog-cancel.svg
VP9 Dialog-cancel.svg Dialog-cancel.svg Dialog-cancel.svg Dialog-cancel.svg Dialog-cancel.svg Dialog-cancel.svg Dialog-cancel.svg Dialog-cancel.svg Dialog-cancel.svg Construction.png Decode only, 4K Construction.png Decode only, 4K
VP9 10-bit Dialog-cancel.svg Dialog-cancel.svg Dialog-cancel.svg Dialog-cancel.svg Dialog-cancel.svg Dialog-cancel.svg Dialog-cancel.svg Dialog-cancel.svg Dialog-cancel.svg Construction.png Decode only, 4K Construction.png Decode only, 4K
VP9 12-bit Dialog-cancel.svg Dialog-cancel.svg Dialog-cancel.svg Dialog-cancel.svg Dialog-cancel.svg Dialog-cancel.svg Dialog-cancel.svg Dialog-cancel.svg Dialog-cancel.svg Dialog-cancel.svg Dialog-cancel.svg
AV1 Dialog-cancel.svg Dialog-cancel.svg Dialog-cancel.svg Dialog-cancel.svg Dialog-cancel.svg Dialog-cancel.svg Dialog-cancel.svg Dialog-cancel.svg Dialog-cancel.svg Dialog-cancel.svg Dialog-cancel.svg
EVC Dialog-cancel.svg Dialog-cancel.svg Dialog-cancel.svg Dialog-cancel.svg Dialog-cancel.svg Dialog-cancel.svg Dialog-cancel.svg Dialog-cancel.svg Dialog-cancel.svg Dialog-cancel.svg Dialog-cancel.svg
VVC Dialog-cancel.svg Dialog-cancel.svg Dialog-cancel.svg Dialog-cancel.svg Dialog-cancel.svg Dialog-cancel.svg Dialog-cancel.svg Dialog-cancel.svg Dialog-cancel.svg Dialog-cancel.svg Dialog-cancel.svg

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 in kernels prior to 5.9 while Vulkan will only work if amdgpu is used. Linux 5.9+ supports both on "Southern Islands" cards.

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[7] and the radeon[8] 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

ACO is enabled by default in Mesa 20.2.0 and newer. You do NOT need to do anything to enable it on Mesa 20.2+. Force-enabling ACO on Mesa 20.2 produces a informative message telling you that it is the default.

Unlocking Manual Control Over Power Features

Snubbelrisk.jpg
Warning: You should not do this unless you know what you are doing. And you don't.

We realize that you will do it anyway. That's fine, it's your machine. Don't forget that we tried to warn you and you didn't listen if something bad happens.

The secret amdgpu.ppfeaturemask amdgpu module parameter can be (ab)used to unlock full control over features AMD won't let you have by default. This should be added to either a module configuration file like /etc/modprobe.d/80-amdgpu.conf with

File: /etc/modprobe.d/80-amdgpu.conf
options amdgpu ppfeaturemask=0xffffffff

or to the kernel command line as a boot parameter in the GRUB_CMDLINE_LINUX= variable in /etc/sysconfig/grub that says:

amdgpu.ppfeaturemask=0xffffffff

The 0xffffffff value unlocks everything. You do not need to unlock everything, ppfeaturemask supports several other values. amd_shared.h[9] story as of Linux git September 2020 is:

enum PP_FEATURE_MASK {
        PP_SCLK_DPM_MASK = 0x1,
        PP_MCLK_DPM_MASK = 0x2,
        PP_PCIE_DPM_MASK = 0x4,
        PP_SCLK_DEEP_SLEEP_MASK = 0x8,
        PP_POWER_CONTAINMENT_MASK = 0x10,
        PP_UVD_HANDSHAKE_MASK = 0x20,
        PP_SMC_VOLTAGE_CONTROL_MASK = 0x40,
        PP_VBI_TIME_SUPPORT_MASK = 0x80,
        PP_ULV_MASK = 0x100,
        PP_ENABLE_GFX_CG_THRU_SMU = 0x200,
        PP_CLOCK_STRETCH_MASK = 0x400,
        PP_OD_FUZZY_FAN_CONTROL_MASK = 0x800,
        PP_SOCCLK_DPM_MASK = 0x1000,
        PP_DCEFCLK_DPM_MASK = 0x2000,
        PP_OVERDRIVE_MASK = 0x4000,
        PP_GFXOFF_MASK = 0x8000,
        PP_ACG_MASK = 0x10000,
        PP_STUTTER_MODE = 0x20000,
        PP_AVFS_MASK = 0x40000,
};

You can, in other words, use ppfeaturemask to enable control over just a few features or a single feature like PP_STUTTER_MODE if you want your games to stutter.

Confusing name Default Deconfuse
PP_STUTTER_MODE Disabled. Enable stutter mode can save power in low DRAM use cases including but not limited to productivity application use, web browsing, and video playback.
Thank you to Remco for providing details.

Troubleshooting

IOTLB_INV_TIMEOUT on AMD Radeon Pro W5700 (and others) when IOMMU is enabled

Some less common AMD graphics fail to work when IOMMU is enabled. The kernels ring buffer will say something like:

[    3.375841] iommu ivhd0: AMD-Vi: Event logged [IOTLB_INV_TIMEOUT device=63:00.0 address=0x42b5b01a0]
[    3.375845] iommu ivhd0: AMD-Vi: Event logged [IOTLB_INV_TIMEOUT device=63:00.0 address=0x42b5b01c0]

if you are affected by this particular problem. A working solution is to add pci=noats to the kernel command line.

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[10] (in later Mesa versions). This behavior makes Chromium show videos with all messed up colors[11] 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. You can also set allow_rgb10_configs=false in /etc/environment.

Notes

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