After reading 6 Months with the Pi Desktop talking about setting up zswap when using a Pi4 in a desktop application, and Ubuntu 22 for RaspberryPi coming with zswap by default to make the Ubuntu desktop fit on a Pi4 2GB, I wondered if this should become a standard when setting up a Pi4 with Legacy PiOS (desktop version) for the GoPiGo3, (even though there is no SSD usually)? Yuk, what a run-on sentence…
The article makes the statement the compression+i/o is faster than the i/o time for uncompressed swaps, so it would seem to improve the performance, and decrease the writes to the SDcard.
Thoughts?
Pi4 Heat
As to really putting a Pi4 in a GoPiGo3, I have been hesitant for two main reasons:
Pi4 processing power is only needed on a GoPiGo3 for OpenCV or TensorFlow-Lite vision analysis
(and perhaps for folks that feel they just have to run a desktop environment on their robot…)
GoPiGo3 to Raspberry Pi board mating does not provide for adequate cooling a Pi4 at high loads
and I have been opposed to putting a Pi4 in most use cases because:
The idle current is higher than the Pi3B+ which takes 2 hours off the play time.
Now that I actually have a Pi4 to test with, I am first starting with the cooling and mounting issues.
My initial performance vs. heat test on the Pi4 with a PiMoroni heatsink case looks very promising for being able to get the full Pi4 performance in a GoPiGo3 use, but it looks like I will need to add a 40 pin “spacer” and additional hex spacers to the board mating.
I needed to figure this sooner than I expected. Need 6.5GB to do a “compile install” OpenCV for Pi4, so with only a 2GB Pi4 I need another 6GB of swap space
Increase swap to compile (reference says need 6.5 GB to build)
edit the swap configuration
sudo nano /sbin/dphys-swapfile
# Default next line
# CONF_MAXSWAP=2048
# Increase for compile OpenCV
CONF_MAXSWAP=6144
sudo nano /etc/dphys-swapfile
# Default next line:
# CONF_SWAPSIZE=100
# Increase to compile OpenCV
CONF_SWAPSIZE=6144
check available memory before and after:
free -m
total used free shared buff/cache available
Mem: 1820 143 1342 15 334 1582
Swap: 99 0 99
" We have the capability to build the world’s first [Bullseye GoPiGo3 robot]. [Dave] will be that [robot]. Better than he was before. Better , stronger , faster ."
(Without the six million dollars … unless Pi4 prices keep going up.)