Ryzen
Ryzen is a brand of microprocessors manufactured by Advanced Micro Devices (AMD). This article covers system configuration and troubleshooting information for different generations of the CPU.
Enable microcode support
Install the amd-ucode package to enable microcode updates and enable it with the help of the Microcode page. These updates provide bug fixes that can be critical to the stability of your system. It is highly recommended to use it despite it being proprietary.
Tweaking Ryzen
Voltage, power and temperature monitoring
lm_sensors should be able to monitor temperatures out of the box. However, for more detailed information such as power consumption and voltage, zenpower3-dkmsAUR is needed. For GUI based monitoring tools, use zenmonitorAUR or zenmonitor3-gitAUR for Zen 3 CPUs.
Power management, undervolting and overclocking
- RyzenAdj — RyzenAdj is a command-line tool that can adjust power management settings for Ryzen mobile processors.
- amdctl — amdctl is a command-line tool for under/over clocking/volting AMD CPUs, currently supporting AMD CPU families 10h, 11h, 12h, 15h, 16h, 17h and 19h.
- ZenStates-Linux — ZenStates is a command-line tool to adjust the clock speed and voltage. A detailed setup example is given in Level1Techs forum.
- ryzen_smu — Ryzen SMU is a Linux kernel driver that exposes access to the SMU (System Management Unit) for certain AMD Ryzen Processors. Can for example be used for undervolting the 5800x3D (see this script as an example).
Compiling a kernel
See Gentoo:Ryzen#Kernel on enabling Ryzen support. The officially supported kernels have the required configuration by default.
Troubleshooting
System halts
Systems might halt under heavy or specific low loads, even after applying the fixes. Reset button or forced shutdowns don't work, peripherals powers off, video output might stop, and unplugging is the only way out of this state.
Reducing frequencies to within non-overclocked standards and increasing voltages of CPU or RAM helps, but might not fix the issue. A potential fix is to update the UEFI (also misnamed "BIOS updates"), and then apply the PBO+4 curve for more stability on higher frequencies. Per silicon lottery, some CPUs might need +6 or higher offsets.
Screen-tearing (APU)
If you are using Xorg and are experiencing screen-tearing, see AMDGPU#Tear free rendering.
Soft lock freezing
This bug is well known and is being discussed on bugzilla and launchpad. While the solution is not the same in all cases, this one helped some users. Add the output of this command echo rcu_nocbs=0-$(($(nproc)-1))
as a kernel parameter where the command nproc
just prints your CPU's threads. For this option to be applied, you need a compiled kernel with option CONFIG_RCU_NOCB_CPU
(like linux).
A different cause for the freezes is the power saving management indicated by c-states. The maximum power saving state c6 can cause problems. Adding the kernel parameter processor.max_cstate=5
helped in some cases but other users reported that the option is not applied and the c6 state is still entered. For them, this package disable-c6-systemdAUR helped. Before using it, modprobe msr
needs to be run in order to activate that kernel module.
Some laptops with Ryzen CPUs such as the HP Envy x360 15-bq100na may experience CPU soft locks which result in a frozen system. These can be avoided with the kernel parameter idle=nomwait
added.
In some cases, kernel parameter pci=nomsi
fixes the issue.
In some other cases, the issue is simply bad hardware, and warranty claiming the CPU for a new one may just solve your issues.
Freeze on shutdown, reboot and suspend
This seems to be related to the C6 c-state, that does not seem to be well supported (if at all) in Linux.
To fix this issue, go into UEFI Setup and search for an option labelled something like this: "Power idle control". Change its value to "Typical current idle". Note that these names are dependent on what the motherboard manufacturer calls them, so they may be a little different in your particular case.
Other less ideal solutions include disabling c-states in the UEFI Setup or adding processor.max_cstate=1
to your kernel command line arguments.