Friday, June 14, 2019

Adventures in non-Raspberry flavored cheap SoC boards

I was recently looking for a replacement for my old Odroid C1, which was serving as my local DNS server, but has basically become orphaned, because all of the Linux distributions I’m aware of for it, including Hardkernel’s official ones, are based on Debian Jesse, which is rapidly approaching EOL and already has had some of its package repos deprecated so updates are thin and the writing appears to be on the wall. My preferred distro was dietpi, but after cruising their forums a little, I found one where they said “we would roll a Stretch based image, but the one guy who has a C1 can’t find it” which made me realize that depending on that is setting myself up for failure at some point in the future anyway. Plus the maintainers of dietpi have irritated me twice now by first forcing an upgrade between versions via wipe and reimage about a year ago, and then inducing some bug that breaks my networking every time I do an upgrade in-place via their update mechanism (likely because they weren’t actively regression testing with my specific flavor of OS and hardware) which has resulted in me being stuck on the current version unless I do a clean install (again) because the upgrade now also fails due to the aforementioned expired repos.

A regular, current-gen Raspberry Pi is sort of the default answer here, because none of these support issues are a concern, but the fact that there is still no 64-bit version of Raspbian for the ARM64 (v8 and later) based machines, and the answers on most other pi-friendly distros sound a little too much like “compile your own” for my taste, I went looking at alternatives. Stumbled across the Atomic Pi not too long ago. Same basic price point as a Pi, but with a quad core Intel Atom and real (not USB2) Ethernet, plus built-in eMMC storage for the OS. Seems like pretty good news.

The slightly less good news is that it’s a different form factor than a Pi, so this isn’t exactly a direct drop-in alternative for whatever pi-based project you were planning.

Atomic Pi as shipped, with a RPi 2 in a case for size comparison


It’s also simultaneously more and less novice-friendly. More, in that it comes preloaded with an OS (Ubuntu 18.04 desktop) such that plugging it in will produce a functional computer right away without needing to buy storage and burn an image onto it. Less, because… well, about that whole “plug it in” part:

It has no typical onboard power interface. No micro-USB, no DC barrel connector. You need to feed it regulated 5vDC @3A, so in theory you could wire up something to use a micro-USB or USB-C wall wart charger but you’d have to include the right bits to convince the charger that it shouldn’t default to the 500mA that is USB’s failsafe output for things it can’t negotiate charge rates with. The options available are to buy and use the full breakout board, which has a molex (old-style hard drive power) connector on it, or the mini breakout board, which only exists to serve as a physical adapter to connect to the GPIO socket so you can plug in a DC barrel connector. The first seems less than optimal unless you already have a spare computer power supply laying around, and it’s not likely to be very efficient as a means to power something that small. Maybe if you want to power multiple Atomic Pis with one bench power supply that makes more sense. Otherwise I suppose maybe they expect you to just use a spare connector from another nearby computer and be ok with the dependency on the other machine? Or you can do what I did, and buy a set of jumper wires with male to male dupont connectors and a wall wart that includes a barrel connector with screw terminals. The instructions tell you to use 2 pins for each of positive and negative to ensure you don’t overdo the current draw on the tiny wiring.
Atomic Pi with dupont connectors and barrel connector for power

Also there is a serial port, but it requires wiring to a UART on the board unless you buy the full breakout board. https://www.digital-loggers.com/api_faqs.html#SerialPassword

The only case options I’m aware of are in the form of something you need to 3D print yourself, and because of the dupont pins, which connect on the bottom and stick straight out a good ½” from there, it has to hang off the edge of whatever it’s sitting on, so I suspect even the case design the manufacturer is providing will require modification. Haven’t spent the time yet to investigate this since it’s going to live in my utility room and doesn’t really need a case at the moment anyway. 

close-up of dupont connectors on bottom

Initial boot does look for PXE, both IPv4 and IPv6, so I suspect the best bet is to bootstrap it headlessly is via PXE and push config to it directly. 

Initial access if you’re not doing PXE requires keyboard and mouse (and there’s only one USB port, so you need a hub too) and HDMI. Login splash screen defaults to user atomicpi, but the password is unique per device, so you can’t just figure out what IP it got in DHCP and ssh directly in. The password is displayed in a box next to the login. Type it in and you get presented with typical Ubuntu desktop.

