Progress on running Haiku on VisionFive 2

X512:

Does Haiku support (booting from) the VF2 eMMC?

I’ve not got a spare m.2 SSD but I do have a eMMC I’m not using so I’d prefer to use that if I can.

One criticism I’ve read about the VF2 is that the TF (uSD) slot can’t manage more than about 24 MB/s reads with cards that should handle 4x that speed. I presume that this is the case for Haiku too?

SD/MMC is currently not yet supported. I currently use NVMe (slot on down side of board) to install Haiku.

Do you have eMMC module compatible with connector on back side of board? How did you get it?

OK, I shall have to buy a NVMe disk too then. That should perform a bit better than the eMMC anyway,

I bought the eMMC module to use with one of my ARM SBCs, the Rock64. I’m not sure they’re compatible yet but I’ll try the eMMC with Debian when my VF2 arrives. I’m pretty sure I bought the rock64 and the eMMC module off Amazon.

The Rock64 is one of the worst SBCs I bought. The RockPi 4 is much better but its only just recently got 4K support upstream in the Linux rockchip DRM driver. I was deciding between buying a RockPi 5 and the VF 2 but the VF 2 won out because of the Haiku port.

Will the Haiku RISCV64 image work on both the HiFive Unmatched and the VF2 when this VF2 fork gets upstreamed or will the two require different installation images?

EDIT

I’ve ordered a 500 GB Samsung 980 PRO m.2 so hopefully that will be compat with the VF2.

Other suggestions:

  • WD BLACK SN850X NVMe SSD [WDS100T2XHE]
  • SABRENT Rocket 2230 NVMe 4.0 1TB PCIe 4.0 M.2 2230 SSD [SB-2130-1TB]
3 Likes

Assuming performance is adequate, perhaps some enterprising individual - or Haiku Inc - could import and retail this SBC with haiku pre-loaded?

We don’t even have a package repository for RISC-V so all packages have to be built from source. And we also don’t have an official beta release (not even talking about a stable one).

Clearly we are not set up to provide adequate support for selling machines with a pre-loaded install. If someone wants to do it, please make sure you’re ready to handle support requests from the users you sell it to, about non-working hardware, missing software, etc.

11 Likes

My VF2 arrived yesterday. The first successful boot happened at 5:05 UK time yesterday, I kid you not!

I didn’t even get to start on Haiku yesterday, I was just trying to get the latest version of the official to Debian to run, mainly because I want to boot Debian off my NVMe disk instead of microSD before I do any proper tests. I’ve not done so yet because my first attempt a updating the u-boot failed - it said the latest u-boot spl wouldn’t fit so it seems I need to reformat my mtd to update u-boot / the firmware and run the latest official Debian?

I was succussful in getting the official ‘69’ Debian release to boot on my VF2 but it is missing wifi, bluetooth and 4K support. I’ve also got Armbian to boot on it but its suuuuuper slow and the graphics driver isn’t fully funtional yet, as in it barely works. Forget about 3D accel or hw accelerated video decoding under Armbian. I tried Ubuntu but that has no HDMI/GPU support at all plus no USB or PCIe support and only one of the ethernet ports worked.

I tested my NVMe under Debian and its recognized but hdparm said I was only getting about 160 MB/s so it looks like they’ve not enabled PCIe 2.0 support in their Debian kernel yet.

The VF2 100% is not ready for your average consumer yet but I think this board has massive amounts of potential. It’s nicely packaged, its well documented and seems to be of decent build quality.

X512:

Could you provide some instructions for how I’d build Haiku for my VF2 and get it booting from NVMe please? Will I need to update to the latest VF2 firmware and uboot to boot Haiku?

5 Likes

Not sure if it helps, but I got the 202303 Engineering Release of Debian running on VF2. All I did was flash it to SD and then change the pins. I didn’t need to update anything. It works great with Gnome and Wayland.

2 Likes

Change the pins? Do you mean the boot selection switches? Mine are both set to ON currently.

The RGPIO switches. It’s a bit confusing but mine correspond to SDIO in the picture.

3 Likes

I set that switches to boot from SD card.

Thanks x86k!

After setting the RGPIO switch to SDIO I was able to boot all of the StarFive Debian images but, as I expected, all of them have some GPU or HDMI problem.

The image / hardware combo that works best for me currently is starfive-jh7110-202302-SD-minimal-desktop.img connected to a 1080p HDMI display. starfive-jh7110-202302-SD-minimal-desktop.img fails to show the login screen when I boot it connected to my 4K display.

I’ve tried starfive-jh7110-VF2-SD-wayland.img . It boots but the HDMI output is only OK until the GDM login screen loads at which point what should be a blue login screen looks purple and all the colours are wrong. This happens when I boot the wayland image on both my 1080p and 4K displays. The good news with starfive-jh7110-VF2-SD-wayland.img is that it proves that 4K output is working OK when the kernel is booting and we can see 4K also kinda works under Wayland.

The release notes for the latest VisionFive 2 software release on github say that PCIe booting has been added to U-boot but I’ve not seen any guides on how we are supposed to install Debian onto / boot directly from NVMe yet?

The otherwise good specs (for a SBC) are ruined by having to run off SD card. I’m sure it’s easy enough to boot off the SD card and have your root on the NVMe but I’m keen to ditch the SD card fully ASAP.

From your responses I am presuming none of you have pulled this off yet. Have you got a NVMe SSD for your VF2 x86k?

I think I was underestimating the VF2’s CPU a bit. I’ve not done a conclusive comparison yet but it seems that the VF2’s CPU should compete quite well with the RPi4 even with its software ecosystem’s rather raw state. I think it might be a bit faster actually.

