home | hardware | software | misc | about | rss

OpenBSD on the HiFive Unmatched

23-Oct-2021

The HiFive Unmatched

Year: 2021

CPU: 4 U74 1.2 GHz cores, 1 embedded S7 core

Graphics: AMD Radeon R9 270 2 GB

RAM: 16 GB

Storage: 512 GB Western Digital SN730 NVMe

"But can it run Chrome?": No

dmesg

My desktop's power supply died, and rather than replace the ill-fated PSU I decided to go with something different. OpenBSD's new riscv64 port looked interesting, so I got a HiFive Unmatched to see how it would work as an OpenBSD desktop.

The HiFive Unmatched provides a quad core, 1200 MHz, 64 bit RISC-V SoC in a mini-ITX form factor. It has a plentiful 16 GB of RAM, and supports a M.2 2280 NVMe drive. It also has a full length PCI-e slot, though it is internally only an 8 lane slot. This means that unlike some other development boards, this is well-equipped to serve as a desktop replacement, if you are willing to deal with some quirks.

For this build, I went with a Metallic Gear Neo Mini V2 mini-ITX case, an EVGA 850w Gold PSU scavenged from an old build, and an AMD R9 270 GPU. You definitely don't need an 850w PSU; I just happened to have one.

The case is quite nice, and though it has little room for extra cables, it does fit a full length GPU comfortably and has adequate airflow. The Unmatched does not require much power, nor does it run hot, so the cooling provided by the case's included 120mm intake fan and a 140mm exhaust fan I pulled off an older machine is more than enough. The Unmatched comes with a small, but busy 25mm CPU fan that is just loud enough to be irritating. Some searching shows that folks have replaced this with a 40mm Noctua to reduce noise, and depending on how annoyed I get, I may do this in the future. Temps from the two sensors exposed to sysctl have been about 34-35 Celsius, so cooling is not a problem in this case.

I used OpenBSD 7.0 for this install and simply following the instructions worked fine. There is little difference in the installation process apart from the presence of an SD card. The Unmatched comes with a micro SD card preloaded with u-boot and a small Linux system with XFCE4. This SD card must be inserted while booting the system from a USB or NVMe drive because it will boot the SD first, then load the OpenBSD bootloader. There are some DIP switches on the board that can override the boot order, but by default they are setup to boot the SD card first and I was not adventurous enough to change this.

The version of the SiFive Freedom U SDK that the included SD card came with was 2021.03.00 and I had some trouble connecting to the serial console from OpenBSD. I decided to update this to version 2021.09.00. I wanted to keep the provided SD card as a backup though, so flagrantly ignoring the warnings in SiFive's documentation about SD card compatibility, I tried a variety of micro SD cards I had sitting around, and unsurprisingly none of them worked. The board is very picky about which SD cards it will boot, and my Samsung EVO and other random cards did not make the cut. I ended up just flashing the new image over the included SD card and the serial console worked after that.

I tried a couple GPUs with OpenBSD. An RX 5700XT and an RX 460 did not work with amdgpu. The R9 270 works great with radeondrm though, and is capable of driving a 4k display. X11 runs smoothly with this setup and has been quite stable. The built-in Linux distro on the SD card did work with the RX 460, though I did not try with the 5700XT.

The onboard Cadence ethernet controller is supported by cad(4), but it is not currently reliable and you are advised to use a USB ethernet adapter, or USB wireless. I gave the onboard ethernet a try, and it did not work. I'm using an Atheros AR9271 USB wireless adapter and it works fine. My usual go-to USB, a Buffalo WLI-UC-GNM supported by run(4), had errors trying to load the firmware on this board.

Performance of the 4 1200MHz cores is capable, if not overwhelming. It feels significantly faster than a Pinebook Pro running OpenBSD, but the Pinebook Pro currently does not have GPU acceleration on OpenBSD, so the Unmatched has a huge advantage here. Having NVMe storage is a real benefit too, and the system does not feel sluggish at all.

Package selection is still rather limited for riscv64, so you may not find what you want. It's not much worse than macppc however. Webkit based browsers such as Midori and Surf are the only javascript-capable web browsers available at this time, but I am using Netsurf, which is my favorite browser anyway. It does all I need from a browser and is quite fast. The webkit browsers do function, though much slower.

As this is a very new port of OpenBSD, support is not complete and bugs can be expected. I foolishly decided to enable soft updates just to see what would happen, and what happened was that it immediately experienced a lockup. I believe it's related, though it is hard to prove and I could not get any debugging info as the thing was locked up solid. This has not happened again since disabling soft updates. It later also had trouble relinking the kernel and left the system with a borked MP kernel. I ended up booting to the single processor kernel and downloading the MP kernel again off a mirror to replace it. If you are reading this from The Future, these bugs may have been ironed out.

I don't have many complaints apart from the noisy CPU fan and an IO shield that was absurdly frustrating to install. It's remarkable how well this runs on OpenBSD already given the short amount of time the riscv64 port has been in development, and the devs have my thanks for putting in the work here.