When AMD launched the first-generation Ryzen 5 1500X CPU, I assembled my initial Ryzen build. At the beginning, I had Windows 10 as the operating system and used it primarily for gaming purposes. The performance was satisfactory, but later on, I decided to switch to Arch Linux. The transition proved to be somewhat complicated as there was no official installation script similar to archinstall available at that time.
On the second day after the switch, while engaged in video rendering with Kdenlive, an unexpected occurrence took place. The system suddenly froze and restarted on its own. This incident perplexed me, and I attempted to replicate it without success due to its sporadic nature. The error log recorded in journalctl
displayed the following content:
I thought It had something to do with microcode, but later I realised that I was wrong. The microcode package was already installed, so it has to be the kernel or CPU. After debugging stackoverflow and the Archlinux forum, I found a working solution to this problem.
To fix random reboot on linux for Ryzen 5 series
add these 2 kernel parameters —
- idle=nomwait
- processor.max_cstate=5
If you use GRUB bootloader, you can edit /etc/default/grub
and append your kernel options between the quotes in the GRUB_CMDLINE_LINUX_DEFAULT
line:
GRUB_CMDLINE_LINUX_DEFAULT="loglevel=3 idle=nomwait processor.max_cstate=5"
And then automatically re-generate the grub.cfg
file with:
# grub-mkconfig -o /boot/grub/grub.cfg
Finally, it fixed the issue; I’ve never had this weird freeze and reboot issue since this configuration. It may work on Ryzen 5/7/9 processors.