The instructions they supply don’t tell you to write the password down, but you really want to if you want to do anything that requires sudo. I had to log out and back in to get it. It’s apparently stored in a file somewhere, but I can’t remember which one (It triggered a “hey what should I do” prompt in apt-get upgrade because it wanted to overwrite the file with the stock maintainer’s version for some package. Also I was having trouble doing anything in the GUI that required sudo auth, because it kept asking for root, and wouldn’t accept the atomicpi user’s password, nor would it let you change the user it was authenticating. Sudo worked just fine with the atomicpi user's password from CLI.

The preinstalled version of Ubuntu has docker running by default, but didn’t have traceroute, dnsutils, or fail2ban preinstalled, so part of your hardening includes throwing the necessary switches to disable docker if you’re not using it for your application. Since this is Ubuntu desktop and not server, it's also missing netplan, the new hotness for configuring IPs, meaning you're still (for now) editing /etc/network/interfaces like you'd expect to, and I threw the necessary switch to tell linux not to rename eth0 to something stupid.

Also I am starting to suspect that it doesn’t like having the HDMI cable unplugged and replugged, because while temps were fine and it has been otherwise stable, I have managed to get it to lock completely up on me twice when trying to switch back to the desktop by switching HDMI cables on the back of my monitor that only has one HDMI input.

Network performance:

Iperf3 shows 770mbps throughput between local servers on the same LAN, so the GE is pretty stout for a SoC system like this, though I was expecting a little closer to linerate than that.

Disk performance:

pi@rpi3b+:~ $ sudo hdparm -Tt /dev/mmcblk0 (technically a Samsung Evo 32G microSD MB-ME32GA/AM, claimed 95MB/s)

/dev/mmcblk0:

Timing cached reads: 1408 MB in 2.00 seconds = 704.05 MB/sec
Timing buffered disk reads: 68 MB in 3.02 seconds = 22.48 MB/sec

atomicpi@atomicpi:~$ sudo hdparm -Tt /dev/mmcblk0
(built-in eMMC)
/dev/mmcblk0:


Timing cached reads: 2116 MB in 2.00 seconds = 1059.33 MB/sec
Timing buffered disk reads: 466 MB in 3.01 seconds = 154.90 MB/sec

Temperature:

With all 4 cores at 100% the temp hovers at 57-59°C on each core using only ambient air cooling via the heatsink at typical room temp (72°F).

Amusingly, putting the device under an exhaust fan from another (fairly lightly loaded) device such that there’s warmer than room temperature air moving across the very large heat sink drops the temps under load by almost 15°C. Appears that there’s a good bit of cooling capacity available if you wanted to put this in a slightly less temperature controlled environment without it throttling, especially if you’re willing to add a fan, though there are no mounts on the heatsink for a fan, so chances are you'd have to design the case with that in mind.

My typical CPU benchmark is the distributed.net client, running rc5. Been running it on various computers since I was in college, so I have lots of comparisons available.

The rate on this box is 15.09 Mkeys/sec. Intel is being weird about TDP and quoting “SDP”, but it appears like TDP might be 4W, which appears to mean that it’s roughly equivalent in raw numeric horsepower to a 14 year old AMD, but at less than 1/10th the power draw.

By comparison, here are some other boxes in the fleet:

ODroid C1 Amlogic S805 quad core, ca 2015, 8.6 Mkeys/sec (32 bit mode)
Pi3b+ (Cortex-A53 quad core), 9.4 Mkeys/sec (32 bit mode)
Pi4b (Cortex-A72 quad core), 11 Mkeys/sec (32 bit mode)
AMD Athlon 64 X2 4800, 2 core ca. 2005, 110W TDP, 17 Mkeys/sec
Nvidia Geforce 9500, ca 2008, 50W TDP, 20 Mkeys/sec
Intel i7-2600 4 core + HT, ca 2011, 95W TDP, 44 Mkeys/sec
Intel i7-8750 6 core + HT, 45W TDP 303 Mkeys/sec
Intel i7-9600 8 core, no HT, 65W TDP, 87 Mkeys/sec
Intel UHD Graphics 630, 96 Mkeys/sec - yes, Intel has implemented OpenCL on their on-chip GPU such that it can now run the client and this is a simultaneous number with the above i7.
Nvidia GTX 660, 130W TDP, ca. 2012, 450 Mkeys/sec
Nvidia GTX 1050Ti, 75W TDP, ca. 2016, 1.6 Gkeys/sec
AMD R9 270, 150W TDP, ca. 2013, 2 Gkeys/sec (!!)

No comments: