Lirion
January 23, 2023, 10:26am
1
Dear all,
I’ve installed Gentoo on the Vision 2 Board and playing around with CFLAGS and ggc 12.2.1.
I think this are the correct one - or did anyone have different infos?
CFLAGS="-mabi=lp64d
-march=rv64imafdc_zicsr -mcpu=sifive-u74 -mtune=sifive-u74
-O2 -pipe -fomit-frame-pointer
--param l1-cache-size=32 --param l2-cache-size=2048"
1 Like
cwt
January 23, 2023, 10:32am
2
I use this to build Python 3.11.1
CFLAGS="-march=rv64imafdc -mcpu=sifive-u74 -mtune=sifive-7-series"
2 Likes
hfield
January 23, 2023, 1:04pm
3
You probably already know this, but if not you can look at what you’re getting without special tuning with:
gcc -march=native -E -v - </dev/null 2>&1 | grep cc1
zu2
January 23, 2023, 2:04pm
4
The bitmap extension is available for StarFive2 CPUs.
I use -march=rv64imafdczbb0p93_zba0p93 as a compiler option.
When I tried it with a program that uses bitmaps (Shogi, Japanese Chess), there was a 5% performance improvement.
3 Likes
cwt
January 23, 2023, 2:37pm
5
I think -march=native
is not supported in RISC-V yet. Your command without grep showing this:
gcc: error: ‘-march=native’: ISA string must begin with rv32 or rv64
cwt
January 23, 2023, 2:59pm
6
do we need to specify 0.93 for b extension? just asking because clang seem to refuse it, but allow just _zba_zbb
.
1 Like
Lirion
January 23, 2023, 3:09pm
7
Thank you very much for your hint . If we use your -march flag, then there is a noticeable improvement in my nbench benchmark (left with your march, right with the old one).
So I recommended as safe CFLAGS:
CFLAGS="-mabi=lp64d
-march=rv64imafdczbb0p93_zba0p93 -mcpu=sifive-u74 -mtune=sifive-7-series
-O2 -pipe -fomit-frame-pointer
--param l1-cache-size=32 --param l2-cache-size=2048"
6 Likes
zu2
January 23, 2023, 3:18pm
9
you are correct.
I tried with clang first, so I gave it 0.93. Not required for gcc.
3 Likes
cwt
January 23, 2023, 3:26pm
10
I will try to rebuild my Python with this CFLAGS, very excited to get things faster on this CPU.
3 Likes
andrew
January 25, 2023, 2:34pm
11
What Document/Process did you follow to install Gentoo on this Board?
Lirion
January 25, 2023, 4:23pm
12
There is a install guide for a raspberry. you can follow this guide (Raspberry Pi/Quick Install Guide - Gentoo Wiki ). Grab the modules (/lib/modules) and boot partition from starfive debian image.
You can use the risc v autobuilds: Index of /pub/Mirrors/gentoo/releases/riscv/autobuilds
If you install / compile all time, my recommendation: use a fan or a heatsink
andrew
January 25, 2023, 7:33pm
13
Did you have to use the Serial Port or did it work via the HDMI port?
riley10
January 26, 2023, 12:43am
14
Hi, I tried Gentoo MUSL stage3 autobuild, but it hangs on boot without any error, the board seems to reset. Anyone tried musl one?
1 Like
riley10
January 26, 2023, 2:09am
15
Normal gentoo rootfs also hangs for me on Starting Local.
Lirion
January 26, 2023, 9:40am
16
Only serial and ssh access. you can possibly install the gfx binary driver but i didn’t try.
@riley10 maybe you didn’t configure your serial on the visionfive side. Normal openrc Stage 3->
/etc/inittab
s0:12345:respawn:/sbin/agetty -L 115200 ttyS0 vt102
3 Likes
andrew
January 26, 2023, 3:32pm
17
Ok I will have to wait until I find my usb to serial adapter.
riley10
January 26, 2023, 4:13pm
18
Thanks this worked to get the serial adapter working on Gentoo.
andrew
January 28, 2023, 11:29pm
19
I have Gentoo running now
2 Likes
rvalles
January 29, 2023, 7:28am
21
Some details would be appreciated.
andrew
January 30, 2023, 9:14pm
22
Gentoo runs faster on my Visionfive2 than it does on my Raspberry pi 4 running Gentoo.
I compared compile times using the genlop -t command as well as simple benchmarks like
time echo “scale=5000; 4*a(1)” | bc -l
1 Like