From Gentoo Wiki
Jump to:navigation Jump to:search
Other languages:

AMDGPU is the next generation family of open source graphics drivers using the new Display Core (DC) framework for Vega GPUs and Raven Ridge GPUs. It is however also capable of handling newer AMD/ATI Radeon graphics cards based on GCN1.0+, namely the Southern Islands, Sea Islands, Volcanic Islands, and Arctic Islands chipsets.

If the card in question does not appear in the Feature support section below, it is not supported by AMDGPU. In that case check the radeon article, which contains instructions for older open-source AMD/ATI Radeon graphics card drivers.

Prior to Kernel 4.15 Display Core (DC, developed from Display Abstraction Layer, DAL) was not included in the vanilla kernel sources, thus AMDGPU was not able to provide graphics output to a monitor on VEGA and later chips.


Setting up a system to use AMDGPU requires identifying the proper card, installing the corresponding firmware, configuring the kernel, and installing the X11 driver.


Hardware detection

To choose the right driver, first detect the graphics card. Use lspci for this task:

root #lspci | grep -i VGA

Check the output for one of the product names listed in the table below.

Feature support

Video cores supported by the AMDGPU driver feature OpenGL 4.6 and OpenGL ES 3.2. The VIDEO_CARDS variable must be set to "amdgpu radeonsi". Via media-libs/mesa (version 20.0 or higher) the driver additionally supports Vulkan (RADV driver) and OpenCL 2.0 is available via ROCm (dev-libs/rocm-opencl-runtime). There is also support for VDPAU and VAAPI via radeonsi.

Family Chipset name MicroarchitectureA ISAB Product name
Southern Islands1 CAPE VERDE, PITCAIRN, TAHITI, OLAND, HAINAN GCN1.0+ DCE 6.x HD7750-HD7970, R9 270, R9 280, R9 370X, R7 240, R7 250
Sea Islands2 BONAIRE, KABINI, KAVERI, HAWAII, MULLINS GCN2.x DCE 8.x HD7790, R7 260, R9 290, R7 360, R9 390
Volcanic Islands CARRIZO, FIJI, STONEY, TONGA, TOPAZ, WANI GCN3.x DCE 10/11.x R9 285, R9 380, R9 380X, R9 Fury, R9 Nano, R9 Fury X, Pro Duo
Arctic Islands3 POLARIS10/11/12, VEGAM GCN4.x DCE 11.2 RX 460, RX 470, RX 480, RX 540, RX 550, RX 560, RX 570, RX 580, RX 590
Vega4 VEGA10/11/12/20 GCN5.x DCE 12.x RX Vega 56, RX Vega 64, Radeon Vega II, Radeon VII
RAVEN5 DCN 1.0 Raven Ridge APU series5
RENOIR6 DCN 2.1 Renoir, Lucienne, and Cezanne APU series6
Navi7 NAVI10/14/21/22/23 RDNA DCN 2.0 RX 5500, RX 5500 XT, RX 5600, RX 5600 XT, RX 5700, RX 5700 XT
RDNA2 DCN 3.08 RX 6600, RX 6600 XT, RX 6700, RX 6700 XT, RX 6800, RX 6800 XT, RX 6900 XT
A AMD previously called the microarchitecture Display Core (DC). GCN stands for Graphics Core Next and was introduced with the Radeon HD7000 series (GCN1.0). It was superseded by RDNA, short for Radeon DNA, introduced with the Radeon RX 5000 series (NAVI) in 2019.
B The actual Instruction Set Architecture (ISA) is defined by the Display Core Engine (DCE), which was superseded by Display Core Next (DCN), introduced with the Raven Ridge APUs (mobile Vega graphics core).
1 Experimental, optional support since kernel 4.9-rc1. Stable support for GCN1.x can be found in the older radeon driver.
2 Support is optional in the kernel and must be activated with DRM_AMDGPU_CIK=y, otherwise the older radeon driver provides stable support for Sea Islands (GCN2.x) cards.
3 Since kernel 4.7-rc6.
4 Usable for graphics output since kernel 4.15.
5 Since kernel 4.16.[1][2]
6 AMD Zen 2 "4000" series and Zen 2/3 "5000" series 7nm APUs[3][4][5][6]
7 Requires at least kernel 5.3, Mesa 19.2 and LLVM 9.0.[7]
8 RX 6*00 series since kernel 5.9.12 with CONFIG_DRM_AMD_DC_DCN3_0=Y.[8][9]


It is necessary to install the proper firmware (or microcode) for the card. Firmware files are provided by sys-kernel/linux-firmware. Make sure all necessary files for the hardware is in the configuration file if using the savedconfig USE flag.

USE flags for sys-kernel/linux-firmware Linux firmware files

