This past week, I tried a few more things to get my AMD PC to successfully build a bootable Linux image for my MinnowBoard. Then, I got my hands on a Microsoft Surface Pro.
Last week in Episode 38, I struggled with segmentation faults every time I ran a Yocto bitbake. I tried a whole bunch of different things, and then I began to suspect that maybe there was something wrong with my build machine. I had encountered segfaults on my AMD Ryzen 7 1700X based machine when I first got it, but then it went away when I RMA’ed the CPU. Could the same problem be manifesting itself again?
First, I decided to see if the problem was isolated to running a Linux VM within VirtualBox, as opposed to pure Linux. I had an installation of Ubuntu 16.04 on a Linux partition on my PC, so I fired that up again. Unfortunately, the problem persisted. I then upgraded to the most current LTS, Ubuntu 18.04.1 (Bionic Beaver), but still no luck. Whatever this is, it seems to be independent of the version of Ubuntu, or the kernel version.
If was time to fire up the same “Kill Ryzen” script that I used before in Episode 27 and see if that shed any light. Last time, Kill Ryzen clearly indicated that there were problems with the CPU (as per some of the articles written on this topic). This time, the symptoms are somewhat different; failures occur every time, rather than intermittently. But, I went through the same process to get the script, and then ran it, with the System Monitor in the background so I could see core utilization:
But this time, Kill Ryzen did not fail. I ran it for hours, and no crashes. So, there doesn’t seem to be a hardware problem here, or anything related to the AMD CPU, like I saw before. The root cause of the problem is something else: perhaps some basic Yocto incompatibility that I haven’t identified yet.
To further isolate the issue, my next step was to get my hands on an Intel x86 machine: the latest Surface Pro 6. Would I run into the same problem there? I loaded up VirtualBox on this machine with Ubuntu 16.04, and went through the same steps of installing the essential host packages, cloning poky, and building the image. And it worked this time!
Anyway, at least that has unblocked me from the challenges I was facing getting a successful build. Now, I can jump back into building debug images, debugging the kernel, and using SourcePoint to poke around.
But, first, I decided that I needed to learn more about Linux kernel development, and the Yocto framework as a whole. Over the last couple of weeks, as I struggled with building images, I realized that I needed a better foundation; I didn’t have the background knowledge needed to interpret the error messages and console logs I was looking at. Some of you with keen eyes may have noticed in the first image above that I was running Ubuntu 18.04 with kernel version 4.20.0-rc1+. This is actually not the right kernel to be using with this version of Ubuntu; 4.20.0-rc1+ is actually Greg Kroah-Hartman's staging tree repository. I’ll explain this in the next episode, but as a hint, I’ve been reading the Linux Kernel Newbies pages for some tips on the architecture of the kernel, and how to build, install and run kernels. I learned that Linux stores both old and new kernel versions, so you can boot into your old kernel if you run into issues with your new kernel. So, that’s what I did.
For those wanting to see more of the MinnowBoard, please stay tuned; I’ve had to get these builds up and running, before I could proceed with SourcePoint debug. If you can’t wait, and haven’t downloaded it already, you can read 31 chapters involving the Minnow in our MinnowBoard Chronicles eBook.