Latest version: RISCV-DevEnv-2023-07-31.tar.gz (865M expands to 15G)
md5sum 907d9e2eb3278da7f8e29543a3a03d66
Bugs and feature requests can be filed here.

This archive includes a 6.5-rc3 kernel and Gentoo Linux userspace configured for RISC-V to enable development and testing of RVV optimizations to OSS projects.

Getting Started

This setup has been tested with qemu-8.0.3. To boot the VM simply run:

$ ./

There are two accounts available on the system, root and negge. Both have the same password: rise

At boot, the VM starts sshd on port 22. The script includes a setting to map host port 10000 to VM port 22. You can ssh in with the user account:

$ ssh -p 10000 negge@localhost

Installed Software

This machine has the latest developer tools installed. The following packages are built for RISC-V and available to use:

PackageRelease Date

Testing RISC-V Extensions

There are two programs in the negge user directory:

$ ls test
hwcap  hwcap.c  testrvv  testrvv.o
  1. The hwcap program tests that the 'V' bit is set by getauxval(AT_HWCAP)
  2. The testrvv program executes the vsetvli instruction and returns

These can be used to confirm that the 6.5-rc3 kernel is properly built with CONFIG_RISCV_ISA_V=y and CONFIG_RISCV_ISA_V_DEFAULT_ENABLE=y.

Advanced Use

It is possible to use qemu-binfmt to mount and run the system in a chroot. This has the advantage of using the host kernel and MMU and is significantly faster.

As root, configure and start the qemu-binfmt service. You can confirm this is done correctly with:

$ cat /proc/sys/fs/binfmt_misc/qemu-riscv64
interpreter /usr/bin/qemu-riscv64

The VM already contains a staticly compiled x86_64 QEMU user binary with the patch from [1] backported to qemu-8.0.3 at:


To create the chroot, run the following commands as root:

mount -o loop,offset=1048576 gentoo.img /mnt/gentoo
cp /etc/resolv.conf /mnt/gentoo/etc
mount --bind /proc /mnt/gentoo/proc
mount --bind /sys /mnt/gentoo/sys
mount --bind /dev /mnt/gentoo/dev
mount --bind /dev/pts /mnt/gentoo/dev/pts
mount --bind /dev/shm /mnt/gentoo/dev/shm

You can enter the chroot with:

chroot /mnt/gentoo /bin/bash
env-update && source /etc/profile

Using the chroot is recommend for building and installing new packages into the VM with the emerge command.

Note, there are some differences between a qemu-user chroot and qemu-system

  1. The host kernel is still x86_64 so /proc/cpuinfo will not show the RISC-V ISA extensions
  2. Process concurrency is handled by the host kernel

For this reason it is recommended to develop and test RVV optimizations in the emulated VM.


  • No labels