Now Reading
AMD Ryzen with Ubuntu – Here is what you have to do to fix constant crashes!
10

AMD Ryzen with Ubuntu – Here is what you have to do to fix constant crashes!

by Patrick KennedyMarch 2, 2017

At the AMD Tech Day I had the opportunity to get some hands-on time with AMD Ryzen and a few different systems. Thanks to a wonderful Linux-Bench version on a USB 3.0 stick, I was able to get numbers to publish. It was a painful process and required several reboots until I got it all working. After hammering the four test configurations we have, I came to the conclusion that the actual issue was not a pre-retail chip. Instead, it is just running AMD Ryzen using the current version of Ubuntu. We had issues with Ubuntu 14.04.5 LTS (the current latest) that is the STH standard. We also had issues with Ubuntu 16.04.2 LTS. These were present in both Desktop and Server versions of Ubuntu. That is enough different configurations where we are now satisfied that it is not a fluke, but instead an issue with AMD Ryzen and older kernels.

Update: We published Stop constant CentOS 7.3 crashes with AMD Ryzen using Kernel 4.10 as a piece for those looking to fix issues on CentOS 7.

AMD Ryzen 7 1700 And Ryzen 7 1700X Twin Test Platforms

AMD Ryzen 7 1700 And Ryzen 7 1700X Twin Test Platforms at STH

As you can see, we even built two test platforms with different CPUs just to ensure it was not a CPU model-specific issue we were seeing. One had the Ryzen 7 1700 and the other had a Ryzen 7 1700X, both of which are headed to our DemoEval lab. We are using the ASUS Prime B350-Plus motherboard in the twin systems as it was different than the X370 boards we used previously.

AMD Ryzen with Ubuntu – Why your system is crashing

There have been numerous reports of SMT issues and it is a known fix that got rolled out in the Linux 4.10 and 4.11 kernels as we mentioned in our release piece. We have four systems up already with different CPUs and motherboards that are exhibiting this problem. We have tried simultaneous wall clock timers to see when the systems fail but it does not seem to be a specific time trigger. Here is an example of what you will see at some point running AMD Ryzen with Ubuntu 14.04.5 AMD64 Server:

AMD Ryzen 7 1700 Ubuntu 14.04.5 Kernel Issues

AMD Ryzen 7 1700 Ubuntu 14.04.5 Kernel Issues

At this point using reboot methods such as ctrl + alt + del will likely not work and will require a hard reboot.

How to fix AMD Ryzen with Ubuntu

Since as of release day (2 March 2017) the latest stable kernel posted on kernel.org is 4.10.1, which was released on 26 February 2017, we can use that to upgrade our Ubuntu installations and get a working, stable, system. Here is what you can do:
nano kernelupdate.sh

In that paste the following text:
#!/bin/bash
cd /tmp
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.10.1/linux-headers-4.10.1-041001_4.10.1-041001.201702260735_all.deb
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.10.1/linux-headers-4.10.1-041001-generic_4.10.1-041001.201702260735_amd64.deb
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.10.1/linux-image-4.10.1-041001-generic_4.10.1-041001.201702260735_amd64.deb
echo Everything is downloaded. Time to install.
sudo dpkg -i linux-headers-4.10*.deb linux-image-4.10*.deb
echo Type sudo reboot to restart your system with the new kernel.

Now hit control x to exit and then y to save changes.
bash kernelupdate.sh

AMD Ryzen 7 1700 On Kernel 4.10.1

AMD Ryzen 7 1700 On Kernel 4.10.1

Let that download. It will ask you for sudo credentials. After it is complete, do sudo reboot as the screen will say to reboot the system and use your new Linux 4.10.1 kernel. You can verify using uname -r

Final Words

One plus side to this is that the newer kernel version also is giving us significantly more performance. Our advice, use whatever Linux flavor you want, but upgrade it to the latest stable kernel immediately if you want to use AMD Ryzen. Since we will undoubtedly get the question, this does not mean that the chips are not x86 and AMD64 compatible. It is simply an example of where development has been focused on how Intel does things. With AMD’s implementation, we simply need to apply an existing update.

About The Author
Patrick Kennedy
Patrick has been running ServeTheHome since 2009 and covers a wide variety of home and small business IT topics. For his day job, Patrick is a management consultant focused in the technology industry and has worked with numerous large hardware and storage vendors in the Silicon Valley. The goal of STH is simply to help users find some information about basic server building blocks. If you have any helpful information please feel free to post on the forums.
10 Comments
  • March 2, 2017 at 6:14 pm

    It would be really great if you can file a bug about it here, so the fix can be landed into 14.04 / 16.04 / 16.10 as necessary – best if you can file so that you can potentially test the fix:
    https://bugs.launchpad.net/ubuntu/+source/linux/+filebug

  • Mike Traffanstead
    March 3, 2017 at 6:47 am

    Patrick, curious if there was a reason why you didn’t add the ppa to apt-sources and then pin the version with apt hold? Has the advantage of notifying you when newer versions are available (I’m sure there will more Ryzen fixes coming down the pipe). Either way thanks for the update.

  • Lukas
    March 3, 2017 at 10:01 am

    Thanks for this info servethehome. I am planning to build a home server/workstation with Ryzen running Ubuntu so I am glad you published this. I would like to have build with ECC memory, since Ryzen supports it and one of my use cases is having ZFS raid in this home server. It would be great, if you were able to put some built tohgether and test what components works seamlessly together in regard of ECC memory, motherboard and pherhaps NVMe disk running Ubuntu as main OS on Ryzen? Just a suggestion, but I would very appreciate it, and probably other readers as well. Thank you very much for your site.

  • Peter Vink
    March 4, 2017 at 12:36 am

    Indeed. as Trent mentioned, please keep this central and file the bug at https://bugs.launchpad.net/ubuntu/+source/linux/+filebug

    If everyone would post this on their own blog, it doesn’t help the community to get issues solved. All of us have to search over the internet if someone fixed it and mentioned it on his or her blog.

  • Brian
    March 11, 2017 at 12:42 am

    I happened across this article today as I was setting up lubuntu-16.04.1-desktop-amd64 on my new Ryzen 7 1800X box, and ran the script to update the kernel. It showed the correct 4.10.1-041001-generic kernel after rebooting. After this, I left it alone for a while, running HandBrake, and came back to find the machine completely unresponsive and not outputting a video signal. I power cycled it, and found in /var/log/syslog.1 a steady stream of hours of those errors as described above. Despite having updated, this error still seems to be there.

    Anyone have any suggestions? I realize now I didn’t install the very latest Ubuntu available (I had the image lying around from last month). I’m really hoping I didn’t build a flakey system.

    • Frantisek
      March 11, 2017 at 2:53 am

      In my experience, it still happens. With 4.10.1 i had crashed for me every 2-3 hours, with 4.11-rc1 it crashed after 5 or 6 hours, referncing nouveau; i blacklisted it, running another uptime test (at 2 hours exactly right now). It will take some time for the platform to mature enough for 24/7 Ryzen functionality.

      • Brian
        March 11, 2017 at 8:58 am

        Thank you. Makes me feel better knowing it isn’t just me at least.

        I didn’t want to install Windows on this machine (forced reboots and CPU/Memory-hogging built-in processes). But if that is what it takes to be stable today, I just have to bite the bullet.

        • Brian
          March 11, 2017 at 9:32 pm

          Windows 10 made it stable. At least for the last 12 hours of continuous HandBrake encodes. It seems to be performing roughly 10% better, too. I was getting about 22.5 FPS with 1080p H.264 -> H.265 Medium q23 on Linux. 25.5 FPS on Windows. I’m sure things will even out in the upcoming months, but for anyone pondering a Ryzen Linux build today, I must advise against it.

    • March 11, 2017 at 10:04 pm

      Brian is that lununtu or Ubuntu?

      We have 6x Ryzen systems setup (3 for our lab and 3 in DemoEval) and both with Ubuntu 16.04.2 and CentOS 7.3 with 4.10.1 they have been very stable. We have been running different workloads at 100% utilization and have not seen crashes.

      • Brian
        March 13, 2017 at 9:32 pm

        I used lubuntu 16.04.1 as specified in my earlier post (I try pretty hard not to typo important details — a virtue more people should share). Something about that may have been what made it unstable — either the fact it was lubuntu or the fact it was a 16.04.1 disk image (not 16.04.2) that I used before upgrading the kernel.

        Either way, Windows 10 has been perfectly stable since I installed it two days ago. As much as I wanted to reduce my dependence on Microsoft’s OS, installing it solved a number of other problems I was having (Teamviewer unable to connect to its servers, unstable x11vnc every other reboot, SMB permission problems), so I’m just going to stick with it. There is no substitute for experience, and I have vastly more experience bending Windows to my will than I do with Linux.

Leave a Response