Getting RISC-V (again): Milk-V's Mars CM

Milk-V Mars CM with Box

tl;dr: No, it's not a replacement for a Raspberry Pi Compute Module 4. But yes, it's an exciting tiny RISC-V board that could be just the ticket for more RISC-V projects, tapping into the diverse ecosystem of existing Compute Module 4 boards.

This tiny computer is the Mars CM. It's the exact same size and shape as the Raspberry Pi Compute Module 4. It should be a drop-in replacement. And on its box it says it supports 4K, Bluetooth and WiFi, and has gigabit Ethernet. It's also supposed to have PCI Express!

Why is this thing important? Well, right now at least, it's still hard to buy Compute Modules. There are tons of really cool projects that use them.

This blog post is a lightly-edited transcript of video embedded above. Watch the video for the full context.

But like I said, it's hard to find one. Could you just drop a Mars CM in its place?

That's the hope. I mean, feldspaten got his working on a Turing Pi 2 cluster board. So if you have a CM4 board, and can't find a CM4 for it... maybe this is an option?

I actually tested the same processor the Mars CM uses—the JH7110—on the StarFive VisionFive 2. And it's not a bad little processor, it just has some growing pains! Make sure to read my post on the VisionFive 2 for more background on RISC-V and the JH7110 specifically.

Milk-V Mars CM

I bought the Mars CM for $54 plus $12 shipping on ARACE—I bought the model with 4 gigs of RAM and 16 gigs of built-in eMMC storage, here on the back.

Bringup

I plugged the Mars CM into my Compute Module 4 IO Board, and after a little while, the little green LED on the Mars CM started flashing, two blinks every other second. But no HDMI output.

Maybe I needed to download an OS?

