Help Medical Research With Folding@home on Raspberry Pi
Posted by admin on
Folding@Home is a popular distributed computing project that uses the parallell processing power of millions of household computers worldwide. The project simulates protein dynamics, including the process of protein folding and the movements of proteins implicated in a variety of diseases.
More recently, Folding@home has focused on helping to understand SARS-CoV-2/COVID-19 and to develop new therapies. Want to join in to aid vital medical research using a humble Raspberry Pi? We’ll show you how.
Prepare to Fold
While no external hardware apart from your Raspberry Pi computer is needed to join the project, there are a few requirements, such as using a Raspberry Pi model with a 64-bit processor and at least 1GB of RAM (as Folding@home uses around 500MB of RAM). This can be one of the following models:
- Raspberry Pi Model 4B
- Raspberry Pi 400
- Raspberry Pi Model 3B
- Raspberry Pi Model 3B+
- Raspberry Pi Compute Module 4
Step 1: Install Raspberry Pi OS 64-bit
Since the Folding@home software for Raspberry Pi is a 64-bit package, you’ll need a 64-bit version of Raspberry Pi OS to run it.
The 64-bit version of the OS is not yet available in the Raspberry Pi Imager tool, which only offers standard 32-bit OS options. So, on another computer, you’ll need to download the zip file for the latest full 64-bit desktop version (or the 64-bit Lite version if you don't need a desktop).
Now to flash the OS image to a microSD card attached to your computer. If you don’t already have it installed, download the Raspberry Pi Imager tool. Open the tool and do the following:
- Click on Choose OS, then go to the bottom of the dropdown menu and select Use custom.
- Select the 64-bit Raspberry Pi OS image file you downloaded.
- Click on Choose Storage and select your attached microSD card (typically named ‘Generic Storage Device Media’).
- Click on Write to write the image to the microSD card. Note that this will erase any existing data on it.
Once that’s done, eject and remove the microSD card, then insert it into your Raspberry Pi and boot it up. In the desktop version 'welcome wizard', make sure to connect to your wireless router.
Step 2: Install Folding@home on Raspberry Pi
Open a Terminal window and enter the following command to download the Folding@home client package and save it as fahclient.deb:
wget https://download.foldingathome.org/releases/public/release/fahclient/debian-stable-arm64/v7.6/fahclient_7.6.21_arm64.deb -O fahclient.deb
Note: The 7.6.21 version is the latest at the time of writing, but you can check the latest release version on the Folding@home alternative downloads page.
Now you need to install the downloaded package with the following command:
sudo dpkg -i --force-depnds fahclient.deb
Step 3: Configure the Folding@home Client
After entering the installation command in step 2, a Folding@home configuration screen will appear and you‘ll be prompted to enter a user name, team number, and passkey. Don't worry about the last two unless you've already joined one of the teams doing Folding@home. The user name can be kept as Anonymous if you like, or make one up and you can then earn points for folding.
You’ll then be asked how much of your system's resources should be used initially. If you intend to use this Raspberry Pi for other purposes, you should opt for medium or light; otherwise, if it will be used solely for folding, select full.
Finally, you'll be asked whether you want the Folding@home application to be automatically started. Answer Yes and it will then be run automatically as a service upon startup. It will be added to the systemd services as FAHClient.service.
If you want to alter your Folding@home configuration later, you can always edit the /etc/fahclient/config.xml file. If you ever want to uninstall Folding@home, you can enter the following command:
sudo dpkg -P fahclient.deb
Step 4: View the Web Interface
With the Folding@home client service installed and running, you can now view a web interface for it by visiting the address https://client.foldingathome.org/ in the Chromium web browser on your Raspberry Pi.
This will show you how much of an assigned 'work unit' it has completed, how many days it should take your Raspberry Pi to complete, and the estimated points you will earn. Note that points have no monetary value and are just for kudos.
There are options for choosing which diseases to help research, how much processing power to use, and when to use it. You can also change your identity and enter a team number and passkey if you later opt to join a team.
There’s also a large Stop Folding button you can use to stop the Folding@home processing at any point.
Step 5: Cool Your Raspberry Pi (Optional)
Folding@home uses a lot of processing power and so your Raspberry Pi's SoC (system on a chip) will be working hard and is likely to reach a high temperature. You can check its temperature in a Terminal window with the following command:
vcgencmd measure_temp
Our Raspberry Pi 4's SoC was averaging around 80°C (176°F) at Medium level processing for Folding@home. The silver SoC on the board was noticeably hot, so don't touch it!
A Raspberry Pi will start throttling its CPU cores at 80°C, in an attempt to keep the temperature down. If it reaches 85°C, it will implement full throttling, including for the SoC’s GPU.
To enable your Folding@home system to work at full capaciity, therefore, you may want to consider adding passive and/or active cooling to your Raspberry Pi, in the form or a heatsink and/or fan. Unfortunately, this is not an option for a Raspberry Pi 400.
Sometimes supplied as part of a case, a heatsink is simply attached to the square silver SoC on the Raspberry Pi board and will absorb some of the heat from it.
To improve cooling further, you may want to add a fan, such as the Raspberry Pi 4 Case Fan, which fits to the lid of the official case and connects to three of the board’s GPIO pins. Another option is Pimoroni's Fan Shim, whose shim fits onto the end of the GPIO header with a friction fit. Both will help to keep your Raspberry Pi cool and performing at its full processing capacity.
Folding@home on Raspberry Pi: Success
Whether you keep your Raspberry Pi runnings Folding@home continually or occasionally, at full processing capacity or less, you'll be contributing to valuable scientific research that may help cure diseases. Folding@home is just one of many citizen science projects around the world that you can join.