Skip to main content

Contribute to Coronavirus Research with Folding@home

FAHViewer1_efb876a2aaff1cb734198ed77acb70a6982cacd9.jpg

Distributed computing project takes up the fight against 2019-nCov and all you need is a computer to join the effort.

Folding@home (FAH) is a distributed computing project for disease research, which harnesses the spare processing power of hundreds of thousands of personal computers across the world, that are owned by volunteers who have installed the software on their systems. FAH is not a new project and its initial release was in the year 2000, with research areas that have so far included Alzheimer’s disease and Huntingdon’s disease, along with cancer research and drug design.

FAH has also assisted in research towards preventing viruses, such as influenza and HIV. On 27th February the project announced that it was now taking up the fight again 2019-nCov, with the aim of helping to develop a therapeutic antibody, similar to that previously developed for SARS-Cov.

Contributing to the effort is easy and next let’s take a look at getting set up.

Hardware and OS support

NVIDIA_Driver1_b151668c5f1903e295ca8616fd724cc0bc979e2b.jpg

FAH can make use of both CPUs and GPUs and, if you have the latter, you should try to ensure that you have the relevant drivers installed, since GPUs will provide far greater number crunching ability for tasks such as this. We decided to donate the resources of a 16-core Xeon workstation that is fitted with two NVIDIA GTX 1080 Ti GPUs, which is typically used for ML/AI training, along with more mundane tasks, such as running software build pipelines.

The system had recently been reinstalled and was running a fresh copy of Ubuntu 18.04.4, with the stock Ubuntu graphics driver, “nouveau”. So this meant we that needed to start by installing the drivers from NVIDIA and as part of which disabling the default driver.

Next we had to install the CUDA Toolkit, which provides access for high performance computing (HPC) applications. Of course, you may have a GPU from another vendor and in which case you would need to install their OpenCL SDK instead of CUDA. Don’t worry if you don’t have a GPU or one which is either CUDA or OpenCL compatible, as you can configure CPUs for use also.

Note that Windows and macOS are supported in addition to Linux.

FAH software

<config>
  <!-- Client Control -->
  <fold-anon v='true'/>

  <!-- Folding Slot Configuration -->
  <gpu v='false'/>

  <!-- Slot Control -->
  <power v='full'/>

  <!-- User Information -->
  <user v='MyUsername'/>

  <!-- Folding Slots -->
  <slot id='0' type='CPU'/>
</config>

The Start Folding page provides download links for FAH software and Installation Guides are provided for Windows, Linux and Mac. You will be prompted to enter a username and, optionally, a team name. In addition to which an optional passkey, which can be used to tie your contributions directly to you. Once set up you should have a configuration file similar to that shown above, which with Linux is located in /etc/fahclient/config.xml. With Windows it appears as though a GUI is used for configuration instead and for details see the Configuration Guide.

We can see that, by default, the CPU will be utilised and after the software has started, we can confirm this on Linux by running ps.

ps1_f67e7698df0b9bfe528af5131bcd1c097eb5cc24.jpg

Sure enough, ~3,200% utilisation (top process) suggests that all CPU cores are being put to use.

With an NVIDIA GPU we can then also use nvidia-smi to determine whether it is also running any workloads.

CUDA1_49b3866efb5ecd9690f511564405a38e965c60df.jpg

As we can see, at this point the GPUs are not doing any heavy lifting. So how do we change this? Simple, we just update config.xml and set:

<gpu v='true'/>

And in our case, since we have two GPUs and would like to use both, also:

<slot id='0' type='GPU'/>

<slot id='1' type='GPU'/>

If you had one GPU, you might just define one slot, else set one to GPU and another to CPU. We decided to just use the GPUs, since these offer far greater performance and we also didn’t want to potentially create thermal problems, with both GPUs and all the CPU cores permanently running at full capacity (this is a deskside workstation after all and not a server system).

After re-starting the FAH client software, we then checked the log file /var/lib/fahclient/log.txt and found:

14:04:41:WU01:FS00:0x22:Folding@home GPU Core22 Folding@home Core
14:04:41:WU01:FS00:0x22:Version 0.0.2
14:04:45:WU01:FS00:0x22:Completed 0 out of 5000000 steps (0%)
14:04:45:WU01:FS00:0x22:Temperature control disabled. Requirements: single Nvidia GPU, tmax must be < 110 and twait >= 900
14:04:45:WU02:FS01:0x22:Completed 0 out of 5000000 steps (0%)
14:04:45:WU02:FS01:0x22:Temperature control disabled. Requirements: single Nvidia GPU, tmax must be < 110 and twait >= 900
14:05:27:WU01:FS00:0x22:Completed 50000 out of 5000000 steps (1%)
14:05:28:WU02:FS01:0x22:Completed 50000 out of 5000000 steps (1%)
14:06:11:WU01:FS00:0x22:Completed 100000 out of 5000000 steps (2%)
14:06:11:WU02:FS01:0x22:Completed 100000 out of 5000000 steps (2%)
14:06:54:WU01:FS00:0x22:Completed 150000 out of 5000000 steps (3%)
14:06:55:WU02:FS01:0x22:Completed 150000 out of 5000000 steps (3%)
14:07:37:WU01:FS00:0x22:Completed 200000 out of 5000000 steps (4%)
14:07:40:WU02:FS01:0x22:Completed 200000 out of 5000000 steps (4%)
14:08:21:WU01:FS00:0x22:Completed 250000 out of 5000000 steps (5%)
14:08:24:WU02:FS01:0x22:Completed 250000 out of 5000000 steps (5%)

Suggesting that the GPUs were now being put to use.

CUDA_FAH1_892aab7efc0fa96c62bdcce354b8492fa29768cd.jpg

Running nvidia-smi once again we could confirm that this was indeed the case.

ps-CUDA1_01eb1eeef5bb6f1b61524b73b17b784867f3e24c.jpg

With ps also confirming that the CPU load has now been significantly reduced.

And that’s it, now we just leave the machine to process work units.

Obviously, if you have allocated significant resources to FAH and will be leaving the system running 24/7, it’s important to make sure it has plenty of ventilation and there is no possibility of overheating. As noted, if you do have one or more reasonably large GPUs fitted, then unless it’s a server chassis, you may also want to consider not running absolutely everything at full load, as this could cause thermal stress on components if run for an extended period. In our case, given the office is fairly small and the time of year, it also meant that we could reduce the heating a little.

Andrew Back

Open source (hardware and software!) advocate, Treasurer and Director of the Free and Open Source Silicon Foundation, organiser of Wuthering Bytes technology festival and founder of the Open Source Hardware User Group.
DesignSpark Electrical Logolinkedin