compress-xz Compress firmware using xz (app-arch/xz-utils) before installation
compress-zstd Compress firmware using zstd (app-arch/zstd) before installation
initramfs Create and install initramfs for early microcode loading in /boot (only AMD for now)
redistributable Install also non-free (but redistributable) firmware files
savedconfig Allows individual selection of firmware files
unknown-license Install firmware files whose license is unknown

root #emerge --ask sys-kernel/linux-firmware

The firmware files installed this way will be incorporated into the kernel.

Navi10 cards (RX 5700, RX 5700XT [FE]) requires at least version 20190923 of sys-kernel/linux-firmware.


The easiest way of installation is to choose "AMD GPU" as a module (M) and to not have it included in an initramfs. This will load the driver a little later once udev becomes active and the firmware will never need to be manually managed in this case. Otherwise carefully read the Incorporating firmware section below.

Set the following kernel options for the graphic chipsets mentioned above:

KERNEL Configuring the kernel for AMD graphics (Linux kernels 4.15 and newer)
Processor type and features  --->
    [*] MTRR (Memory Type Range Register) support (CONFIG_MTRR)
Memory Management options  --->
    [*] Allow for memory hot-add
    [*] Allow for memory hot remove
    [*] Device memory (pmem, HMM, etc...) hotplug support
    [*] Unaddressable device memory (GPU memory, ...)
Device Drivers  --->
    Graphics support  --->
        <*/M> Direct Rendering Manager (XFree86 4.1.0 and higher DRI support) ---> (DRM_FBDEV_EMULATION)
              [*]   Enable legacy fbdev support for your modesetting driver
        <   > ATI Radeon
        <M/*> AMD GPU
              [ /*] Enable amdgpu support for SI parts (DRM_AMDGPU_SI)
                    (only needed for Southern Islands GPUs with the amdgpu driver)
              [ /*] Enable amdgpu support for CIK parts (DRM_AMDGPU_CIK)
                    (only needed for Sea Islands GPUs with the amdgpu driver)
              ACP (Audio CoProcessor) Configuration  ---> 
                  [*] Enable AMD Audio CoProcessor IP support (CONFIG_DRM_AMD_ACP)
                        (only needed for APUs)
              Display Engine Configuration  --->
                  [*] AMD DC - Enable new display engine (DRM_AMD_DC)
                  [ /*] DC support for Polaris and older ASICs
                        (only needed for Polaris, Carrizo, Tonga, Bonaire, Hawaii)
                  [ /*] AMD FBC - Enable Frame Buffer Compression
                  [ /*] DCN 1.0 Raven family
                        (only needed for Vega RX as part of Raven Ridge APUs)
                  [ /*] DCN 3.0 family
                        (only needed for NAVI21/Sienna Cichlid GPUs with the amdgpu driver)
        <*/M> HSA kernel driver for AMD GPU devices (HSA_AMD)
    <*/M> Sound card support  --->
        <*/M> Advanced Linux Sound Architecture  --->
            [*]   PCI sound devices ---> (CONFIG_SND_PCI)
                  HD-Audio  --->
                      <*> HD Audio PCI (CONFIG_SND_HDA_INTEL)
                      [*] Support initialization patch loading for HD-audio (CONFIG_SND_HDA_PATCH_LOADER)
                      <*> whatever audio codec your soundcard needs
                      <*> Build HDMI/DisplayPort HD-audio codec support (CONFIG_SND_HDA_CODEC_HDMI)
                  (2048) Pre-allocated buffer size for HD-audio driver (CONFIG_SND_HDA_PREALLOC_SIZE)
When using AMDGPU, it is recommended to unset the ATI Radeon option so that the radeon module is not built. Or alternatively, the module can be built and blacklisted (after rebooting check with lsmod | grep radeon to see if the blacklisting worked). The amdgpu and radeon modules are not meant to be loaded simultaneously, unless, for example multiseat, system requires it.

The options from the Sound card support menu need only to be set if the card supports HDMI or DisplayPort audio and it's use is desired. On newer kernels where Enable AMD Audio CoProcessor IP support appears, that should also be set.

AMDGPU with Display Core was first implemented for VEGA10 (GCN5.0) and RAVEN (with DCN 1.0) GPUs/APUs. Kernels before version 4.17 have (experimental) DC support for older cards (GCN1.1 and newer) via command line option amdgpu.dc=1, which may work better than the older radeon kernel module. Likewise, if DC needs to be disabled for any particular reason, option amdgpu.dc=0 can be used on the kernel command line.

See the radeon article for more details about using HDMI/DisplayPort audio.

Incorporating firmware

The firmware package installed in an earlier section provides files in /lib/firmware/amdgpu (for Volcanic Islands and Arctic Islands cards) and/or /lib/firmware/radeon (for Southern Islands and Sea Islands cards). The amdgpu module must be able to access the correct firmware files when it is loaded.

If the amdgpu module is compiled as a loadable kernel module (i.e. AMDGPU in the kernel configuration is set to M), the firmware files need to be accessible at the time it is loaded. In particular, if the module is loaded from an initrd/initramfs, the kernel will initialize it during early boot, just like when the module is built into the kernel directly (i.e. AMDGPU in the kernel configuration is set to *). For the firmware files to be accessible at this stage they need to be either included in the initrd/initramfs (which needs to be loaded by the bootloader, e.g. GRUB) or included directly in the kernel image.
KERNEL Including firmware in the kernel (prior to 4.18)
Device Drivers  --->
    Generic Driver Options  --->
        -*- Userspace firmware loading support
        [*] Include in-kernel firmware blobs in kernel binary 
            (amdgpu/<YOUR-MODEL>.bin or radeon/<YOUR-MODEL>.bin) (CONFIG_EXTRA_FIRMWARE)
            (/lib/firmware) Firmware blobs root directory
KERNEL Including firmware in the kernel (4.18 and later)
Device Drivers  --->
    Generic Driver Options  --->
        Firmware loader --->
          -*- Firmware loading facility
          (amdgpu/<YOUR-MODEL>.bin or radeon/<YOUR-MODEL>.bin) Build named firmware blobs into the kernel binary
          (/lib/firmware) Firmware blobs root directory
With sys-kernel/genkernel > 4.0 it is easily possible to include specified firmware files in an initramfs. Refer to the Firmware loading section of the genkernel article.
Kernels before 4.15.x (Aug. 2018) and 4.19.9[10] (Dec. 2018) require a different (older) set of firmware files than listed here in order to boot successfully. For all current kernels it is recommended to always make sure that sys-kernel/linux-firmware is updated.

In the case that the firmware needs to be included in the kernel or in an initramfs, and if using the savedconfig USE flag for sys-kernel/linux-firmware, make sure that the savedconfig configuration file is updated with a changed set of firmware files as well (like the change in 2018 mentioned above). Incorporate all the newly added files to the kernel configuration file in the firmware line, then rebuild and install the new kernel image. Otherwise boot will likely fail with a blank screen and firmware load errors thrown to the kernel log.

Unknown firmware blobs

A trial and error method often leads to success. In a multi-step process a basic bootable system may suffice to get the required information: missing firmware is indicated by an amdgpu error in dmesg, which helps to identify the required firmware files.

This method will, without any firmware files, very likely result in a blank screen since the AMDGPU driver doesn't work properly without firmware. A very basic method to still get the required information is to type in the blind and save the dmesg output into a file, which can be analyzed when rebooting without the AMDGPU driver in use. A better choice might be to intermittently include all the firmware, amdgpu/*, but then dmesg normally doesn't show which firmware was loaded, unless sys-kernel/gentoo-sources is installed with USE="experimental" and CONFIG_GENTOO_PRINT_FIRMWARE_INFO=y is set in the kernel .config, or to force the use of another framebuffer driver (like vesafb or efifb).
root #dmesg -t | grep amdgpu | grep firmware
amdgpu 0000:07:00.0: Direct firmware load for amdgpu/green_sardine_sdma.bin failed with error -2
[drm:sdma_v4_0_early_init] *ERROR* sdma_v4_0: Failed to load firmware "amdgpu/green_sardine_sdma.bin"
amdgpu 0000:07:00.0: Direct firmware load for amdgpu/green_sardine_asd.bin failed with error -2
root #dmesg -t | grep amdgpu | grep firmware
Loading firmware: amdgpu/green_sardine_sdma.bin
Loading firmware: amdgpu/green_sardine_asd.bin
Loading firmware: amdgpu/green_sardine_ta.bin
Loading firmware: amdgpu/green_sardine_pfp.bin
Loading firmware: amdgpu/green_sardine_me.bin
Loading firmware: amdgpu/green_sardine_ce.bin
Loading firmware: amdgpu/green_sardine_rlc.bin
Loading firmware: amdgpu/green_sardine_mec.bin
Loading firmware: amdgpu/green_sardine_dmcub.bin
Loading firmware: amdgpu/green_sardine_vcn.bin
The following will only work when sys-kernel/linux-firmware is installed and the required (but in the example above missing) firmware is actually available. For very new graphics cards the firmware may be included in the unstable package, which can be installed using ~ in ACCEPT_KEYWORDS, e.g. ~amd64 like in ACCEPT_KEYWORDS="~amd64" emerge --ask sys-kernel/linux-firmware or by adding it to /etc/portage/package.accept_keywords.

The way the AMDGPU firmware files are named, all files starting with the GPU model code name are the right firmware blobs to include. In the above example the code name is "Green Sardine", thus this command looking for green_sardine will get the required list for CONFIG_EXTRA_FIRMWARE:

user $ls /lib/firmware/amdgpu/green_sardine*.bin | sed 's/\/lib\/firmware\///' | echo $(cat)
amdgpu/green_sardine_asd.bin amdgpu/green_sardine_ce.bin amdgpu/green_sardine_dmcub.bin amdgpu/green_sardine_me.bin amdgpu/green_sardine_mec2.bin amdgpu/green_sardine_mec.bin amdgpu/green_sardine_pfp.bin amdgpu/green_sardine_rlc.bin amdgpu/green_sardine_sdma.bin amdgpu/green_sardine_ta.bin amdgpu/green_sardine_vcn.bin
If using genkernel, refer to the Firmware loading section there.
Known firmware blobs

amdgpu/<YOUR-MODEL>.bin or radeon/<YOUR-MODEL>.bin should be replaced with the full list of filenames given with the chipset's name in the table below, separated by spaces. Use echo to expand the filenames. E.g. for Volcanic Islands/TONGA, run:

user $echo amdgpu/tonga_{ce,k_smc,mc,me,mec2,mec,pfp,rlc,sdma1,sdma,smc,uvd,vce}.bin
amdgpu/tonga_ce.bin amdgpu/tonga_k_smc.bin amdgpu/tonga_mc.bin amdgpu/tonga_me.bin amdgpu/tonga_mec2.bin amdgpu/tonga_mec.bin amdgpu/tonga_pfp.bin amdgpu/tonga_rlc.bin amdgpu/tonga_sdma1.bin amdgpu/tonga_sdma.bin amdgpu/tonga_smc.bin amdgpu/tonga_uvd.bin amdgpu/tonga_vce.bin

Then amdgpu/tonga_ce.bin amdgpu/tonga_k_smc.bin amdgpu/tonga_mc.bin amdgpu/tonga_me.bin amdgpu/tonga_mec2.bin amdgpu/tonga_mec.bin amdgpu/tonga_pfp.bin amdgpu/tonga_rlc.bin amdgpu/tonga_sdma1.bin amdgpu/tonga_sdma.bin amdgpu/tonga_smc.bin amdgpu/tonga_uvd.bin amdgpu/tonga_vce.bin is the string that should be put into the kernel configuration.

After expanding the firmware file names from the following table and copying them into the kernel configuration, save the configuration, then compile and install the new kernel and modules.

