Add short presentation about RISC-V hardware for Koji
[riscv-talks.git] / 2023-hardware / koji-hardware.txt
1 Koji is Fedora's build system
2
3 http://fedora.riscv.rocks/koji/
4 https://koji.fedoraproject.org/koji/
5
6 Doesn't use cross-compilation, and not possible with current design.
7 We must find a way to run a full build system somehow.
8
9 Discussion of primary architecture.
10
11
12
13
14 ## What hardware should we choose for RISC-V as a primary architecture?
15
16 * Milk-V Pioneer (SG2042)
17 * Sophgo 2U server (SG2042)
18
19   - Possible performance and quality issues [unverified]
20   - Expensive
21   - Likely to end up as e-waste soon.
22
23 * SiFive Unmatched
24
25   - Slow
26   - Doesn't support any recent extensions, esp. V, H
27   - No BMC, but might use BMC-on-PCIe card
28
29 * [Mystery manufacturer] future development board (under NDA)
30
31 * Single board computers (SBCs)
32
33   - VisionFive2 (StarFive JH7xxx), Lichee Pi 4A, ...
34   - Slow
35   - Limited memory, cores
36   - Reliability issues
37   - Upfront & ongoing engineering headaches integrating into a 19" rack
38
39 * QEMU
40
41   - Performance numbers below, but not great
42   - Really using x86-64 hardware
43   - Hardware (x86-64) is well known and easy to manage
44   - No "e-waste", servers can be repurposed
45   - Supports all the latest extensions
46   - Supports any amount of RAM, large numbers of vCPUs
47   - We can add new extensions and fix bugs relatively easily
48
49
50
51
52
53
54 ## QEMU performance numbers
55
56 (Times in seconds, taken from recent Fedora Koji builds)
57
58                binutils     openssl      python3.12   mingw-gcc
59
60 i686           1589         1577         3411         4292
61
62 x86-64         1419         1172         2462         1827
63
64 aarch64        1573          811 (?)     1845         2521
65
66 ppc64le        2165         1291         3073         4388
67
68 s390x          2553         1380         1984 (?)     6824
69
70                ------------ ------------ ------------ ------------
71
72   [qemu-system-riscv64 16 cores, 16 GB; on AMD Ryzen 9 7950X server]
73
74 qemu riscv64
75   (LTO)        4493         3052        14502        12428
76                  +217%        +160%       +489%        +580%
77
78   (no LTO)     3267         1351         6353        (failed)
79                  +130%        +15%        +158%
80
81 VisionFive 2
82   (LTO)        7202         8823
83                  +408%        +653%
84
85   (no LTO)     3274         2059
86                  +130%        +75%
87
88
89
90 ## QEMU observations
91
92 "TCG" is the name for QEMU's software emulation, eg. RISC-V fully
93 emulated guest on x86-64 host.
94
95 Works using Translation Blocks (TBs) which translate basic blocks of
96 guest code.
97
98 Well understood (by me), easy to fix simpler issues.
99
100  - I posted a patch yesterday which gets ~ +6% performance gain
101
102 A few tips to make TCG run (a bit) fast(er):
103
104  - Compile with -march=native (+4%)
105
106  - Profile with perf
107
108  - Don't overprovision host CPUs
109
110     * However pinning vCPUs to pCPUs didn't really help
111
112  - Give it plenty of guest & host RAM
113
114     * Measured memory overhead on host is up to 40% after running
115       for some time
116
117     * Host TBs track guest page cache; as long as a translated
118       executable remains in the guest page cache, it will not be
119       retranslated
120
121  - Don't restart the VM
122
123  - Software TLB
124
125  - Fast vs slow jumps