Arch Linux Image for VisionFive 2

I didn’t even write down the image.

With losetup and some parameter, you get subdevices for each partition. I mounted and took what I needed from /boot, and used the official root tarball from the arch risc-v port website.

Disk images are the problem. Just use tarballs instead.

There is no build script, I did everything manually as described in this post.

Unfortunately, the corruption of the DTB file is something beyond my control. I recently discovered that the file was being overwritten by the u-Boot. I hope Starfive will address this issue in future releases of their Debian image.

I am currently waiting for the delivery of the revision B board so that I can test my image on both revisions. Until then, I do not plan on releasing any new images.

1 Like

I have a 1.3B (or is it 8?) board and I’ll try making a script to build an image

1 Like

My kernel boots, but a long time was spent in udev (see timeout below) and there’s some bizarre libbpf errors.

[    3.067694] cdns-dsi 295d0000.mipi: starfive dsi bind end
:: running early hook [udev]
Starting systemd-udevd version 252.5-1-arch
:: running hook [udev]
:: Triggering uevents...

Timed out for waiting the udev queue being empty.
:: running hook [keymap]
:: Loading keymap...kbd_mode: KDSKBMODE: Inappropriate ioctl for device
:: performing fsck on '/dev/nvme0n1p2'
arch-root: clean, 232667/8388608 files, 3116201/33554432 blocks
:: mounting '/dev/nvme0n1p2' on real root
:: running cleanup hook [udev]
libbpf: failed to find valid kernel BTF
libbpf: Error loading vmlinux BTF: -3
libbpf: failed to load object 'iterators_bpf'
libbpf: failed to load BPF skeleton 'iterators_bpf': -3
Failed load could be due to wrong endianness

Welcome to Arch Linux!

[  127.637574] systemd[1]: bpf-lsm: Failed to load BPF object: No such process
[  OK  ] Created slice Slice /system/getty.

@cwt How do you generate your initramfs?

On my end, all I did was a crude mkinitcpio -k 5.15.2-rt20-cwt9-rvalles -g myinitrd.

I use mkinitcpio but I can’t remember the full command now. I’m on the way home.


Thanks so much for this image.

I have early work on package of the IMG_GPU driver userspace (GLES, Vulkan, OpenCL).
From the starfive-tech/soft_3rdpart repo.
It comes with some testing tools as well. rgx_triangle_test can draw some spinning triangles using DRI/KMS.



What works:

  • It comes with testing tools that work and use the GPU.
  • I think anything using opencl should work.

What doesn’t

  • The libvulkan is missing some some symbols so even basic things like vkcube don’t work.
  • It’s just GLES no OpenGL
  • Wayland compositors have decencies that conflict. Eg: weston explicitly depends on mesa which conflicts.
  • There’s no EGL not sure what’s up with that.
  • There’s no libgbm. Which would make KMS hard.

I haven’t tested GLES yet.

The bundled libvulkan could probably be replaced with the normal vulkan-icd and likewise for opencl. That might fix the linking issues for vkcube.

I didn’t bundle the provided headers. Again I think the standard ones should probably suffice for that. (eg vulkan-headers can be installed with this to compile vulkan programs)


I think it would be a good idea to let the package depend on ocl-icd, vulkan-icd-loader, libglvnd and opencl-headers, to supply proper versions of those libraries (and their respective headers).

At least that is how I did it for my install locally and it seems to work alright (albeit I only tested OpenCL and some Vulkan)

By using this approach there is no conflict with mesa or the like either. Those libraries should be pretty much vendor agnostic, the juicy part is the firmware binary.


Thanks for providing this; it seems to work for me (and I finally have a basic perf, even though it’s missing all the DTB PMU entries for full U74 support, sigh).

(deleted nonsense)

My problems with packages were resolved after I updated with sudo pacman -Sy.


Ok it seems to work with ocl-icd, vulkan-icd-loader and kinda libglvnd.
However there’s no libdrm provided. So I can’t get Xorg or KMS working yet.

1 Like

What X video driver are you using?

So far, I only managed to get fbdev working, and I don’t think any acceleration can work with that.

1 Like

fbdev fails to start for me. I’m trying to figure out what driver would work with this. I might have to compare with the debian image. As far as I know the debain image has make installed all its x11 stuff which makes it annoying to figure out what it’s doing.

1 Like

fbdev fails to start for me.

Even with this configuration?

And, if you’re not using fbdev… what driver are you using? I could only get fbdev to work at all, on Xorg.

I think you are talking about VK_KHR_swapchain, which is a Vulkan extension, should be provided by Imagination-patched Mesa.

Provided by Imagination-patched Mesa.

Provided by Imagination-patched Mesa.

I wrote a note about VisionFive 2 GPU in Chinese. I would translate it to English later, but now I’m preparing for examinations, so you might have to use machine translation. You can also reference to attached PKGBUILDs, including the one I used to build patched Mesa.


Wow thanks that basically answered all the things I was trying to figure out.
I used google translate and I think I understood it. I’m trying your PKGBUILD’s now to see if they work for me.


I installed your aur package (via yay) and all its optional dependencies, and copied starfive’s debian xorg.conf (from /usr/local), getting modesetting to work.

However, vulkan nor opengl work, and X is extremely slow as 2d rendering seems to go through glamor, which in turn goes through softpipe.

Do you actually have acceleration working? If so, what am I missing?

1 Like

My back didn’t really work. The only thing that really worked was the included test programs and vulkaninfo.

shirok1’s one does work. I’ve gotten weston-simple-egl works with accelleration. No idea about X11 though. I don’t really use X much.


yay is good.

Try rua, it’s an AUR package manager built in rust. It’s been reliable for me.

1 Like

First of all, many thanks for providing this Arch image. While not being a foremost Arch Linux user, this is the first image that actually let’s me do the things I want with my set of of Vision 2’s. Eagerly awaiting the arrival of an Ubuntu image to standardize ARM/RISCV64 and AMD64. :slight_smile:

For now on question; I have it running/booting from SD. It is possible to have it boot from EMMC and what steps should I take for it?

Thanks in advance!

For both the emmc and nvme TO BOOT, I heard there needs to be more work done with regards to supporting pcie within the earlier boot stage components. not linux modules. We’re talking uboot and opensbi. WIP. Not done yet.

Look at the Connectivity/PCIE section here:

I believe you can still chroot /mnt the emmc if you want once linux is booted from the sdcard, linux supports the emmc/nvme. I’m chroot’ing to /mnt my nvme and it’s working well.

1 Like

Why chroot?

Just pass root=whatever to the kernel, where whatever is your nvme root fs device. Works for me.