Family Chipset name Product name Firmware
Southern Islands CAPE VERDE HD7750, HD7770, R7 250, R7 250X, R9 370X radeon/{verde_{ce,mc,me,pfp,rlc,smc},TAHITI_{uvd,vce}}.bin
PITCAIRN HD7800, R9 270X radeon/{pitcairn_{ce,mc,me,pfp,rlc,smc,k_smc},TAHITI_{uvd,vce}}.bin
TAHITI HD7870 XT, HD7900, R9 280X radeon/{tahiti_{ce,mc,me,pfp,rlc,smc},TAHITI_{uvd,vce}}.bin
OLAND HD8550M-HD8790M, R7 240 amdgpu/oland_{uvd,smc,rlc,pfp,me,mc,ce}.bin
HAINAN HD8970M radeon/{hainan_{ce,mc,me,pfp,rlc,smc},TAHITI_uvd}.bin
Sea Islands BONAIRE HD7790, R7 260, R7 260X, R7 360 radeon/bonaire_{ce,k_smc,mc,me,mec,pfp,rlc,sdma1,sdma,smc,uvd,vce}.bin
KABINI HD8180-HD8400 radeon/kabini_{ce,me,mec,pfp,rlc,sdma1,sdma,uvd,vce}.bin
KAVERI radeon/kaveri_{ce,me,mec2,mec,pfp,rlc,sdma1,sdma,uvd,vce}.bin
HAWAII R9 290, R9 290X, R9 390, R9 390X amdgpu/hawaii_{ce,k_smc,mc,me,mec,pfp,rlc,sdma,sdma1,smc,uvd,vce}.bin
MULLINS radeon/mullins_{ce,me,mec,pfp,rlc,sdma1,sdma,uvd,vce}.bin
Volcanic Islands CARRIZO amdgpu/carrizo_{ce,me,mec2,mec,pfp,rlc,sdma1,sdma,uvd,vce}.bin
FIJI R9 Fury, R9 Fury X, R9 Nano, Pro Duo amdgpu/fiji_{ce,mc,me,mec2,mec,pfp,rlc,sdma1,sdma,smc,uvd,vce}.bin
TONGA R9 285, R9 380, R9 380X amdgpu/tonga_{ce,k_smc,mc,me,mec2,mec,pfp,rlc,sdma1,sdma,smc,uvd,vce}.bin
TOPAZ R7 M260, R7 M265, R7 M340, R7 M360, R7 M360, R7 M370, R7 M440, R7 M445, R7 M460, R7 M465 amdgpu/topaz_{ce,mc,me,mec2,mec,pfp,rlc,sdma1,sdma,smc}.bin
STONEY amdgpu/stoney_{ce,me,mec,pfp,rlc,sdma,uvd,vce}.bin
Arctic Islands POLARIS10 RX 470, RX 480, RX 570, RX 580, RX 590 amdgpu/polaris10_{ce,ce_2,k_smc,k2_smc,k_mc,mc,me,me_2,mec2,mec2_2,mec,mec_2,pfp,pfp_2,rlc,sdma1,sdma,smc,smc_sk,uvd,vce}.bin
POLARIS11 RX 460, RX 550 640SP, RX 560 amdgpu/polaris11_{ce,k_smc,k2_smc,k_mc,mc,me,mec2,mec,pfp,rlc,sdma1,sdma,smc,smc_sk,uvd,vce}.bin
POLARIS12 RX 540, RX 550 amdgpu/polaris12_{ce,ce_2,k_mc,k_smc,mc,me,me_2,mec,mec2,mec2_2,mec_2,pfp,pfp_2,rlc,sdma,sdma1,smc,uvd,vce}.bin
Vega VEGA10 RX Vega 56, RX Vega 64 amdgpu/vega10_{acg_smc,asd,ce,gpu_info,me,mec,mec2,pfp,rlc,sdma,sdma1,smc,sos,uvd,vce}.bin
RAVEN Raven Ridge APU series amdgpu/raven_{asd,ce,gpu_info,me,mec,mec2,pfp,rlc,sdma,vcn}.bin
VEGA12 Raven 2 Vega Mobile amdgpu/vega12_{asd,ce,gpu_info,me,mec,mec2,pfp,rlc,sdma,sdma1,smc,sos,uvd,vce}.bin
RENOIR Renoir APU series amdgpu/renoir_{asd,ce,dmcub,gpu_info,me,mec2,mec,pfp,rlc,sdma,vcn}.bin
CEZANNE Cezanne (Zen 3; Renoir) amdgpu/green_sardine_{asd,ce,dmcub,me,mec2,mec,pfp,rlc,sdma,ta,vcn}.bin
Navi NAVI10 RX 5600, RX 5600 XT, RX 5700, RX 5700 XT amdgpu/navi10_{asd,ce,gpu_info,me,mec2,mec,pfp,rlc,sdma1,sdma,smc,sos,ta,vcn}.bin
NAVI14 RX 5500 XT amdgpu/navi14_{asd,ce,ce_wks,gpu_info,me,mec2,mec2_wks,mec,mec_wks,me_wks,pfp,pfp_wks,rlc,sdma1,sdma,smc,sos,ta,vcn}.bin
NAVI21 RX 6800, RX 6800 XT, RX 6900 XT amdgpu/sienna_cichlid_{ce,dmcub,me,mec2,mec,pfp,rlc,sdma,smc,sos,ta,vcn}.bin
NAVI22 RX 6700 XT amdgpu/navy_flounder_{ce,me,mec2,rlc,smc,ta,dmcub,mec,pfp,sdma,sos,vcn}.bin
NAVI23 RX 6600, RX 6600 XT amdgpu/dimgrey_cavefish_{ce,me,mec2,rlc,smc,ta,dmcub,mec,pfp,sdma,sos,vcn}.bin
NAVI24 RX 6400, RX 6500 XT amdgpu/beige_goby_{ce,ta,rlc,sos,dmcub,smc,sdma,mec,mec2,pfp,vcn,me}.bin
NAVI31 RX 7900 XT amdgpu/{gc_11_0_0_{imu,pfp,me,rlc,mec,mes,mes1},psp_13_0_0_sos,psp_13_0_0_ta,smu_13_0_0,dcn_3_2_0_dmcub,sdma_6_0_0,vcn_4_0_0}.bin

X11 driver


Portage uses the VIDEO_CARDS USE_EXPAND variable for enabling support for various graphics cards in packages. Setting VIDEO_CARDS to amdgpu radeonsi (see the feature matrix section above) and asking Portage to update changed USE flags in the @world set will pull in the correct driver:

FILE /etc/portage/make.conf
VIDEO_CARDS="amdgpu radeonsi"
In any case radeonsi has to be included for media-libs/mesa.
root #emerge --ask --deep --changed-use @world

The system should now be prepared to use amdgpu after the next reboot.

Power management

