2023-koji: Misc updates
[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 Explanation of primary architecture
10                vs. koji-shadow
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33 ## What hardware should we choose for RISC-V as a primary architecture?
34
35 * Milk-V Pioneer (SG2042)
36 * Sophgo 2U server (SG2042)
37
38   - Possible performance and quality issues [unverified]
39   - Expensive
40   - Likely to end up as e-waste soon.
41
42 * SiFive Unmatched
43
44   - Slow
45   - Doesn't support any recent extensions, esp. V, H
46   - No BMC, but might use BMC-on-PCIe card
47
48 * [Mystery manufacturer] future development board (under NDA)
49
50 * Single board computers (SBCs)
51
52   - VisionFive2 (StarFive JH7xxx), Lichee Pi 4A, ...
53   - Slow
54   - Limited memory, cores
55   - Reliability issues
56   - Upfront & ongoing engineering headaches integrating into a 19" rack
57
58 * QEMU
59
60   - Performance numbers below, but not great
61   - Really using x86-64 hardware
62   - Hardware (x86-64) is well known and easy to manage
63   - No "e-waste", servers can be repurposed
64   - Supports all the latest extensions
65   - Supports any amount of RAM, large numbers of vCPUs
66   - We can add new extensions and fix bugs relatively easily
67
68
69
70
71
72
73 ## QEMU performance numbers
74
75 (Times in seconds, taken from recent Fedora Koji builds)
76
77                binutils     openssl      python3.12   mingw-gcc
78
79 i686           1589         1577         3411         4292
80
81 x86-64         1419         1172         2462         1827
82
83 aarch64        1573          811 (?)     1845         2521
84
85 ppc64le        2165         1291         3073         4388
86
87 s390x          2553         1380         1984 (?)     6824
88
89
90
91
92 qemu riscv64  [qemu-system-riscv64 16 cores, 16 GB; on AMD Ryzen 9 7950X server]
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                     (crashed in LTO step)
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