Ryzen

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 or for Zen 3 CPUs.

Power management, undervolting and overclocking

Compiling a kernel

See Gentoo:Ryzen#Kernel on enabling Ryzen support.

Troubleshooting

Random reboots

See Gentoo:Ryzen#Random_reboots_with_mce_events if you are experiencing random reboots.

With Ryzen 5000 series, particularly the higher-end models of 5950X and 5900X there seem to be some slight instability issues under Linux, related possibly to the 5.11+ kernel, as shown by this kernel bug. After investigating and reading reports on the Internet I discovered that out of the box, Windows seems to run the CPUs at higher voltage and lower peak frequencies, compared to the stock linux kernel, which depending on your draw from the silicon lottery could cause a host of random application crashes or hardware errors that lead to reboots. You will recognise those by dmesg logs that look like:

kernel: mce: [Hardware Error]: Machine check events logged
kernel: mce: [Hardware Error]: CPU 22: Machine Check: 0 Bank 1: bc800800060c0859
kernel: mce: [Hardware Error]: TSC 0 ADDR 7ea8f5b00 MISC d012000000000000 IPID 100b000000000 
kernel: mce: [Hardware Error]: PROCESSOR 2:a20f10 TIME 1636645367 SOCKET 0 APIC d microcode a201016

The CPU ID and the Processor number may vary. To solve this problem you need to supply higher voltage to your CPU so that it is stable when running at peak frequencies. The easiest way to achieve this is to use the AMD curve optimiser which is accessible via your motherboard's bios. Access it and put a positive offset of 4 points, which will increase the voltage your CPU is getting at higher loads. It will limit overclocking potential due to higher heat dissipation requirements, but it will run stable. For more details check this forum post. When I did this for my 5950X, my processor stabilised and the frequency and voltage ranges were more similar to those observed under windows.

Screen-tearing (APU)

If you are using Xorg and are experiencing screen-tearing, enabling the "TearFree" option will fix the problem.

/etc/X11/xorg.conf.d/20-amdgpu.conf
Section "Device"
    Identifier "AMD"
    Driver "amdgpu"
    Option "TearFree" "true"
EndSection

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 as a kernel parameter where the command just prints your CPU's threads. For this option to be applied, you need a compiled kernel with option (like ).

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 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 helped. Before using it, 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 added.

In some cases, kernel parameter pci=nomsi fixes the issue.

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 your BIOS settings for your motherboard and search for an option labeled 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 BIOS or adding to your kernel command line arguments.

gollark: I would also need exclusive use of several supercomputers for several years to precompute everything in the first place.
gollark: I can't actually buy 10 trillion multi-terabyte hard disks and ship them to every user, you see.
gollark: I have enough storage capacity available to hold maybe 1e13 bits at home.
gollark: Even if I'm off by 6 OOM, 3.7e26 bits is *not tractable*.
gollark: The board state can be encoded in 101.4 bits. The optimal position for that board state can be encoded in a further 6 bits. This gives us 107.4 bits per state.

See also

This article is issued from Archlinux. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.