This section only covers dpm method. This method is only available for GPUs from R6xx -series onwards. Users of AMDGPU driver are thus automatically covered. Older dynpm and profile methods aren't covered here. Users who want to read about those should read radeon article instead.
This section assumes that card0 is the GPU users want to adjust. Users should check that paths like /sys/class/drm/card0/ belong to the right GPU. Users with more than one GPU will most likely have more than just card0 entry under said locations.


In most cases since Linux 3.13 dpm is the default power management method. Unlike with dynpm and profile methods enabling or disabling dpm must be done via kernel command line. Users who have GPUs older than HD5000 -series may need to add radeon.dpm=1 on kernel command-line to enable dpm.

In most cases just enabling dpm is enough but there are some tunable settings. dpm has three main modes of operating: battery, balanced, and performance. The names are quite self-explanatory.

To set the GPU to most performant mode the following command is needed to run:

root #echo performance > /sys/class/drm/card0/device/power_dpm_state

Even if GPU is set to performance -mode it does not mean that the GPU is running with highest clockspeeds at all the time. This is the normal and intended way how dpm works. If it is desirable to run the GPU at the highest speeds all the time, even if there is no actual load, users can then run following command:

root #echo high > /sys/class/drm/card0/device/power_dpm_force_performance_level

This manually overrides dpm's own behaviour. This is however mainly intended for testing purposes but may also be useful when doing GPU benchmarks.

To give control back to dpm following command is needed to run:

root #echo auto > /sys/class/drm/card0/device/power_dpm_force_performance_level
There's also the low forceable performance level, which can be echoed the same way. A list of all available modes can be found on

Clocking and voltages

In order to set clocks and voltages with AMDGPU, first set the performance level to manual:

root #echo manual > /sys/class/drm/card0/device/power_dpm_force_performance_level

Then, adjust clocks/voltages according to the Linux AMDGPU sysfs documentation with the pp-od-clk-voltage control file.


Debug tools


It might be helpful to install the package x11-apps/mesa-progs, which provides the glxgears and glxinfo utilities.


View the GPU utilization, both for the total activity percent and individual blocks:

user $radeontop
Collecting data, please wait....
            radeontop 1.4, running on RAVEN bus 06, 120 samples/sec
                   Graphics pipe   0.00% │
                    Event Engine   0.00% │
     Vertex Grouper + Tesselator   0.00% │
               Texture Addresser   0.00% │
                   Shader Export   0.00% │
     Sequencer Instruction Cache   0.00% │
             Shader Interpolator   0.00% │
                  Scan Converter   0.00% │
              Primitive Assembly   0.00% │
                     Depth Block   0.00% │
                     Color Block   0.00% │
                67M / 2016M VRAM   3.35% │ 
                 23M / 3063M GTT   0.76% │
      1.20G / 1.20G Memory Clock 100.00% │████████████████████████████████████████                               
      0.20G / 1.20G Shader Clock  16.67% │██████

Identifying which graphics card is in use

First make sure that the kernel was compiled with the following settings:

KERNEL Activate VGA Arbitration (CONFIG_VGA_ARB) and Laptop Hybrid Graphics (CONFIG_VGA_SWITCHEROO)
Device Drivers --->
    Graphics support  --->
        -*- VGA Arbitration
        [*] Laptop Hybrid Graphics - GPU switching support

Check, if the discrete graphics card was recognized:

user $lspci -k
01:00.0 Display controller: Advanced Micro Devices, Inc. [AMD/ATI] Mars [Radeon HD 8670A/8670M/8750M]
        Subsystem: Lenovo Mars [Radeon HD 8670A/8670M/8750M]
        Kernel driver in use: radeon

After that. Make sure that the path /sys/kernel/debug/ was mounted successfully:

root #findmnt debugfs
/sys/kernel/debug debugfs debugfs rw,nosuid,nodev,noexec,relatime

Then, check, if the driver vga_switcheroo was loaded successfully and can output values:

root #< /sys/kernel/debug/vgaswitcheroo/switch
0:DIS: :DynOff:0000:01:00.0

This output has the following structure[11]:

Iterator ID Active state Power state Device ID (xxxx:xx:xx.x)
0 DIS inactive (denoted by the lack of a + symbol) DynOff 0000:01:00.0
1 IGD active (denoted by + symbol) Pwr 0000:00:02.0

DIS represents the discrete graphics card, which is inactive, but currently disconnected (DynOff).
IGD is the integrated graphics card, which is active (+) and is currently in use (Pwr).

The status can be manipulated using the following command:

root #echo "<some_parameter>" > /sys/kernel/debug/vgaswitcheroo/switch

Replace <some_parameter> with one of the following paramters[12]:

