BOINC on an RPi - a quick guide and some tips

I’ve been running BOINC on my Raspberry Pi 3 for the past few weeks. Like SETI@Home (which I ran many years ago for the pretty screensaver) BOINC is a system for distributed computing - performing a larger task on many CPU cores. More specifically BOINC isn’t a distributed computing project by itself - it’s a system for facilitating distributed computing projects on a machine. In fact SETI@Home is now able to work as a BOINC project, but it’s not something I want to run any more as I think the chances of them ever being to find or analyse extra-terrestrial signals successfully is close to nil - even factoring in the Drake equation. There are lots of other more useful and worthy projects available and I wanted to let my Pi’s mostly idle CPU cores contribute to this effort.

There are a few guides dotted around on doing this with a Raspberry Pi but other than installation and showing me how to join projects they weren’t really helpful in helping me decide if I wanted to actually do it and what to expect. So this will hopefully serve as a tutorial and also give you some tips for later management. It’s been quite hard to get things working how I want it - heat is a worry on a stock RPi with no active cooling. I have a heatsink stuck on but realistically it doesn’t do too much. Maybe a few degrees C. But it cost me a quid from The Pi Hut, so...

I’ll also say that I’m running my Pi headless for both reasons of application and performance. You can do this all very easily in a GUI with the BOINC Manager application (and there are lots of guides for that) but I’m sticking with a headless system controlled by BAM - that way you don’t have to SSH in all the time.

What you’ll need

  1. Realistically you’ll want to be doing this on an RPi 3 or 3b - 2s do work but are of course slower, and I wouldn’t bother on anything lower than that (but people do, especially in clusters).
  2. You shouldn’t do this on a Pi you’re using all the time. While it can work around your spare CPU cycles I find it’s better to devote a machine to it - or a very lightly accessed server. It’s easier to control how hard your Pi is working on BOINC tasks (and hence temperature) if that’s the only thing it’s doing. Also if the tasks are hardly running because you're caning your Pi then what's the point? Every little helps but not if you take the piss...
  3. And of course you’ll need an internet connection. It doesn’t use much bandwidth or data but obviously if you’re metered or using your network heavily you’ll want to make sure it fits around everything ok.

Installation

You’re going to need to install a few new things (the BOINC client and boinctui - a nice command line ncurses GUI to monitor things on the local system) and a standard update/upgrade is a good idea too:

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install boinc-client boinctui

With any luck that’s all you need to install. The BOINC process is installed as a service with systemd and can be controlled manually in the usual way:

sudo systemd [stop/start/restart etc] boinc-client.service

Configuring it all

Before doing anything you should pop along to BAM [Link] and sign up for an account. The idea is to not have to log into the Pi to control this and BAM allows us to manage things via a nice web interface. You can join projects using the interface and also set preferences on a per-machine level if you have more than one computer running BOINC. Preferences from BAM or a local BOINC manager client take precedence over the options you specify on an individual project’s website. It’s worth examining the features on the site after you’ve configured BOINC on your system. If - like me - you like more immediate updates and finer control of individual tasks than BAM then using boinctui is quite nice and much preferred to the boinccmd command line tool. Realistically you’ll be using both BAM and boinctui.

The same username/password used for BAM will be used to create and log into accounts for each project that you join. If you’ve already added projects locally before linking to BAM then don’t worry - this is okay too, but you may want to link BAM to those projects later on for proper control and tracking.

After you’ve done this you can start joining projects! Here’s the bad news: there aren’t many projects that RPi owners can join. The ARM architecture that it’s designed around is unsupported by all but 7-8 projects (listed below). I don’t know why there aren’t more. Some died after a while. Is it that much work to port things to ARM? I’m not a developer... Edit 12/06/18 - Milkyway@Home compiles for the Pi as well.

  • Asteroids@Home
  • Einstein@Home
  • Enigma@Home
  • TN-Grid
  • Universe@Home
  • WU-Prop
  • yoyo@home

There may be more, I lost track. Choose whichever of those projects you want to run and add them using the BAM ”Sign-up For Projects” link on the left-hand side bar.

Find the projects you want to join in the list and click on the paperclip under Create Account. If you've already signed up somewhere (remember: has to be the same credentials as BAM) then click on Find Account. Repeat for every project you want.

We need to tell BAM that we want to automatically join these projects on our Pi so we don't have to do it manually for every project. Click on My Projects on the left-hand side bar (above the Sign Up link). Tick "Attach new host by default?" for each project.

Finally for this step we need to define some preferences for our RPi to use. This is where it gets tricky. I've limited my setup to use 3 out of the 4 available cores and only 45% of CPU time to reduce heat and load. If you have active cooling you can do more. The Pi will clock itself down at 80 deg C to protect the CPU. Click on Work Preferences on the left-hand side bar and then click on the Add Preference button.

Work your way down each item and select as necessary. Myself, I said 75% cores (3/4) and told it to only use 45% of CPU time. If you want to you can ask it to always connect to a network so it can always get and upload work. If you need to save SD/disk space then check those settings too. Most of these options are self-explanatory and there are lots of resources available online if you get stuck - no space to list them all here. Save when done.

Next we need to assign our preferences to the Pi. But first we need to tell BAM about it. We'll need to connect BOINC on our Raspberry Pi to BAM so it will register there. We'll use boinctui for this, so start it up. Hit F9 to enter the menus, move to Project, and choose the connect to account manager option. Select BAM and enter your username and password.

Switching back to BOINC, click on Host List in the left-hand side bar and select the Pi from the list. Click on Edit and change the Work Preferences drop down box to the preferences you made previously and click Save.

Finally we need to get BOINC to resync with BAM so that it can start attaching to projects and downloading files. Reload boinctui and hit F9, then Project, then resynchronise with account manager.

And that's it! We're done! You'll now see boinctui start to connect to each project and start downloading files. Here's what it looks like, plus my modification to the code to display the current temperature.

Performance

Really bad. :)

Tips for easier management

You may want to do a few things to make managing the load on your Pi a bit easier. Checking the temperature of the CPU core allows you to react to changes and reduce work if needed. boinctui allows per-task control for pausing work, although sometimes it will download and start another task if you do that. It can be a pain to manage. Sometimes you'll need to stop the service for a bit and let things cool down, but if you hit the sweet spot with the settings as I seem to have you shouldn't have to worry.

Sometimes changing the work preferences on BAM to reduce CPU load and resynchronising with BAM in boinctui (Project menu) can work better to reduce the load.

You can check the temperature manually from the command line with:

vggencmd measure_temp

Conclusions

On the whole I’m pretty happy with this setup. It’s slow, obviously, but runs with little need for interference other than to taskwatch if you want. It surprises me how little time it took to do more work than 50% percent of all the BOINC users in the world - a matter of days. People try it and stop it quite quickly I guess.

In practical terms the power cost is obviously quite low also, but calculating it is not something I really care about or know how to do. Finally the setup was pretty quick - 30 mins for installation and some time to go over the BAM configuration.

After running several projects for a few weeks I wished I could do more for the cause but my other computers aren’t on for long enough to make it worth it. Then I had a brainwave... but that will have to wait for the next blog.

Comments