4
5

More than 1 year has passed since last update.

Raspberry Pi 4 Kit Setting

Posted at

はじめに

 Mathematicaを使いたくて、Raspberry Pi4を導入した際のメモです。

環境

 解決した話も聞きますが、Raspberry Pi4は電源やら冷却やら面倒な話を聞くので、RSで販売している、okdoのRaspberry Pi4 B 4GB スターターキットを選択。電源、冷却の他、4K対応HDMI Microケーブルx2、32GBのメモリが付属し、OSの書き込みは不要です。

OS

 まず、起動すると、OSをインストールするところから始まります。
Raspberry Pi OS(Raspbian)

LibreELEC
が選択可能でした。自分は、両方選択して入れました。起動時に、起動OSを選択するメニューが出ます。しかし、LibreELECを起動しようとしても、再起動になり、使えませんでした。

アップデート

OS起動後、WiFiをつなぐとアップデートが始まるがエラーになりました。
コマンドから

% sudo apt-get update

でエラーメッセージを確認。

https://qiita.com/forte-evolution/items/fcf7de702856712d7cea
ここをヒントに、

% sudo apt-get update --allow-releaseinfo-change

これでアップデート完了。最初のOSのイメージが古いのかな?

日本語入力を整える

ここを参考に、
https://raspida.com/install-rpi-ime

% sudo apt install fcitx-mozc

一度再起動して、「設定」からFcitxを開いて、mozcがキーボードの上に来るように変更。
入力メソッドを全角半角キーに変更。

ベンチマーク

 冷却が効いているのか、よくわからないので、とりあえず、ベンチマーク。cinebenchは無いみたい。UbuntuだとGeekBenchが動くようだけど、Debian系だと無理みたい。Mathematicaと、Unix BenchMarkと、独自にprocessingの計算系を実施した。

Mathematica BenchMark 12.1

Score 0.20

2021-11-27-121803_1920x1080_scrot.png
2021-11-27-121917_1920x1080_scrot.png

Processing 3.5.3

サンプルのMandelbrotのmaxiterationsを100から65536にしたときの実行時間は、
約25秒
ちなみにM1 Macで約21秒。
processingはLinuxでもarm版をインストールする必要がある。
https://pi.processing.org/download/
ここから
https://github.com/processing/processing/releases/download/processing-0269-3.5.3/processing-3.5.3-linux-armv6hf.tgz
を落として実行

Unix BenchMark 5.1.3

1coreと4coreを比較できる。
ざっくりintel Atomよりは速い、という感じ。

single 253.7
multi 721.6

========================================================================
BYTE UNIX Benchmarks (Version 5.1.3)

System: raspberrypi: GNU/Linux
OS: GNU/Linux -- 5.10.17-v7l+ -- #1403 SMP Mon Feb 22 11:33:35 GMT 2021
Machine: armv7l (unknown)
Language: en_US.utf8 (charmap="ANSI_X3.4-1968", collate="ANSI_X3.4-1968")
CPU 0: ARMv7 Processor rev 3 (v7l) (0.0 bogomips)

CPU 1: ARMv7 Processor rev 3 (v7l) (0.0 bogomips)

CPU 2: ARMv7 Processor rev 3 (v7l) (0.0 bogomips)

CPU 3: ARMv7 Processor rev 3 (v7l) (0.0 bogomips)

12:52:10 up 1:40, 2 users, load average: 0.44, 0.96, 0.86; runlevel 5


Benchmark Run: 土 11月 27 2021 12:52:10 - 13:20:11
4 CPUs in system; running 1 parallel copy of tests

Dhrystone 2 using register variables 10254798.7 lps (10.0 s, 7 samples)
Double-Precision Whetstone 2394.8 MWIPS (9.7 s, 7 samples)
Execl Throughput 746.6 lps (29.9 s, 2 samples)
File Copy 1024 bufsize 2000 maxblocks 87874.6 KBps (30.0 s, 2 samples)
File Copy 256 bufsize 500 maxblocks 24276.6 KBps (30.0 s, 2 samples)
File Copy 4096 bufsize 8000 maxblocks 245358.4 KBps (30.0 s, 2 samples)
Pipe Throughput 88417.4 lps (10.0 s, 7 samples)
Pipe-based Context Switching 27667.5 lps (10.0 s, 7 samples)
Process Creation 989.9 lps (30.0 s, 2 samples)
Shell Scripts (1 concurrent) 2333.3 lpm (60.0 s, 2 samples)
Shell Scripts (8 concurrent) 685.7 lpm (60.1 s, 2 samples)
System Call Overhead 480858.9 lps (10.0 s, 7 samples)