Parameter Description
ON Turns on the disconnected GPU, which is currently not displaying anything and does not switch outputs.
IGD Connects the integrated graphics card with the display.
DIS Connects the discrete graphics card with the display.
OFF Turns off the graphics card, which is currently disconnected.
DIGD Inside of an X session: Queues a switch to the integrated graphics card to occur, when the X server is next restarted.
DDIS Inside of an X session: Queues a switch to the discrete graphics card to occur, when the X server is next restarted.

By using the environment variable DRI_PRIME=1, one can use the discrete graphics card individually:

user $DRI_PRIME=1 glxgears

This opens an X window with rotating gears.

Let it run in the background and check, vga_switcheroo again:

root #< /sys/kernel/debug/vgaswitcheroo/switch
0:DIS: :DynPwr:0000:01:00.0
This time the status of the discrete graphics card switched to DynPwr, which means, that it is active and running.

Another indicator is to check the temperature sensors. This requires sys-apps/lm-sensors:

user $sensors
Adapter: PCI adapter
temp1:            +42.0°C  (crit = +120.0°C, hyst = +90.0°C)
When vga_switcheroo displays the status DynOff, sensors will display the temperature as N/A or as something else, which may not make sense; for example: -128°C.

To use the discrete graphics card globally, one can set the environment variable in the /etc/environment file:

FILE /etc/environment

One might export it in the ~/.bashrc file as an alternative:

FILE /home/larry/.bashrc
export DRI_PRIME=1

Or individually in front of the command, like above using glxgears:

user $DRI_PRIME=1 /usr/bin/chromium
user $DRI_PRIME=1 /usr/bin/vlc

Prime Synchronization

The x11-drivers/xf86-video-amdgpu driver does not support Prime Synchornization. This might cause tearing on monitors connected to the integrated GPU if the AMD GPU is set as the primary GPU. One possible workaround is to use the modesetting driver instead, to do this remove amdgpu from the VIDEO_CARDS variable. Or use a xorg configuration file to force the use of the modesetting driver. That being said, other issues may be encountered with the modesetting driver[13].

FILE /etc/X11/xorg.conf.d/force-modesetting.conf
Section "Device"
  Identifier "modesetting"
  Driver "modesetting"

Another possible workaround is to set the integrated GPU as the primary GPU. This will not enable Prime Synchronization. However, tearing will be prevented nonetheless through AMD's TearFree. In this case it will be neccesairy to use the DRI_PRIME=1, VDPAU_DRIVER=radeonsi(for VDPAU) and LIBVA_DRIVER_NAME=radeonsi(for VAAPI) variables on applications that should be rendered on the AMD GPU.

Fallback driver

If having no other machine to browse web pages for solutions, the vesa or fbdev drivers can be used to start X without 3d and 2d acceleration.

  • Vesa for classic BIOS systems
  • Fbdev for UEFI booted systems
FILE /etc/partage/make.conf
VIDEO_CARDS="... vesa fbdev"
root #emerge --ask --update --newuse --deep @world


Older kernels

Older kernels which do not support the amdgpu driver will not provide the AMDGPU option. For VEGA and newer chips there is no video output without DC (Display Code), which was first included in vanilla Kernel 4.15. In both cases a fairly recent kernel can provide the required drivers. For very new AMD graphics cards and APUs trying an unstable (denoted by a ~) kernel may provide the required kernel-sources.

AMD Secure Memory Encryption

If amdgpu fails to load or the screen stays frozen, it might be an incompatibility of the amdgpu module with AMD Secure Memory Encryption (SME).

SME can be temporarily disabled on the kernel command line (using GRUB, or in /etc/default/grub or as part of GRUB_CMDLINE_LINUX) by adding mem_encrypt=off. If this fixes the issue, a permanent solution is to configure the kernel accordingly.

Processor type and features  --->
    [*] AMD Secure Memory Encryption (SME) support
    [ ]   Activate AMD Secure Memory Encryption (SME) by default

AMD_MEM_ENCRYPT may remain enabled, but either AMD_MEM_ENCRYPT_ACTIVE_BY_DEFAULT must remain unset or the kernel command line option mem_encrypt=off must be used in order to turn Memory Encryption off. Likewise, with mem_encrypt=on SME can be activated for unaffected systems on the kernel command line or more permanently using GRUB_CMDLINE_LINUX in /etc/default/grub for GRUB.

AMDGPU/RadeonSI drivers do not work

If the graphics card is not supported by including amdgpu and radeonsi alone in VIDEO_CARDS, try adding radeon to make.conf's VIDEO_CARDS definition. For example:

FILE /etc/portage/make.conf
VIDEO_CARDS="amdgpu radeonsi radeon"

After the values have been set update the system so the changes take effect:

root #emerge --ask --changed-use --deep @world

Full-screen windows perform poorly

