Solving First Generation AMD Ryzen Freezes and Reboots in Linux

Early versions of the original AMD Ryzen CPUs contain bugs which affect Linux. I have a first generation AMD Ryzen 5 1600 machine that primarily ran Windows with no issues for many years, however on switching the machine to Linux it would frequently completely freeze i.e. the mouse pointer would freeze, or it would black screen. Another problem was occasional rebooting, perhaps once a week. The problem was not related to temperature as this would happen at low temperatures when the CPU was idling.

This issue is believed only to relate to first generation Ryzen CPUs (1000 series) released around 2017 and is subsequently fixed in later models.

Solution

The solution that worked for me was to disable “OpCache” and “C States” in the BIOS (Core C6 state under CPU features). This completely solved the problem and the machine had no further issues. Disabling OpCache solved the pointer freeze and black screen issue. Disabling C States resolved the random reboot problem. Both of these features relate to power saving and do not cause any issues with the operation of the CPU if disabled.