As I mentioned previously, I’ve got an eMMC module and it fits into the VF2 eMMC slots but its only 16 GB and my model doesn’t seem to be recognised or supported by the VF2. I tried booting the StarFive Debian eMMC image from it with no luck, after setting the RGPIO to eMMC.

I tried running mpv and VLC but they both gave some missing EGL / Vulkan call errors as if I don’t have the graphics driver / EGL libs installed properly so I’ve not been able to test playing any videos yet. It would seem there is working video decoding for gstreamer:

Both HDMI audio and the onboard audio jack work fine.

I’ve visited Linux PowerVR land previously when I had a Dell Netbook once that used a Intel Poulsbo chipset that had a PVR GPU and that never got a decent open source driver so it quickly became next to useless as a desktop computer so I came expecting GPU problems on the VF2. We’re in a better situation now with having an almost working open source Rogue PVR mesa driver so hopefully it won’t take too long to stabilise and become usable for most people. The VF2 GPU is supposedly about 4x faster than the RPi 4 GPU.

The biggest disappointment with the VF2 for me so far has been that the USB ports (currently) don’t provide enough power to use a mechanical disk attached to them. I’ve got some cheap TV boxes that also have USB 3 but they do provide enough power to use a mechanical disk via bus power alone.

I am presuming that building X512’s repo won’t spit out a disk image I can write to NVMe and just boot although I’ve not tried any of that yet.

I thought a few of you might find that interesting but it is OT talking about Linux so I’ll leave the Linux talk at that now. Back to installing Haku!

1 Like

Making Ethernet driver. Currently only basic driver structure is done, no interacting with hardware yet. I am experimenting with implementing interface net_device_module_info directly instead of using regular file read/write operations like existing Haiku drivers to avoid memory copy overhead and use net_buffer directly backed up by hardware DMA buffers.

24 Likes

Great to hear you’ve started writing a VF2 ethernet driver!

Could you share your latest Haiku VF2 image please? I realise I’ll have to build packages myself but I’m fine with that.

Thanks X512!

EDIT

I have got VLC to successfully play videos using using the CPU for decoding under the 69 build of StarFive Debian. It can just about handle playing 1080p h264 files.

I had to reflash the older 2.5.0 firmware to get the 69 build to boot again. It seems that the 69 build requires the RGPIO be set to boot from QSPI whilst their newer Debian images require you use the SDIO setting.

I have not been able to get vulkaninfo to successfully run yet. It segfaults for me under the 69 build, which I’ve read others have got to work with Vulkan.

1 Like

A lot of things on the software side are work in progress. Starfive made this comment regarding their Engineering Release: VisionFive 2 Debian Image 202303 Released(latest) - #70 by Michael.Zhu - VisionFive 2 (English Forum) - RVspace Forum

As for my own observations:
GPU: We are waiting for newer versions of mesa to hit the Debian repos. When that happens, we will hopefully have good support for Vulkan through the open source Imagination driver. As for OpenGL, it seems like the general idea is to rely on Zink (OpenGL → Vulkan compatibility layer) to provide accelerated OpenGL.

As for 4K, I didn’t try that. My 1080p monitor works with no issue though.

NVme: I didn’t look into that at all so far, and I don’t own an NVme drive yet. It appears to be mostly unsupported for now. Provided that the OS can recognize the NVme drive, you could perhaps try and use the SD card as a boot loader. X512 booted Haiku this way on the Sifive Unmatched if I recall. Personally, I found the SD card’s speed to be sufficient for my limited testing.

I also didn’t look into eMMC.

Video playback: I’m sure that the performance for video playback will be pretty good in time. I only got a small amount of lag while watching a 1080p video within Firefox. So with a little bit of work on the drivers, VLC and the like should work well.

1 Like

Yes it is possible to use the SD card as a boot loader although I’ve not tried it yet:

I’ve got too accustomed to using decent speed eMMCs or SSDs on my SBC’s so a 22 MB/s SD card doesn’t cut it for me.

I found this supposed fix for NVMe boot, which I’ve yet to verify:

Under u-boot:

setenv boot_targets mmc0 nvme0 dhcp
setenv bootcmd_nvme0 devnum 0; run nvme_boot
setenv kernel_comp_addr_r 0x50000000
setenv kernel_comp_size 0x04000000
setenv fdtfile starfive/jh7110-visionfive-v2.dtb
saveenv

now boots from mmc or nvme.

Reddit - Dive into anything

It may be no use to you now that you’ve already started writing a driver but OpenBSD has a driver for the original VisionFive ethernet called dwge. I don’t how similar it is to the VF2 ethernet interface but they could be the same? We have a OpenBSD network compat layer so that could be almost a copy/paste job?

X512:

I’ve attempted to build Haiku for VF2 with no success but I am guessing what to do of course.

I followed the insructions here:

(NB this page seems to need updating as it says “The state of the RISC-V port is early. Only the bootloader currently runs.” which is not the case any more apparently)

but instead of using the official haiku source repo I used the visionfive2 branch cloned from your repo.

I successfully built the Haiku compiler toolchain under StarFive Debian but when it came to building Haiku itself I wasn’t sure what command to run so I just ran:

jam -j4 -q @minimum-mmc

Like in the riscv build guide but I expect there might be another build target I need to use to create a SSD vs a mmc image? Running this command within the generated.riscv64 dir only got as far as building String.h before the build failed.

I use jam -j4 -q @minimum-raw, copy contents of haiku-minimum.image to NVMe disk and EFI boot loader (haiku_loader.efi) to SD card.

4 Likes

@X512 thank you for sharing these info. This is what I asked you earlier :slight_smile: