Arch Linux Image for VisionFive 2

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

2 Likes

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.

AUR:
https://aur.archlinux.org/packages/visionfive2-img-gpu

Github:

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)

6 Likes

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.

2 Likes

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.

2 Likes

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.

3 Likes

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.

2 Likes

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.

3 Likes

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:
https://rvspace.org/en/project/JH7110_Upstream_Plan

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.

2 Likes

Got X working with shirok1’s PKGBUILDs.

Mesa uses llvmpipe, so not accelerated. vulkaninfo works, but vkcube does not.

X is somewhat usable now, but I believe still unaccelerated. It is much faster than before (and I’m typing this on my VisionFive2!) but by virtue of NOT using glamor.

weston-simple-egl just segfaults here. I’ve never had much luck with Wayland.

Please could you share how your entry to point to your nvme looks like?

Did you use the uboot-update afterwards?
I’m afraid it will crush some dtb settings. cwt warned me it might do this.

Here are all my block devices:
myBlockDevices.json (22.5 KB)

I believe what I want to be booting to is this:
“uuid”: “d65e91f4-ea2f-444f-bf86-d95f1096a83d”

I’m thinking:
root=LABEL=rootpart

Gets changed to
root=UUID=d65e91f4-ea2f-444f-bf86-d95f1096a83d

BEFORE:

 $ cat /boot/boot/extlinux/extlinux.conf 
TIMEOUT 30

DEFAULT visionfive2
 
MENU TITLE starfive visionfive2 boot options

LABEL visionfive2
      MENU LABEL visionfive2
      LINUX ../../vmlinuz-5.15.0-vf2-260+
      INITRD ../../initrd.img-5.15.0-vf2-260+
      FDTDIR ../../dtb-5.15.0-vf2-260+
      APPEND root=LABEL=rootpart rw console=tty0 console=ttyS0,115200 earlycon rootwait stmmaceth=chain_mode:1 selinux=0 apparmor=0

AFTER CHANGE:

 $ cat /boot/boot/extlinux/extlinux.conf 
TIMEOUT 30

DEFAULT visionfive2
 
MENU TITLE starfive visionfive2 boot options

LABEL visionfive2
      MENU LABEL visionfive2
      LINUX ../../vmlinuz-5.15.0-vf2-260+
      INITRD ../../initrd.img-5.15.0-vf2-260+
      FDTDIR ../../dtb-5.15.0-vf2-260+
      APPEND root=UUID=d65e91f4-ea2f-444f-bf86-d95f1096a83d rw console=tty0 console=ttyS0,115200 earlycon rootwait stmmaceth=chain_mode:1 selinux=0 apparmor=0

Is that ok? Do I need to do uboot-update afterwards?

Looks good, although I prefer labels.

UUIDs can be the FSs or the partitions… it gets confusing. The syntax is root=PARTUUID= for partitions. I do not know which one you’ve got.

As for uboot-update, I never used it nor do I have any idea what it does. I assume it’s a random non-standard script someone wrote.

My entry looks like:

label Arch-cwt9-rvalles
        menu label Arch Linux 5.15.2-rt20-cwt9-rvalles
        linux /boot/vmlinux-5.15.2-rt20-cwt9-rvalles
        initrd /boot/initrd.img-5.15.2-rt20-cwt9-rvalles
        fdtdir /boot/dtbs/
        append root=LABEL=arch-root rw console=tty0 console=ttyS0,115200 earlycon rootwait stmmaceth=chain_mode:1

On blkid, the partition looks like:

/dev/nvme0n1p2: LABEL="arch-root" UUID="54267cf7-aa6c-4107-b9db-e16ca639d770" BLOCK_SIZE="4096" TYPE="ext4" PARTLABEL="arch-root" PARTUUID="915706c8-c4df-440a-9092-bf9cb2f7eb9d"

1 Like

The cwt10 image has been uploaded to my Google Drive and Naver MYBOX. This image raw file is much smaller than its predecessor, with a size of approximately 2.5GB which can be burned onto a 4GB micro SD card.

2 Likes