So I went to the URL on the side of the box (http://milkv.io/docs/mars-cm), and... well, I guess I'm one of the first people to get one of these things, because the page for it isn't even up yet! (Still isn't, at the time of this writing.)

So I browsed around, and they already have a plain old Mars, so I went to that board's Getting Started guide and I downloaded their release of Debian. It looks like it's based on the VisionFive image, so hopefully it works out of the box.

I flashed it to a microSD card with Etcher, stuck the card into the Compute Module 4 IO Board, and rebooted, and...

Well, same thing happened. On the Pi Compute Module, if you have an eMMC module, the microSD card is ignored completely, so that might be the case here, too.

But seeing as the only page that was visible in the Mars CM docs was an Intro page, I decided to head over to the MilkV community forums and see if anyone else had the same problem.

And... it turns out the Compute Module subforum was completely empty!

So I did what any good noob would do and started a new topic, asking how to get this thing going.

I also started a new issue in my sbc-reviews repo to track my work.

And luckily, I wound up trying out serial console access. I have this little USB to UART adapter, and following the Mars documentation, I crossed my fingers and hoped the GPIO pinout was the same.

And luckily it was!

OpenSBI Boot UART Serial Console Mars CM

I launched CoolTerm and watched the serial output. It looks like it uses the default password milkv for the root user, and now that I'm logged in, I grabbed the IP and tried to SSH in.

Unfortunately, the default SSH config is a bit too secure for that.

So I had to run the one-line commands below over serial to make it so I could log in over SSH:

sed -i '/PasswordAuthentication yes/s/^#//g' /etc/ssh/sshd_config
sed -i '/PermitRootLogin prohibit-password/s/^#//g' /etc/ssh/sshd_config
sed -i '/PermitRootLogin prohibit-password/s/PermitRootLogin prohibit-password/PermitRootLogin yes/g' /etc/ssh/sshd_config

systemctl restart sshd

I was finally in!

Exploring the board

Apt gave me a few issues installing things initially, but here's the neofetch output:

       _,met$$$$$gg.          root@starfive 
    ,g$$$$$$$$$$$$$$$P.       ------------- 
  ,g$$P"     """Y$$.".        OS: Debian GNU/Linux bookworm/sid riscv64 
 ,$$P'              `$$$.     Host: Milk-V Mars CM eMMC 
',$$P       ,ggs.     `$$b:   Kernel: 5.15.0 
`d$$'     ,$P"'   .    $$$    Uptime: 30 mins 
 $$P      d$'     ,    $$P    Packages: 1324 (dpkg) 
 $$:      $$.   -    ,d$$'    Shell: bash 5.2.2 
 $$;      Y$b._   _,d$P'      Terminal: /dev/pts/0 
 Y$$.    `.`"Y$$$$P"'         CPU: (4) @ 1.500GHz 
 `$$b      "-.__              Memory: 426MiB / 3874MiB 
root@starfive:~# 
   `Y$$.
     `$$b.
       `Y$$b.
          `"Y$b._
              `"""

These are the basic specs in Linux. I started compiling all this data into my sbc-reviews repo, so go check that out if you want all the gory details.

Before I benchmarked the CPU, I wanted to see if the PCI Express interface worked at all... and it does! I was able to get a Kioxia SSD running without any tweaking. It reports as PCIe Gen 2, so it could, in theory, get 400 megabytes per second.

But in this case, all I could get was 150 to 250 megabytes per second. Same as the VisionFive 2.

So it's nice to have working PCIe, but it's limited a bit by the processor.

Performance

But to test the processor's general performance, I ran Geekbench. It runs on Arm, X86, and even RISC-V in preview, so I downloaded it, but then I couldn't expand it!

The default OS image only gives you 4 gigs of disk space. So I had to follow this process to recreate the disk partition and expand it with a utility called resize2fs.

It's a little nerve-wracking, even if you've done a lot of command line disk partitioning stuff before. Hopefully they can get automatic disk resizing working like Raspberry Pi and other SBC vendors.

I also was glancing around on the VisionFive 2 site, and it looks like it might not be a good idea to upgrade the system, at least for the VisionFive. That same advice applies to the Mars CM too for now.

I mean, I get it, it's early days for RISC-V, but when I read documentation and it says "don't update," that raises a few alarm bells.

But getting back to Geekbench, I could finally run it. It took a very very long time, but here's the result:

  • 74 single core
  • 219 multi core

That's... not amazing. And it illustrates two things: one, that some of the tests Geekbench uses are not quite optimized for RISC-V. And two, even with those optimizations, this CPU is just a lot slower than even older high-performance Arm cores.

Geekbench 6 performance Mars CM vs Raspberry Pi

The Raspberry Pi 4 is 3 times faster, and the brand new Pi 5 is nearly 7 times faster!

And it's not just Geekbench. I ran my top500 Linpack benchmark, and the Mars CM gets just two gigaflops. The Pi 4 gets 12, and the Pi 5, 30!

I ran a bunch of other benchmarks, and also measured power consumption. And this isn't a terrible little SBC. But it's far from efficient, compared to any modern Arm processor:

HPL Efficiency Mars CM vs Pi vs Orange Pi Rockchip RK3588

For Linpack, the half-gigaflop per watt rating is at the bottom of my list, compared to more modern Rockchip boards getting over four gigaflops per watt.

At idle, the Mars CM only pulls down like 1 watt, so that's too bad.

And built-in networking puts out about a gigabit, so that's good too. But the eMMC interface is a little slow, maxing out around 45 MB/sec.

That puts it in the ballpark of the Pi 4, at least, but the Ethernet connection doesn't support PTP timestamping like the CM4, so it's not quite as flexible.

Plus, I couldn't get WiFi to work at all, despite attempts to get a connection to any of my four test WiFi networks.

It's probably a matter of the OS image just not being complete yet. So depending on when you read this post, WiFi might be working.

Conclusion

RISC-V is very cool. I love seeing this new hardware. And the fact the base architecture is open is great.

But there are a lot of people who are a bit optimistic about where we are today. I've gotten comments saying "Arm is dead in the water," or "RISC-V will take over in 5 years because it's open."

That's just not true.

Discounting the fact there are only a few decently-fast RISC-V designs on the market, and the price to performance is just not there, individual chip designs still require licensing.

So it's not like if someone made a Zen 4 RISC-V core, every chip maker could just pump it out. So while RISC-V is more open, it is not just a totally open hardware ecosystem. So it won't win by default.

It has to win, like all technology does, by solving problems. And right now, for tiny microcontrollers, or disk controllers, or things like that, it can, and it is.

But in terms of this thing being a Compute Module 4 killer? Well, the fact it's still hard to find CM4s even while Raspberry Pi is cranking out thousands every week speaks volumes.

Milk-V Mars CM with other CM4 clone boards Arm

And there are plenty of Arm competitors to fill the niche of 'not Raspberry Pi' compute modules, like the Pine64 SoQuartz, the Radxa CM3, or the Banana Pi CM4, all which I've tested before.

This is a very cool little board. I love that it already works so well. And that it includes PCI Express built-in. But is it a replacement for the Raspberry Pi? No. It doesn't do hardware PTP timestamping. It isn't compatible with as much software. It doesn't have all the same IO interfaces, and it's pretty slow. But that doesn't mean I don't like it!

If you're interested in getting into a new architecture, or if you just need a computer to throw onto a Compute Module board, it's certainly worth checking out.

But just like I mentioned in my VisionFive 2 review, this isn't meant for a typical user. That'll come in a generation or two, but right now, RISC-V isn't quite mainstream enough for the average SBC hobbyist or maker.

Now the Milk-V Pioneer... that's a 64-core RISC-V monster... I don't have one, but what do you think? Is it worth checking out?

Comments

In my opinion an SBC is not interesting based on performance, very often energy (and thermal) efficiency and the absence of an active heat sink are much more important elements in the choice. For this reason, the opinion of Eben Upton, that is not wrong, does not matter, just as the claims of Raspberry Pi's competitors regarding performance did not matter.

The real added value offered by Raspberry is the support it offers through its initiatives, which has allowed me to always be much more productive than in the case in question.

I purchased 4 cards from Arace, all RISC-V, the Mars SBC is the one that gave me the most problems due to poor software support.

The situation is slowly improving, two days ago the changes I was waiting for were made (see https://github.com/starfive-tech/linux/compare/cd3629d462ee08405b02a490… 9d8441b17dc10ff533d602c3cec408234145d2e6980b903d5814c651599e0 ) and in the next few hours on https: //debian.starfivetech.com I hope a new distribution appears, like the one on Github (see https://github.com/starfive-tech/VisionFive2/releases/tag/VF2_v3.8.2 ).

For many uses the computing power we have is more than sufficient, for example I have to acquire environmental noises outside and I don't want to have fan noise. If I wanted to send myself conversations in MPEG-D USAC instead, I would need to use a different version of FFMPEG (which I paid) and I couldn't do it stuck on a 2022 snapshot, just as anyone who has to use Ansible needs to be able to update the commands with more recent versions than the ones present.

If Raspberry Pi and other manufacturers want to push their modules to higher powers to satisfy the needs of those who want a Linux desktop, they should push themselves to create a machine to house them, and it wouldn't be a bad idea to make a laptop.

For "makers", however, it is better to have less computing power and better software support, because those who purchase in large quantities for a very specific purpose, need stability and recent times have taught us that it is not enough on its own, we also need the possibility of no longer be tied to just one supplier.

And soon in some areas of the planet people will not have the choices they had before, the masters of the world have decided that even the air we breathe belongs to them, this is the reason that pushes us to distance ourselves, little relevant things such as the choice between two sets of RISC instructions are going beyond our possible free choices.

Thanks for your article, I'll try the pre-release tonight (see https://github.com/starfive-tech/VisionFive2/releases/tag/VF2_v3.8.2 )

Huh, interesting. Like Jeff, my Vision2 has issues with some HDMI monitors using their standard OS image. Is this the case with DietPi?

I didn't find the problems reported by Jeff, the graphical environment is slow and the audio has the same limitations as the images distributed by StarFive, but APT can be used without limitations and from the command line the environment is stable, albeit many commands are labeled unstable. Use the Debian Sid repositories.

Since the software is free, I'll share the image file I used (with great joy):
http://81.56.4.34:7438/share/JgixNWp2PA-LPKHt/DietPi_VisionFive2-RISC-V…

I've been playing around with my Visionfive 2, and got my RX 580 running with little more than enabling support for it in the config and recompiling the kernel. (So far I can only confirm text mode working, but that's just because I've not tried anything else. I've heard of others getting full hardware accelerated desktop environments running, so I expect it will work for me as well.) According to the maintainer of the Gentoo image (https://forum.rvspace.org/t/experimental-gentoo-image/1807), he got better performance out of his Visionfive 2 than a Raspberry Pi 4 with Gentoo.
Considering both the Visionfive 2 and the Mars share the JH7110, I expect the same should be true for the Mars. If that is the case, then the Mars would be a 40 buck Raspberry Pi 4 replacement, that can have GPU support by just enabling it in the kernel.

Oh, by the way, I generally haven't had that much success with the official Debian images. The arch images (https://forum.rvspace.org/t/arch-linux-image-for-visionfive-2/1459) have worked a lot better for me. For example, updating all packages is not a problem there at all. It just feels like a way more finished product. Its maintainer also has his PKGBUILD build script for the kernel on GitHub: https://github.com/cwt-vf2/aur-linux-cwt-starfive-vf2 By disabling the checksum verification of the files, you can change the config file to any config file you like and compile a custom kernel.

Does anyone have the price of the 8GB SBC? Arace is sold out of all variants and the options to select are disabled.