Milk-V Jupiterが届いた

Milk-V Jupiterの16GB版が(やっと)届いたので色々試してみた。

準備

OS

起動にはMicroSDにBalenaEtcherなどでOSを焼く必要がある。OSイメージはUbuntu 23.10とBianbu OSというUbuntuベースのオリジナルが提供されている。

milkv.io

私はUbuntu23.10を入れた。

電源

Milk-V JupiterはATX電源、ACアダプタ(2.5mmジャック)、USB PDの3種類の給電方法が用意されている。PoEは追加ボードが必要なのだが、入手手段がないので現状は利用できない。

とりあえず手元にあったACアダプタで給電することにした。

起動後の確認

lscpu

Architecture:          riscv64
  Byte Order:          Little Endian
CPU(s):                8
  On-line CPU(s) list: 0-7
Model name:            Spacemit(R) X60
  Thread(s) per core:  1
  Core(s) per socket:  8
  Socket(s):           1
  CPU(s) scaling MHz:  100%
  CPU max MHz:         1800.0000
  CPU min MHz:         614.4000
Caches (sum of all):
  L1d:                 256 KiB (8 instances)
  L1i:                 256 KiB (8 instances)
  L2:                  1 MiB (2 instances)

lstopo

M.2

Optane M10 16GBを挿してみたが認識されない。M.2→SATA6ポート変換基板は認識されるので、相性があるのかもしれない。

有線LAN

SoC内蔵で1GbEが2ポートついているがMACアドレスが存在しないのでFE:FE:FE:x:x:xというランダム生成されたMACアドレスが起動毎に割り当てられる。起動のたびに変わるのは色々と不便なのでにnetplan等で固定する。加えてチェックサムオフローディングがないので異様にCPU負荷が高い。

ベンチマーク(coremark)

ちゃんとコンパイルオプションをつければCortex-A55より速い。genericなRV64GCだけだとCortex-A55並みな性能になった。

コンパイラだが、gccはRVVの対応が遅く自動ベクトル化が期待できない。一方Clangは、自動ベクトル化もIntrinsic対応もよい感じだが、自動ベクトル化を含めてもgccの方が最適化されていて速い。

gcc(RV64GCのみ)

2K performance run parameters for coremark.
CoreMark Size    : 666
Total ticks      : 17226
Total time (secs): 17.226000
Iterations/Sec   : 6385.696041
Iterations       : 110000
Compiler version : GCC13.2.0
Compiler flags   : -O2 -march=rv64gc -DPERFORMANCE_RUN=1  -lrt
Memory location  : Please put data memory location here
                        (e.g. code in flash, data on heap etc)
seedcrc          : 0xe9f5
[0]crclist       : 0xe714
[0]crcmatrix     : 0x1fd7
[0]crcstate      : 0x8e3a
[0]crcfinal      : 0x33ff
Correct operation validated. See README.md for run and reporting rules.
CoreMark 1.0 : 6385.696041 / GCC13.2.0 -O2 -march=rv64gc -DPERFORMANCE_RUN=1  -lrt / Heap

gcc(最適化オプションあり)

2K performance run parameters for coremark.
CoreMark Size    : 666
Total ticks      : 13977
Total time (secs): 13.977000
Iterations/Sec   : 7870.072262
Iterations       : 110000
Compiler version : GCC13.2.0
Compiler flags   : -O2 -march=rv64gcv_zba_zbb_zbs_zbc_zicond_zvl256b -misa-spec=2.2 -funroll-all-loops -finline-functions -DPERFORMANCE_RUN=1  -lrt
Memory location  : Please put data memory location here
                        (e.g. code in flash, data on heap etc)
seedcrc          : 0xe9f5
[0]crclist       : 0xe714
[0]crcmatrix     : 0x1fd7
[0]crcstate      : 0x8e3a
[0]crcfinal      : 0x33ff
Correct operation validated. See README.md for run and reporting rules.
CoreMark 1.0 : 7870.072262 / GCC13.2.0 -O2 -march=rv64gcv_zba_zbb_zbs_zbc_zicond_zvl256b -misa-spec=2.2 -funroll-all-loops -finline-functions -DPERFORMANCE_RUN=1  -lrt / Heap

clang(最適化オプションあり)

2K performance run parameters for coremark.
CoreMark Size    : 666
Total ticks      : 12042
Total time (secs): 12.042000
Iterations/Sec   : 4982.561036
Iterations       : 60000
Compiler version : Ubuntu Clang 17.0.2 (1~exp1ubuntu2.1-bb1 56277be0dfab53becb87b035a858df5a10632457)
Compiler flags   : -O2 -march=rv64gcv_zba_zbb_zbs_zbc_zicond1p0_zvl256b -funroll-loops -finline-functions -menable-experimental-extensions -DPERFORMANCE_RUN=1  -lrt
Memory location  : Please put data memory location here
                        (e.g. code in flash, data on heap etc)
seedcrc          : 0xe9f5
[0]crclist       : 0xe714
[0]crcmatrix     : 0x1fd7
[0]crcstate      : 0x8e3a
[0]crcfinal      : 0xbd59
Correct operation validated. See README.md for run and reporting rules.
CoreMark 1.0 : 4982.561036 / Ubuntu Clang 17.0.2 (1~exp1ubuntu2.1-bb1 56277be0dfab53becb87b035a858df5a10632457) -O2 -march=rv64gcv_zba_zbb_zbs_zbc_zicond1p0_zvl256b -funroll-loops -finline-functions -menable-experimental-extensions -DPERFORMANCE_RUN=1  -lrt / Heap