I figured it was time to start a Pi thread instead of hijacking someone else's thread with Pi information. Additionally, this should help people looking for information.
I'm already working on a complete set of information at the AT forums (see references at the end of this post), but I thought I would give a very quick run down here for setting up a Pi 4 to run Distributed computing.
First. why use a raspberry pi for distributed computing?
The simple answer is, a Pi is a low cost (on a per device basis), low energy use entry point into distributed computing. A single Pi 4 is about 1/3 the processing power of an old Core2 quad 9650, BUT when configured to be headless and passively cooled it will do that processing for about 3 watts of power. In other words, if you're running pre Sandy Bridge hardware somewhere with moderate or expensive priced electricity, you can probably pay for a pi in a couple of months of energy savings.
The ultra, super quick configuration guide.
1) Buy your pi (this guide assumes a 4gb pi), a 16gb flash card (I've been getting a 30GB samsung select flash card since they are cheap), a power suppy, and a heatsink case (I prefer the FLIRC pi 4 case, but many options work)
2) download and install raspbian lite on your flash card, and create an empty file called ssh in the root directory (this lets you ssh to the host without needing to first setup a monitor).
3) connect your pi to your network via ethernet (you can use wifi, but the quick shell section below turns off wifi)
4) ssh to your new raspbian lite install
5) run the following commands (loosely documented with #s)
#upgrade system
sudo apt-get update
sudo apt-get upgrade -y
sudo rpi-eeprom-update -a
#install utilities and boinc
sudo apt-get install uhubctl boinc-client boinctui zram-tools -y
#setup zram and change percentage
sudo vi /etc/default/zramswap
PERCENTAGE=100
sudo zramswap stop
sudo zramswap start
#increase swap as a last resort so we don't run out of memory
sudo dphys-swapfile swapoff
sudo vi /etc/dphys-swapfile
CONF_SWAPSIZE=1024
sudo dphys-swapfile swapon
#setup boot config and disabled unused hardware (wifi, bluetooth) to optimize power, and reduce memory assigned to video to minimum
sudo cp /boot/config.txt /boot/config.old
echo "arm_64bit=1" | sudo tee -a /boot/config.txt
echo "dtoverlay=disable-wifi" | sudo tee -a /boot/config.txt
sudo systemctl disable hciuart
echo "dtoverlay=disable-bt" | sudo tee -a /boot/config.txt
echo "gpu_mem=16" | sudo tee -a /boot/config.txt
#create power save shell script that will need to be run on every boot (sh power.sh)
echo -e '#!/bin/bash\n\n#Disable HDMI\nsudo tvservice --off\n\n#turn off power LED\necho "turning off power led"\necho 0 | sudo tee /sys/class/leds/led1/brightness\n\n#call usb script to shutdown usb\nsh ./usb.sh off' > ~/power_save.sh
echo -e '#!/bin/bash\naction=$1\nif [ $action = "on" ]; then\n val=1\n echo "setting val to $val"\nelse\n val=0\n echo "setting val to $val"\nfi\nsudo uhubctl -l 2 -a $val' > ~/usb.sh
#configure boinc - first Edit the Boinc global preferences to use more than 100% of system memory and reduce the amount of :
sudo vi /etc/boinc-client/global_prefs_override.xml
#update xml to:
<global_preferences>
<max_ncpus_pct>100.000000</max_ncpus_pct>
<vm_max_used_pct>90.000000</vm_max_used_pct>
<ram_max_used_busy_pct>150.000000</ram_max_used_busy_pct>
<ram_max_used_idle_pct>150.000000</ram_max_used_idle_pct>
<cpu_usage_limit>100.000000</cpu_usage_limit>
<work_buf_min_days>.5</work_buf_min_days>
<work_buf_additional_days>1</work_buf_additional_days>
</global_preferences>
#update cc_config to allow the arm chip.
sudo vi /etc/boinc-client/cc_config.xml
#add options after /log_flags:
<options>
<alt_platform>aarch64-unknown-linux-gnu</alt_platform>
</options>
#reboot
sudo reboot now
#after reboot use the text based boinc manager to attach to your preferred project and start running DC
boinctui
References:
My (incomplete) pi guide: https://forums.anandtech.com/threads/the-raspberry-pi-thread.2581547/
Pi 4 running Rosetta@Home: https://boinc.bakerlab.org/rosetta/forum_thread.php?id=13732
I'm already working on a complete set of information at the AT forums (see references at the end of this post), but I thought I would give a very quick run down here for setting up a Pi 4 to run Distributed computing.
First. why use a raspberry pi for distributed computing?
The simple answer is, a Pi is a low cost (on a per device basis), low energy use entry point into distributed computing. A single Pi 4 is about 1/3 the processing power of an old Core2 quad 9650, BUT when configured to be headless and passively cooled it will do that processing for about 3 watts of power. In other words, if you're running pre Sandy Bridge hardware somewhere with moderate or expensive priced electricity, you can probably pay for a pi in a couple of months of energy savings.
The ultra, super quick configuration guide.
1) Buy your pi (this guide assumes a 4gb pi), a 16gb flash card (I've been getting a 30GB samsung select flash card since they are cheap), a power suppy, and a heatsink case (I prefer the FLIRC pi 4 case, but many options work)
2) download and install raspbian lite on your flash card, and create an empty file called ssh in the root directory (this lets you ssh to the host without needing to first setup a monitor).
3) connect your pi to your network via ethernet (you can use wifi, but the quick shell section below turns off wifi)
4) ssh to your new raspbian lite install
5) run the following commands (loosely documented with #s)
#upgrade system
sudo apt-get update
sudo apt-get upgrade -y
sudo rpi-eeprom-update -a
#install utilities and boinc
sudo apt-get install uhubctl boinc-client boinctui zram-tools -y
#setup zram and change percentage
sudo vi /etc/default/zramswap
PERCENTAGE=100
sudo zramswap stop
sudo zramswap start
#increase swap as a last resort so we don't run out of memory
sudo dphys-swapfile swapoff
sudo vi /etc/dphys-swapfile
CONF_SWAPSIZE=1024
sudo dphys-swapfile swapon
#setup boot config and disabled unused hardware (wifi, bluetooth) to optimize power, and reduce memory assigned to video to minimum
sudo cp /boot/config.txt /boot/config.old
echo "arm_64bit=1" | sudo tee -a /boot/config.txt
echo "dtoverlay=disable-wifi" | sudo tee -a /boot/config.txt
sudo systemctl disable hciuart
echo "dtoverlay=disable-bt" | sudo tee -a /boot/config.txt
echo "gpu_mem=16" | sudo tee -a /boot/config.txt
#create power save shell script that will need to be run on every boot (sh power.sh)
echo -e '#!/bin/bash\n\n#Disable HDMI\nsudo tvservice --off\n\n#turn off power LED\necho "turning off power led"\necho 0 | sudo tee /sys/class/leds/led1/brightness\n\n#call usb script to shutdown usb\nsh ./usb.sh off' > ~/power_save.sh
echo -e '#!/bin/bash\naction=$1\nif [ $action = "on" ]; then\n val=1\n echo "setting val to $val"\nelse\n val=0\n echo "setting val to $val"\nfi\nsudo uhubctl -l 2 -a $val' > ~/usb.sh
#configure boinc - first Edit the Boinc global preferences to use more than 100% of system memory and reduce the amount of :
sudo vi /etc/boinc-client/global_prefs_override.xml
#update xml to:
<global_preferences>
<max_ncpus_pct>100.000000</max_ncpus_pct>
<vm_max_used_pct>90.000000</vm_max_used_pct>
<ram_max_used_busy_pct>150.000000</ram_max_used_busy_pct>
<ram_max_used_idle_pct>150.000000</ram_max_used_idle_pct>
<cpu_usage_limit>100.000000</cpu_usage_limit>
<work_buf_min_days>.5</work_buf_min_days>
<work_buf_additional_days>1</work_buf_additional_days>
</global_preferences>
#update cc_config to allow the arm chip.
sudo vi /etc/boinc-client/cc_config.xml
#add options after /log_flags:
<options>
<alt_platform>aarch64-unknown-linux-gnu</alt_platform>
</options>
#reboot
sudo reboot now
#after reboot use the text based boinc manager to attach to your preferred project and start running DC
boinctui
References:
My (incomplete) pi guide: https://forums.anandtech.com/threads/the-raspberry-pi-thread.2581547/
Pi 4 running Rosetta@Home: https://boinc.bakerlab.org/rosetta/forum_thread.php?id=13732