|
| 1 | +--- |
| 2 | +title: Help with COVID-19 research - protein folding on Raspberry Pi4 |
| 3 | +categories: |
| 4 | +- howto |
| 5 | +- english |
| 6 | +- personal |
| 7 | +tags: |
| 8 | +- covid19 |
| 9 | +- raspberry |
| 10 | +- rosetta |
| 11 | +--- |
| 12 | + |
| 13 | +Hello, it has been a while since I wrote here last time. |
| 14 | + |
| 15 | +Today I want to share with you something I've been doing in the last couple of |
| 16 | +days. The lock down measures for COVID-19 and some free time brought me to |
| 17 | +tinker a bit with my Raspberry Pi4. |
| 18 | + |
| 19 | +The project [Rosetta@home](https://boinc.bakerlab.org) allows people to give |
| 20 | +compute power to scientists for designing new proteins. The compute power could |
| 21 | +come from any device: a laptop, a desktop, a server and even a portable device. |
| 22 | + |
| 23 | +Recently I bumped into [the news of running Rosetta@home on aarch64 (arm64)]( |
| 24 | +https://twitter.com/mininodes/status/1246091380507553792) hardware and, |
| 25 | +in my case, on my new and shiny Raspebrry Pi4. |
| 26 | + |
| 27 | +In theory what you need is: |
| 28 | +* An account on: [https://boinc.bakerlab.org](https://boinc.bakerlab.org) |
| 29 | +* A Raspberry Pi4 |
| 30 | +* A 64-bit OS |
| 31 | +* The BOINC client |
| 32 | +``` |
| 33 | +$ sudo apt-get update |
| 34 | +$ sudo apt-get install boinc-client boinctui |
| 35 | +``` |
| 36 | +* The client configure with your email/password |
| 37 | + |
| 38 | +A good write-up could be found [here]( |
| 39 | +https://www.mininodes.com/how-to-run-rosettahome-on-arm-powered-devices/) |
| 40 | + |
| 41 | +[{: .align-center}]({{site.url}}/assets/images/protein_folding_on_rpi4.png) |
| 42 | + |
| 43 | +While I was setting it up I found few *"issues"*. Hopefully they could save you |
| 44 | +some time. |
| 45 | + |
| 46 | +**Rosetta doesn't work on Raspbian** |
| 47 | +If you own a Raspberry Pi4, I'm sure you'll have a [Raspbian]( |
| 48 | +https://www.raspberrypi.org/downloads/raspbian/) based system. It runs without |
| 49 | +any problem but unfortunately it is not suitable for running Rosetta@home. |
| 50 | +Although the hardware supports 64-bit, Raspbian is a 32-bit OS and this means |
| 51 | +it cannot run 64-bit applications. |
| 52 | +**Solution: install a 64-bit distribution.** |
| 53 | +Ubuntu officially supports Raspberry |
| 54 | +Pi4. Download the **64-bit** version from [here]( |
| 55 | +https://ubuntu.com/download/raspberry-pi) or follow [this tutorial from |
| 56 | +Ubuntu](https://ubuntu.com/tutorials/how-to-install-ubuntu-on-your-raspberry-pi) |
| 57 | +I had issue with WiFi module hence reverted to wired connection! |
| 58 | + |
| 59 | +**The SD card is a bit slow.** |
| 60 | +Although SD cards nowadays are fast, they are slower than HDD/SDD and when you |
| 61 | +run high I/O computations on them, they could fail fairly quick. |
| 62 | +**Solution: move the root file system out from the SD card to an external hard |
| 63 | +disk.** |
| 64 | +I had a 1TB portable one and it works like a charm. |
| 65 | +It's not that straightforward to move the root file system to an external disk |
| 66 | +but it's a doable. What you need is a [good guide]( |
| 67 | +https://www.tomshardware.com/uk/news/boot-raspberry-pi-from-usb,39782.html) |
| 68 | + |
| 69 | +**The Pi4 is slow.** |
| 70 | +Those are [the specs]( |
| 71 | +https://www.raspberrypi.org/products/raspberry-pi-4-model-b/specifications/). |
| 72 | +As you can see it has 4 CPUs running at 1.5GHz. Not bad for a small board. |
| 73 | +**Solution: overclock the CPU.** |
| 74 | +Just follow [this tutorial]( |
| 75 | +https://magpi.raspberrypi.org/articles/how-to-overclock-raspberry-pi-4). |
| 76 | +I did try to overclock it to 2GHz but it kept power cycling (likely due to |
| 77 | +power consumption) so **I stuck with 1.75GHz**. |
| 78 | + |
| 79 | +**High memory usage** |
| 80 | +Even I have the 4GB version, I found the Raspberry Pi4 to be very unstable |
| 81 | +while doing computations. Memory is somehow limited and when processes use a |
| 82 | +large amount of it, the OOM killer could be invoked killing processes that |
| 83 | +make the system unstable. |
| 84 | +**Solution: create a swapfile** |
| 85 | +Like any other Linux distribution [create swap space]( |
| 86 | +https://itsfoss.com/create-swap-file-linux/) to use part of the hard disk as |
| 87 | +_"extention"_ of the memory. I created a 4GB swap file and it seems working OK. |
| 88 | + |
0 commit comments