The installed version of sys-devel/llvm may be too old. Try emerging an unstable/testing version.

Pixel-wide line on left side of screen when X server is started when using a Southern Island card

Those using a Southern Island card may notice a pixel-wide line on the left of the screen in both the X server and console environments after having started a X server (This issue doesn't exist when using Linux 4.13 or newer). This is a known bug. Disabling audio through HDMI for that display resolves this issue. This may be done via:

user $xrandr --output HDMI-A-0 --auto --set audio off

where HDMI-A-0 should be replaced by the name of the output, obtained by running xrandr

For more information please see

Xrand doesn't see HDMI port with hybrid system

On hybrid system with AMD iGPU and dGPU xrandr can show only eDP port, but not HDMI:

user $xrandr
Screen 0: minimum 320 x 200, current 1920 x 2160, maximum 16384 x 16384
eDP connected primary 1920x1080+0+1080 (normal left inverted right x axis y axis) 382mm x 215mm
   1920x1080    144.03*+  60.01  
   1680x1050    144.03  
   1280x1024    144.03  
   1440x900     144.03  
   1280x800     144.03  
   1280x720     144.03  
   1024x768     144.03  
   800x600      144.03  
   640x480      144.03  

Where as Xorg log shows that port was detected and EDID of the monitor decoded without issues:

user $cat /var/log/Xorg.0.log
[     8.282] (II) AMDGPU(G0): Output HDMI-A-1-0 has no monitor section
[     8.294] (II) AMDGPU(G0): EDID for output HDMI-A-1-0
[     8.295] (II) AMDGPU(G0): Manufacturer: DEL  Model: a11e  Serial#: 843731010
[     8.295] (II) AMDGPU(G0): Supported established timings:
[     8.295] (II) AMDGPU(G0): 720x400@70Hz
[     8.295] (II) AMDGPU(G0): EDID (in hex):
[     8.295] (II) AMDGPU(G0):   00ffffffffffff0010ac1ea142504a32
[     8.295] (II) AMDGPU(G0):   0c1f010380351e78ea05f5a557529c27
[     8.296] (II) AMDGPU(G0): Printing probed modes for output HDMI-A-1-0
[     8.296] (II) AMDGPU(G0): Modeline "1920x1080"x60.0  148.50  1920 2008 2052 2200  1080 1084 1089 1125 +hsync +vsync (67.5 kHz eP)

If it doesn't then it is different issue. And it should be addressed first.

Xrandr would have 2 providers since there are 2 GPUs:

user $xrandr --listproviders
Providers: number : 2
Provider 0: id: 0x54 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 4 outputs: 1 associated providers: 1 name:Unknown AMD Radeon GPU @ pci:0000:07:00.0
Provider 1: id: 0x84 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 5 outputs: 1 associated providers: 1 name:Radeon RX 5500M @ pci:0000:03:00.0

And we need to link source with output:

user $xrandr --setprovideroutputsource provider source

In provided example it would be this:

user $xrandr --setprovideroutputsource 1 0

After this xrandr shows HDMI and can manipulate layout properly:

user $xrandr
Screen 0: minimum 320 x 200, current 1920 x 2160, maximum 16384 x 16384
eDP connected primary 1920x1080+0+1080 (normal left inverted right x axis y axis) 382mm x 215mm
   1920x1080    144.03*+  60.01  
HDMI-A-1-0 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 527mm x 296mm
   1920x1080     60.00*+  50.00    59.94  

Screen Tearing

One method to prevent screen tearing on Xorg is to enable the TearFree option in X11 like so:

FILE /usr/share/X11/xorg.conf.d/10-amdgpu.conf
Section "OutputClass"
	Identifier "AMDgpu"
	MatchDriver "amdgpu"
	Driver "amdgpu"
    Option "TearFree" "true"

Flickering and white screens

This issue has already been reported in the Gentoo forums:

The suggested fix at upstream level is to set the sg_display module parameter like this: amdgpu.sg_display=0

As an alternative apply the following patch to the kernel source code:

Seems to concern Linux kernels >= 6.1.4.

See also

  • AMDGPU-PRO — the next generation closed source graphics component that operates on top of the open source AMDGPU drivers for newer AMD/ATI Radeon graphics cards.
  • AMDVLK — an open-source Vulkan driver for AMD Radeon™ graphics adapters on Linux led by GPUOpen initiative.
  • OpenCL — a framework for writing programs that execute across heterogeneous computing platforms (CPUs, GPUs, DSPs, FPGAs, ASICs, etc.).
  • Vulkan — a next-generation graphics API created by The Khronos Group.
  • VAAPI — provides access to graphics hardware (GPU) acceleration for video processing.
  • VDPAU — how to setup the Video Decode and Presentation API for Unix (VDPAU).

External resources