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