AMDGPU (Português)
AMDGPU é o driver gráfico de código aberto para placas gráficas AMD Radeon desde a família Graphics Core Next.
Selecionando o driver correto
Identifique o seu hardware e encontre o driver correto lendo Graphics processing unit#Installation. Este driver tem suporte às placas Southern Islands (GCN 1, lançada em 2012) e mais recentes. A AMD não tem planos para dar suporte a GPUs pré-GCN.
Aqueles que possuam GPUs não suportadas pela AMD podem ainda usar o driver de código aberto ATI.
Instalação
Install the mesa package, which provides both the DRI driver for 3D acceleration and VA-API/VDPAU drivers for accelerated video decoding.
- For 32-bit application support, also install the lib32-mesa package from the multilib repository.
- For the DDX driver which provides 2D acceleration in Xorg, use one of the following drivers:
- The modesetting driver included in the xorg-server package is the recommended choice for most Xorg systems using the
amdgpukernel driver. It uses the DRI driver for acceleration via glamor. - The xf86-video-amdgpu package provides the legacy AMD-specific DDX driver. This package is generally not recommended, see note at Intel graphics#Installation. However, xf86-video-amdgpu could be required for features such as
TearFreeor to resolve hardware-specific issues on some AMD hardware, like Southern Islands.
- The modesetting driver included in the xorg-server package is the recommended choice for most Xorg systems using the
- For Vulkan support install vulkan-radeon (lib32-vulkan-radeon for 32-bit applications).
Experimental
It may be worthwhile for some users to use the upstream experimental build of mesa.
Install the mesa-gitAUR package, which provides the DRI driver for 3D acceleration.
- For 32-bit application support, also install the lib32-mesa-gitAUR package from the mesa-git repository or the AUR.
- For the legacy AMD-specific DDX driver (which provides 2D acceleration in Xorg), install the xf86-video-amdgpu-gitAUR package.
- For Vulkan support using the mesa-git repository, install the vulkan-radeon-git package. Optionally install the lib32-vulkan-radeon-git package for 32-bit application support. This should not be required if building mesa-gitAUR from the AUR.
Enable Southern Islands (SI) and Sea Islands (CIK) support
Officially supported kernels enable AMDGPU support for cards of the Southern Islands (GCN 1, released in 2012) and Sea Islands (GCN 2, released in 2013). The amdgpu kernel driver needs to be loaded before the radeon one. You can check which kernel driver is loaded by running lspci -k. It should be like this:
$ lspci -k -d ::03xx
01:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Curacao PRO [Radeon R7 370 / R9 270/370 OEM] Subsystem: Gigabyte Technology Co., Ltd Device 226c Kernel driver in use: amdgpu Kernel modules: radeon, amdgpu
If the amdgpu driver is not in use, follow instructions in the next section.
Load amdgpu driver
The module parameters of both amdgpu and radeon modules are cik_support= and si_support=.
They need to be set as kernel parameters or in a modprobe configuration file, and depend on the cards GCN version.
You can use both parameters if you are unsure which kernel card you have.
[..] amdgpu 0000:01:00.0: Use radeon.cik_support=0 amdgpu.cik_support=1 to override.Set module parameters in kernel command line
Set one of the following kernel parameters:
- Southern Islands (SI):
radeon.si_support=0 amdgpu.si_support=1 - Sea Islands (CIK):
radeon.cik_support=0 amdgpu.cik_support=1
Furthermore, if you are using an AMD A10 APU with an integrated Sea Island (GCN 1.1) card, you may have to disable Radeon Dynamic Power Management to get a proper boot. This is a feature that dynamically re-clocks the graphics core in order to keep the APU cooler and quieter, however this feature may put you in an infinite restart loop. To disable it, following the instructions above, add radeon.dpm=0 to the boot options.
Specify the correct module order
Make sure amdgpu has been set as first module in the Mkinitcpio#MODULES array, e.g. MODULES=(amdgpu radeon).
Set kernel module parameters
For Southern Islands (SI) use the si_support=1 kernel module parameter, for Sea Islands (CIK) use cik_support=1:
/etc/modprobe.d/amdgpu.conf
options amdgpu si_support=1 options amdgpu cik_support=1
/etc/modprobe.d/radeon.conf
options radeon si_support=0 options radeon cik_support=0
Make sure modconf is in the HOOKS array in /etc/mkinitcpio.conf and regenerate the initramfs.
Compile kernel which supports amdgpu driver
When building or compiling a kernel, CONFIG_DRM_AMDGPU_SI=Y and/or CONFIG_DRM_AMDGPU_CIK=Y should be set in the config.
ACO compiler
The ACO compiler is an open source shader compiler created and developed by Valve Corporation to directly compete with the LLVM compiler, as well as Windows 10. It offers lesser compilation time and also performs better while gaming than LLVM.
Some benchmarks can be seen on GitHub and Phoronix [1] [2].
Since mesa version 20.2 ACO is the default shader compiler.
Carregamento
Espera-se que o módulo de kernel amdgpu carregue automaticamente durante o boot do sistema.
Se isso não acontecer:
- Tenha certeza de #Enable Southern Islands (SI) and Sea Islands (CIK) support quando necessário.
- Certifique-se que você tem o pacote linux-firmware-amdgpu mais recente instalado. Este driver requer o firmware mais recente para cada modelo para inicializar corretamente.
- Certifique-se que você não tem
nomodesetouvga=como parâmetros do kernel, pois oamdgpurequer o KMS. - Verifique que você não desativou o
amdgpuusando alguma lista negra de módulos.
É possível que ele seja carregado, mas tardiamente, após o servidor X requisitá-lo. Neste caso, veja Kernel mode setting#Early KMS start.
Configuração do Xorg
O Xorg irá carregar o driver automaticamente e usar o EDID do seu monitor para escolher a resolução nativa. A etapa de configuração só é necessária para ajustar o driver.
Se você quiser uma configuração manual, crie o arquivo /etc/X11/xorg.conf.d/20-amdgpu.conf, e adicione o seguinte:
/etc/X11/xorg.conf.d/20-amdgpu.conf
Section "OutputClass"
Identifier "AMD"
MatchDriver "amdgpu"
Driver "amdgpu"
EndSection
Usando esta seção, você pode ativar recursos e calibrar as configurações do driver. Veja amdgpu(4) primeiro antes de configurar opções do driver.
Renderização livre de tearing
O TearFree controla a prevenção do screen tearing ("rompimento" ou "rasgo" da tela) usando o mecanismo de mudança de página do hardware. Por padrão, o TearFree estará ligado para saídas rotacionadas, saídas com transformações RandR aplicadas, e para saídas dependentes RandR 1.4, e desligado para qualquer outra coisa. Ou, você pode configurá-lo para estar sempre ligado ou sempre desligado com true ou false respectivamente.
Option "TearFree" "true"
Você também pode ativar o TearFree temporariamente com xrandr:
$ xrandr --output saída --set TearFree on
Onde a saída deve se parecer com DisplayPort-0 ou HDMI-A-0 e pode ser adquirida executando xrandr -q.
Nível DRI
DRI põe o nível máximo de DRI para ser ativado. Valores válidos são 2 para DRI2 ou 3 para DRI3. O padrão é 3.
Option "DRI" "3"
Taxa de atualização variável
Veja Variable refresh rate.
10-bit color
Newer AMD cards support 10bpc color, but the default is 24-bit color and 30-bit color must be explicitly enabled. Enabling it can reduce visible banding/artifacts in gradients, if the applications support this too. To check if your monitor supports it search for "EDID" in your Xorg log file (e.g. /var/log/Xorg.0.log or ~/.local/share/xorg/Xorg.0.log):
[ 336.695] (II) AMDGPU(0): EDID for output DisplayPort-0 [ 336.695] (II) AMDGPU(0): EDID for output DisplayPort-1 [ 336.695] (II) AMDGPU(0): Manufacturer: DEL Model: a0ec Serial#: 123456789 [ 336.695] (II) AMDGPU(0): Year: 2018 Week: 23 [ 336.695] (II) AMDGPU(0): EDID Version: 1.4 [ 336.695] (II) AMDGPU(0): Digital Display Input [ 336.695] (II) AMDGPU(0): 10 bits per channel
To check whether it is currently enabled search for "Depth"):
[ 336.618] (**) AMDGPU(0): Depth 30, (--) framebuffer bpp 32 [ 336.618] (II) AMDGPU(0): Pixel depth = 30 bits stored in 4 bytes (32 bpp pixmaps)
With the default configuration it will instead say the depth is 24, with 24 bits stored in 4 bytes.
To check whether 10-bit works, exit Xorg if you have it running and run Xorg -retro which will display a black and white grid, then press Ctrl-Alt-F1 and Ctrl-C to exit X, and run Xorg -depth 30 -retro. If this works fine, then 10-bit is working.
To launch in 10-bit via startx, use startx -- -depth 30. To permanently enable it, create or add to:
/etc/X11/xorg.conf.d/20-amdgpu.conf
Section "Screen" Identifier "asdf" DefaultDepth 30 EndSection
Reduzir latência da saída
Caso você queira minimizar a latência, você pode desativar a mudança de página (page flipping) e o TearFree:
/etc/X11/xorg.conf.d/20-amdgpu.conf
Section "OutputClass"
Identifier "AMD"
MatchDriver "amdgpu"
Driver "amdgpu"
Option "EnablePageFlip" "off"
Option "TearFree" "false"
EndSection
Veja Gaming#Reducing DRI latency para reduzir ainda mais a latência.
Recursos
Aceleração de vídeo
Veja Hardware video acceleration#AMD/ATI.
Monitoring
Monitoring your GPU is often used to check the temperature and also the P-states of your GPU. See Graphics processing unit#Monitoring for a list of CLI and GUI tools.
If you want to manually monitor individual elements, for example to use them within scripts, all the information is available in /sys/. For additional elements and details see The Linux Kernel - GPU Power/Thermal Controls and Monitoring.
For the commands below, card0 may need replaced with another value (E.g., card1) depending on the number of GPUs in the system.
To check your GPU's P-states, execute:
$ cat /sys/class/drm/card0/device/pp_od_clk_voltage
To monitor your GPU, execute:
# watch -n 0.5 cat /sys/kernel/debug/dri/0/amdgpu_pm_info
To check your GPU utilization (%), execute:
$ cat /sys/class/drm/card0/device/gpu_busy_percent
To check your GPU frequency, execute:
$ cat /sys/class/drm/card0/device/pp_dpm_sclk
To check your GPU temperature (millidegrees Celsius), execute:
$ cat /sys/class/drm/card0/device/hwmon/hwmon*/temp1_input
To check your VRAM frequency, execute:
$ cat /sys/class/drm/card0/device/pp_dpm_mclk
To check your VRAM usage (bytes), execute:
$ cat /sys/class/drm/card0/device/mem_info_vram_used
To check your VRAM size (bytes), execute:
$ cat /sys/class/drm/card0/device/mem_info_vram_total
Overclocking
Desde o Linux 4.17, uma vez que os recursos abaixo tenham sido ativados durante o boot, é possível ajustar os clocks e a voltagem da placa gráfica via /sys/class/drm/card0/device/pp_od_clk_voltage.
Boot parameter
It is required to unlock access to adjust clocks and voltages in sysfs by appending the Kernel parameter amdgpu.ppfeaturemask=0xffffffff.
Not all bits are defined, and new features may be added over time. Setting all 32 bits may enable unstable features that cause problems such as screen flicker or broken resume from suspend. It should be sufficient to set the PP_OVERDRIVE_MASK bit, 0x4000, in combination with the default ppfeaturemask. To compute a reasonable parameter for your system, execute:
$ printf 'amdgpu.ppfeaturemask=0x%x\n' "$(($(cat /sys/module/amdgpu/parameters/ppfeaturemask) | 0x4000))"
Manual
/sys/class/drm/... are just symlinks and may change between reboots. Persistent locations can be found in /sys/devices/, e.g. /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0/. Adjust the commands accordingly for a reliable result.For in-depth information on all possible options, read the kernel documentation for amdgpu thermal control.
To enable manual overclocking, select the manual performance level as described in #Performance levels.
To set the GPU clock for the maximum P-state 7 on e.g. a Polaris GPU to 1209MHz and 900mV voltage, run:
# echo "s 7 1209 900" > /sys/class/drm/card0/device/pp_od_clk_voltage
The same procedure can be applied to the VRAM, e.g. maximum P-state 2 on Polaris 5xx series cards:
# echo "m 2 1850 850" > /sys/class/drm/card0/device/pp_od_clk_voltage
To apply, run:
# echo "c" > /sys/class/drm/card0/device/pp_od_clk_voltage
To check if it worked out, read out clocks and voltage under 3D load:
# watch -n 0.5 cat /sys/kernel/debug/dri/0/amdgpu_pm_info
You can reset to the default values using:
# echo "r" > /sys/class/drm/card0/device/pp_od_clk_voltage
It is also possible to forbid the driver from switching to certain P-states, e.g. to workaround problems with deep powersaving P-states, such as flickering artifacts or stutter. To force the highest VRAM P-state on a card, while still allowing the GPU itself to run with lower clocks, first find the highest possible P-state, then set it:
$ cat /sys/class/drm/card0/device/pp_dpm_mclk
0: 96Mhz * 1: 456Mhz 2: 675Mhz 3: 1000Mhz
# echo "manual" > /sys/class/drm/card0/device/power_dpm_force_performance_level # echo "3" > /sys/class/drm/card0/device/pp_dpm_mclk
Allow only the three highest GPU P-states:
# echo "5 6 7" > /sys/class/drm/card0/device/pp_dpm_sclk
To set the allowed maximum power consumption of the GPU to e.g. 50 Watts, run:
# echo 50000000 > /sys/class/drm/card0/device/hwmon/hwmon0/power1_cap
Assisted
If you are not inclined to fully manually overclock your GPU, there are some overclocking tools that are offered by the community to assist you to overclock and monitor your AMD GPU.
CLI tools
- amdgpu-clocks — A script that can be used to monitor and set custom power states for AMD GPUs. It also offers a Systemd service to apply the settings automatically upon boot.
- ruby-amdgpu_fan — A CLI for interacting with the amdgpu Linux driver written in Ruby.
GUI tools
- TuxClocker — A Qt5 monitoring and overclocking tool.
- CoreCtrl — A GUI overclocking tool with a WattMan-like UI that supports per-application profiles.
- LACT — A GTK tool to view information and control your AMD GPU.
- Radeon Profile — A Qt5 tool to read and change current clocks of AMD Radeon cards.
Startup on boot
One way is to use systemd units, if you want your settings to apply automatically upon boot, consider looking at this Reddit thread to configure and apply your settings on boot.
Another way is to use udev rules for some of the values, for example, to set a low performance level to save energy:
/etc/udev/rules.d/30-amdgpu-low-power.rules
ACTION=="add", SUBSYSTEM=="drm", DRIVERS=="amdgpu", ATTR{device/power_dpm_force_performance_level}="low"
Performance levels
AMDGPU offers several performance levels, the file power_dpm_force_performance_level is used for this, it is possible to select between these levels:
- auto: dynamically select the optimal power profile for current conditions in the driver.
- low: clocks are forced to the lowest power state.
- high: clocks are forced to the highest power state.
- manual: user can manually adjust which power states are enabled for each clock domain (used for setting #Power profiles)
- profile_standard, profile_min_sclk, profile_min_mclk, profile_peak: clock and power gating are disabled and the clocks are set for different profiling cases. This mode is recommended for profiling specific work loads
To set the AMDGPU device to use a low performance level, the following command can be executed:
# echo "low" > /sys/class/drm/card0/device/power_dpm_force_performance_level
Power profiles
AMDGPU offers several optimizations via power profiles, one of the most commonly used is the compute mode for OpenCL intensive applications. Available power profiles can be listed with:
$ cat /sys/class/drm/card0/device/pp_power_profile_mode
NUM MODE_NAME SCLK_UP_HYST SCLK_DOWN_HYST SCLK_ACTIVE_LEVEL MCLK_UP_HYST MCLK_DOWN_HYST MCLK_ACTIVE_LEVEL 0 BOOTUP_DEFAULT: - - - - - - 1 3D_FULL_SCREEN: 0 100 30 0 100 10 2 POWER_SAVING: 10 0 30 - - - 3 VIDEO: - - - 10 16 31 4 VR: 0 11 50 0 100 10 5 COMPUTE *: 0 5 30 10 60 25 6 CUSTOM: - - - - - -
card0 identifies a specific GPU in your machine, in case of multiple GPUs be sure to address the right one.To use a specific power profile you should first enable manual control over them with:
# echo "manual" > /sys/class/drm/card0/device/power_dpm_force_performance_level
Then to select a power profile by writing the NUM field associated with it, e.g. to enable COMPUTE run:
# echo "5" > /sys/class/drm/card0/device/pp_power_profile_mode
The exact values and limits of power profiles is managed through the powerplay table system. Use upliftpowerplayAUR to modify the table for supported models (Polaris to Navi2x; Navi3x and Navi4x are bugged on kernel side).
Enable GPU display scaling
To avoid the usage of the scaler which is built in the display, and use the GPU own scaler instead, when not using the native resolution of the monitor, execute:
$ xrandr --output output --set "scaling mode" scaling_mode
Possible values for "scaling mode" are: None, Full, Center, Full aspect.
- To show the available outputs and settings, execute:
$ xrandr --prop
- To set
scaling mode = Full aspectfor just every available output, execute:$ for output in $(xrandr --prop | grep -E -o -i "^[A-Z\-]+-[0-9]+"); do xrandr --output "$output" --set "scaling mode" "Full aspect"; done
Virtual display on headless setups
AMDGPU offers GPU accelerated virtual monitors for headless setups without the use of a dummy plug. This is useful for RDP and game streaming software such as sunshineAUR.
Choose the AMD GPU to use:
$ lspci -Dd ::03xx
1234:56:78.9 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] CommercialModelName
Add the virtual_display=1234:56:78.9,x kernel module parameter for the amdgpu module, where 1234:56:78.9 is the PCI address of the GPU and x is the number of crtc (virtual monitors) to expose. Using this parameter also disables physical outputs. [3]
Multiple GPUs can also be used by separating PCI address with a semicolon (;) as shown below:
amdgpu.virtual_display=1234:56:78.9,x;9876:54:32.1,y
User queues
The AMDGPU driver supports user queues, which allow job submission directly to the GPU hardware without going through the kernel driver’s command submission ioctl. Enabling this can reduce latency and improve efficiency by bypassing some kernel driver overhead.
To enable user queues, set the following environment variable:
export AMD_USERQ=1
To verify it is active, check the user_queue parameter:
$ cat /sys/module/amdgpu/parameters/user_queue
It should return 1. If it returns 0 or -1, the hardware or driver version is likely incompatible.
Fila dedicada somente à transferência usando SDMA
O código incorporado ao Mesa 26.0 tem suporte à fila de transferência dedicada RADV funcionando em GPUs GFX9 (Vega) e mais recentes. Ativar este recurso atualmente requer a variável de ambiente RADV_PERFTEST=transfer_queue posta. A camada DXVK Direct3D-on-Vulkan está dentre os software que podem se beneficiar do suporte às filas de transferência embora não haja nenhum dado de performance/benchmarking citados no merge request para quantificar o benefício da nova funcionalidade.
Solução de problemas
Parâmetros do módulo
O módulo amdgpu guarda diversos parâmetros de configuração (modinfo amdgpu | grep mask) em máscaras (masks) que são documentadas apenas no código fonte do kernel.
Xorg or applications will not start
- "(EE) AMDGPU(0): [DRI2] DRI2SwapBuffers: drawable has no back or front?" error after opening glxgears, can open Xorg server but OpenGL applications crash.
- "(EE) AMDGPU(0): Given depth (32) is not supported by amdgpu driver" error, Xorg will not start.
Setting the screen's depth under Xorg to 16 or 32 will cause problems/crash. To avoid that, you should use a standard screen depth of 24 by adding this to your "screen" section:
/etc/X11/xorg.conf.d/10-screen.conf
Section "Screen"
Identifier "Screen"
DefaultDepth 24
SubSection "Display"
Depth 24
EndSubSection
EndSection
R9 390 series poor performance and/or instability
If you experience issues [4] with a AMD R9 390 series graphics card, set radeon.cik_support=0 radeon.si_support=0 amdgpu.cik_support=1 amdgpu.si_support=1 amdgpu.dc=1 as kernel parameters to force the use of amdgpu driver instead of radeon.
If it still does not work, disabling DPM might help, add radeon.cik_support=0 radeon.si_support=0 amdgpu.cik_support=1 amdgpu.si_support=1 to the kernel parameters.
Freezes with "[drm] IP block:gmc_v8_0 is hung!" kernel error
If you experience freezes and kernel crashes during a GPU intensive task with the kernel error " [drm] IP block:gmc_v8_0 is hung!" [5], a workaround is to set amdgpu.vm_update_mode=3 as kernel parameters to force the GPUVM page tables update to be done using the CPU. Downsides are listed here [6].
Tela piscando branco/cinza
Ao mudar a resolução ou conectar a um monitor externo, se a tela começar a piscar ou ficar branca, adicione amdgpu.sg_display=0 como um parâmetro de kernel.
System freeze or crash when gaming on Vega cards
Dynamic power management may cause a complete system freeze whilst gaming due to issues in the way GPU clock speeds are managed. [7] A workaround is to set the high performance level as described in #Performance levels.
WebRenderer (Firefox) corruption
Artifacts and other anomalies may present themselves (e.g. inability to select extension options) when WebRenderer is force enabled by the user. Workaround is to fall back to OpenGL compositing.
Double-speed or "chipmunk" audio, or no audio when a 4K@60Hz device is connected
This is sometimes caused by a communication issue between an AMDGPU device and a 4K display connected over HDMI. A possible workaround is to enable HDR or "Ultra HD Deep Color" via the display's built-in settings. On many Android based TVs, this means setting this to "Standard" instead of "Optimal".
Issues with power management / dynamic re-activation of a discrete amdgpu graphics card
If you encounter issues where the kernel driver is loaded, but the discrete graphics card still is not available for games or becomes disabled during use (similar to [8]), you can workaround the issue by setting the kernel parameter amdgpu.runpm=0, which prevents the dGPU from being powered down dynamically at runtime.
Frozen or unresponsive display (flip_done timed out)
A bug in the amdgpu driver may stop the display from updating [9]. It is suggested to append the amdgpu.dcdebugmask=0x10 (which disables Panel self refresh v1 and "Panel Self Refresh-Selectively Updated") or amdgpu.dcdebugmask=0x12 (which disables Panel self refresh and memory stutter mode) kernel parameter as a workaround[10].
kfd fails to initialize
kfd can fail to initialize depending on the GPU's architecture. gfx803 (GCN 4) requires PCIe atomics support, while gfx9xx (Vega) and later devices does not require PCIe atomics. kfd does not support GCN 3 or older devices.
If you are not planning to use ROCm, these errors can be safely ignored.
"[GPU Core Name] not supported in kfd"
In the system journal or the kernel message keyring a critical level error message may appear relating to kfd:
# dmesg | grep kfd
kfd kfd: amdgpu: BONAIRE not supported in kfd
(Replace BONAIRE with the name of the core that's in your GPU, such as TOPAZ, HAWAII, etc. You can find the core name by looking up your GPU or by using a GPU diagnostic utility such as amdgpu_top)
This means that your GPU is not supported in kfd and will not work with ROCm.[11][12]
"PCI rejects atomics"
On GCN 4 GPUs, your CPU must support PCIe atomics and the slot that the GPU is in supports at least PCIe 3.0.[13] If these requirements are not met, you will encounter this message:
# dmesg | grep kfd
kfd kfd: amdgpu: skipped device 1002:67e3, PCI rejects atomics 730<0
You can check if your CPU supports PCIe atomics by running this command:
grep flags /sys/class/kfd/kfd/topology/nodes/*/io_links/0/properties
If your CPU supports PCIe atomics (the result being 1), change the slot that the GPU is in, it may have lanes coming from the chipset and not the CPU.
MCLK (pp_dpm_mclk) being locked at MAX (875Mhz or 1000Mhz) or MIN (96Mhz)
On high resolutions and refresh rates, the MCLK (VRAM / memory clock) values may be locked at the highest clock rate (875Mhz or 1000Mhz) [14] [15], causing higher GPU idle power draw.
In some cases, MCLK values may be locked at the lowest clock rate (96MHz), causing low performance in games [16] [17].
When using variable refresh rate technology (such as FreeSync), the problem may also manifest, particularly being locked at the lowest clock rate. [18]
Those problems are likely due to a monitor not using Coordinated Video Timings (CVT) with a low V-Blank value for the affected resolutions and refresh rates. See this gist for a workaround.
Failure to suspend to RAM
The amdgpu kernel module tries to buffer VRAM in RAM when the system enters S3 to prevent memory loss through VRAM decay which is not sufficiently refreshed.
If you are using a lot of VRAM and are short on free RAM this can fail despite sufficient SWAP memory would be available, because the IO subsystem might have been suspended before.
You will see something like:
kernel: systemd-sleep: page allocation failure: order:0, mode:0x100c02(GFP_NOIO|__GFP_HIGHMEM|__GFP_HARDWALL), nodemask=(null),cpuset=/,mems_allowed=0 kernel: Call Trace: kernel: <TASK> kernel: dump_stack_lvl+0x47/0x60 kernel: warn_alloc+0x165/0x1e0 kernel: __alloc_pages_slowpath.constprop.0+0xd7d/0xde0 kernel: __alloc_pages+0x32d/0x350 kernel: ttm_pool_alloc+0x19f/0x600 [ttm 0bd92a9d9dccc3a4f19554535860aaeda76eb4f4]
As a workaround, a userspace service can ensure to allocate enough RAM for the VRAM to be buffered by swapping out enough RAM before the system is suspended.
Wrong GPU clocks causing multiple issues
There is a bug in the amdgpu module, due to which the video core frequencies can be higher than those declared by the manufacturer, which can cause system instability during the game, when exiting sleep, when rebooting.
The problem has been noticed on RDNA 3 GPUs (7XXX Models) [20] [21] [22].
In dmesg you can see logs like theese:
amdgpu: [gfxhub] page fault (src_id:0 ring:40 vmid:6 pasid:32830) amdgpu: in process GameThread pid 100056 thread vkd3d_queue pid 100468) amdgpu: in page starting at address 0x0000000218a36000 from client 10 amdgpu: GCVM_L2_PROTECTION_FAULT_STATUS:0x00641051 amdgpu: Faulty UTCL2 client ID: TCP (0x8) amdgpu: MORE_FAULTS: 0x1 amdgpu: WALKER_ERROR: 0x0 amdgpu: PERMISSION_FAULTS: 0x5 amdgpu: MAPPING_ERROR: 0x0 amdgpu: RW: 0x1
If you have similar problems, check the maximum frequency of the video core in the system with what is stated by the manufacturer. To decrease maximum frequency, refer to #Overclocking.
AMD dedicated GPU HDMI freezing issue on Wayland
As an example, the ASUS G14 2022 laptop which as has AMD CPU and dedicated AMD GPU. The most successful approach requires to use armor crate on Windows to enforce dGPU Ultimate power options. It's switching GPU order and laptop internal power policies. Since that change HDMI should be working but user is going to experience separate rendering for integrated GPU (which SDDM and Wayland somehow pick by default) and dedicated GPU. User can obviously add DRI_PRIME=0 it this case before launching any application but its not convenient. Extending configuration to presented one allows flawless experience in expense of shorter battery life when running on battery.
/etc/sddm.conf.d/hardware.conf
[General] DisplayServer=wayland [Wayland] CompositorCommand=kwin_wayland --drm --no-lockscreen --no-global-shortcuts Environment=DRI_PRIME=0
Additionally kernel command line should be extended with
amdgpu.runpm=0 amdgpu.modeset=1
Colors appear washed out and dim on laptops
Power-saving applications such as power-profiles-daemon and tuned have started to enable a feature known as Panel Power Savings (PPS).
PPS is a featured supported on Laptops in which the laptop's GPU is instructed to have a lower color accuracy in the name of saving power. This, however, leads to washed out colors whenever selecting more aggressive power-saving modes on the aforementioned power-profiles-daemon and tuned. Therefore, there is interest in disabling this feature entirely.
It can be done by setting the following kernel parameter to zero:
amdgpu.abmlevel=0
System freezes or reboots when idle
Issues with some PowerPlay features, such as GFXOFF can cause frequent, unrecoverable driver crashes[23]. They coincide with idle GPU usage on a multi-monitor setup, and especially waking up from sleep mode.
A well-known solution is appending a kernel parameter (as described in #Boot parameter) that disables PP_GFXOFF_MASK, for example amdgpu.ppfeaturemask=0xffff7fff - this particular one leaves all other (implemented and unimplemented) PowerPlay features enabled.
Alternative solutions rely on disabling more features than just GFXOFF:
- Disable PP_GFXOFF_MASK and PP_STUTTER_MODE with
0xfffd7fff, - Disable PP_GFXOFF_MASK, PP_STUTTER_MODE and PP_OVERDRIVE_MASK with
0xfffd3fff, - Disable PP_GFXOFF_MASK, PP_GFX_DCS_MASK and PP_OVERDRIVE_MASK with
0xfff73fff, - Disable every feature with
0(or0x0). This can be used if the cause of driver crashes is unknown.
You can create your own feature mask from amdgpu.ppfeaturemask=0x followed by an 8-character mask calculated with a hexadecimal bitwise calculator (example included). Start the mask with ffffffff (all bits enabled) XOR the feature to mask. You can keep "XORing" more features to the result. You can skip zeroes before the first non-zero character: for example, 0x8000 is equivalent to 0x00008000.
Make sure the parameter does not get removed during kernel updates.
HDMI 4K capped at 120hz
Due to licensing issues the mesa driver cannot support HDMI 2.1. You must use DisplayPort. If your display does not support DisplayPort, some users have reported success with converter devices that take DisplayPort input and output HDMI 2.1 signals.