Stabilizing Ubuntu 16.04 on Ryzen
Update 9th May 2018
I've upgraded my system to Ubuntu 18.04 (fresh install) and it just works without me having to perform any of these steps. If you can, just use Ubuntu 18.04 instead of 16.04.
Original Post
I've had stabilitiy issues on my Ryzen machine for quite some time now and I've just put up with them as they weren't too frequent.
This weekend I "downgraded" from Ubuntu 17.04 to Ubuntu 16.04 LTS because 16.04.3 is now out with the 4.10 kernel which I installed directly to, rather than installing and then upgrading. This gets me back on the LTS line with a later kernel, so I thought the stability issue would have been resolved, but ufortunately it seemed to have gotten worse, freezing several times whilst I was moving KVM guests around.
To try and address the issue, after having updated the bios firmware on my Asus prime B350-Plus yet again (3rd time now), I disabled c-states after a suggestion found online. I thought this had resolved it as the system lasted quite a while before it froze again (hard to prove a negative). After that, I disabled SMT after reading this post.
The system hasn't crashed since (fingers crossed). Hopefully when Ubuntu 18.04 LTS comes around these issues will have been resolved, or another firmware update will do the trick.
I'll be sure to update this post if it crashes again or perform any additional steps. Let me know if this worked for you or if you are still having problems. Be sure to mention your distro and kernel version.
Update 24th August 2017
Woke up and found that the server still had the issue so it appears that disabling c-states and SMT alone is not enough.
Status: Still unstable.
Disabling ASLR
After reading a few comments saying that disabling ASLR prevents one of the types of crash, I decided to disable it.
Update 5th October 2017
I just published a tutorial on building custom kernel to improve stability.
Status: Stable (so far no crashes).
References
- bugs.launchpad.com - Ryzen 1800X freeze - rcu_sched detected stalls on CPUs/tasks
- STH - AMD Ryzen with Ubuntu – Here is what you have to do to fix constant crashes!
- Hard Forum - How to Stabilize Your AMD Ryzen Memory and CPU Overclocking Attempts
- bugs.launchpad.com - Ryzen 1800X freeze - rcu_sched detected stalls on CPUs/tasks Edit
- Level1Techs.com - [Solved] Linux is unstable ever since I upgraded to Ryzen
- Level1Techs.com - Custom Ubuntu Distro For Ryzen Installations
First published: 16th August 2018