System Benchmarks Index Values BASELINE RESULT INDEX
Dhrystone 2 using register variables 116700.0 10254798.7 878.7
Double-Precision Whetstone 55.0 2394.8 435.4
Execl Throughput 43.0 746.6 173.6
File Copy 1024 bufsize 2000 maxblocks 3960.0 87874.6 221.9
File Copy 256 bufsize 500 maxblocks 1655.0 24276.6 146.7
File Copy 4096 bufsize 8000 maxblocks 5800.0 245358.4 423.0
Pipe Throughput 12440.0 88417.4 71.1
Pipe-based Context Switching 4000.0 27667.5 69.2
Process Creation 126.0 989.9 78.6
Shell Scripts (1 concurrent) 42.4 2333.3 550.3
Shell Scripts (8 concurrent) 6.0 685.7 1142.9
System Call Overhead 15000.0 480858.9 320.6
========
System Benchmarks Index Score 253.7


Benchmark Run: 土 11月 27 2021 13:20:11 - 13:48:15
4 CPUs in system; running 4 parallel copies of tests

Dhrystone 2 using register variables 41012010.5 lps (10.0 s, 7 samples)
Double-Precision Whetstone 9575.9 MWIPS (9.6 s, 7 samples)
Execl Throughput 2358.7 lps (29.9 s, 2 samples)
File Copy 1024 bufsize 2000 maxblocks 172933.3 KBps (30.0 s, 2 samples)
File Copy 256 bufsize 500 maxblocks 47013.5 KBps (30.0 s, 2 samples)
File Copy 4096 bufsize 8000 maxblocks 525183.8 KBps (30.0 s, 2 samples)
Pipe Throughput 343770.4 lps (10.0 s, 7 samples)
Pipe-based Context Switching 104230.3 lps (10.0 s, 7 samples)
Process Creation 4881.9 lps (30.0 s, 2 samples)
Shell Scripts (1 concurrent) 5428.4 lpm (60.0 s, 2 samples)
Shell Scripts (8 concurrent) 727.9 lpm (60.1 s, 2 samples)
System Call Overhead 1830651.0 lps (10.0 s, 7 samples)

System Benchmarks Index Values BASELINE RESULT INDEX
Dhrystone 2 using register variables 116700.0 41012010.5 3514.3
Double-Precision Whetstone 55.0 9575.9 1741.1
Execl Throughput 43.0 2358.7 548.5
File Copy 1024 bufsize 2000 maxblocks 3960.0 172933.3 436.7
File Copy 256 bufsize 500 maxblocks 1655.0 47013.5 284.1
File Copy 4096 bufsize 8000 maxblocks 5800.0 525183.8 905.5
Pipe Throughput 12440.0 343770.4 276.3
Pipe-based Context Switching 4000.0 104230.3 260.6
Process Creation 126.0 4881.9 387.5
Shell Scripts (1 concurrent) 42.4 5428.4 1280.3
Shell Scripts (8 concurrent) 6.0 727.9 1213.2
System Call Overhead 15000.0 1830651.0 1220.4
========
System Benchmarks Index Score 721.6

スクショをとる

PrtScキーで/home/piにpngで保存される

リモートデスクトップ環境を整える

Windowsの場合は、RasPiにxrdpを入れて、リモートデスクトップで接続する。

% sudo apt install xrdp
% sudo systemctl start xrdp.service

Macの場合は、RasPiにtightvncserverを入れて、Finderでサーバ vnc://192.168.x.x:5901に接続する

% sudo apt install tightvncserver
% tightvncserver(初回は接続パスワード設定を求められる)

ただし、新しいXwindowで作業するようなので、Macで操作したら、RasPiの画面に反映されるような代物ではない。
AnyDeskの方がいいかも。

Mathematicaを試す

よし!
スクリーンショット 2021-11-28 9.25.18.png

4
5
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
5