Running Folding@home on Amazon EC2 instances
Tags: aws, tutorial
Published: 2020-03-15 11:22:49

---
title: Running Folding@home on Amazon EC2 instances
published: true
date: 2020-03-15 08:32:42 UTC
tags: aws, tutorial
canonical_url: https://medium.com/@julsimon/running-folding-home-on-amazon-ec2-instances-ce6bb8f84218
---

[Folding@home](https://foldingathome.org/) is a long running project focused on disease research using distributed computing, and they recently launched a number of [projects](https://github.com/FoldingAtHome/coronavirus) related to COVID-19.

This blog post will show you how to use Amazon EC2 GPU instances with Folding@home. **This is a great way to help researchers, so please consider donating some GPU time**. If you have AWS credits about to expire, why not burn them for a good cause?

### Initial setup

First, I fire up an [Amazon EC2 P3](https://aws.amazon.com/ec2/instance-types/p3) instance, which hosts an NVIDIA V100 GPU. I use the [NVIDIA Deep Learning AMI 19.11.3](https://aws.amazon.com/marketplace/pp/NVIDIA-NVIDIA-Deep-Learning-AMI/B076K31M1S) in order to make sure that I have the latest NVIDIA drivers. This should also work on other AMIs, but your mileage may vary.

Then, I simply follow these [instructions](https://foldingathome.org/support/faq/installation-guides/linux/manual-installation-advanced/) to manually install the Folding@home client. Here are my exact steps:

```
wget [https://download.foldingathome.org/releases/public/release/fahclient/debian-testing-64bit/v7.4/fahclient\_7.4.4\_amd64.deb](https://download.foldingathome.org/releases/public/release/fahclient/debian-testing-64bit/v7.4/fahclient_7.4.4_amd64.deb)

wget [https://download.foldingathome.org/releases/public/release/fahcontrol/debian-testing-64bit/v7.4/fahcontrol\_7.4.4-1\_all.deb](https://download.foldingathome.org/releases/public/release/fahcontrol/debian-testing-64bit/v7.4/fahcontrol_7.4.4-1_all.deb)

sudo dpkg -i --force-depends fahclient\_7.4.4\_amd64.deb

sudo dpkg -i --force-depends fahcontrol\_7.4.4-1\_all.deb
```

Once I’ve completed the wizard setup, the client starts automatically. ‘_htop_’ confirms that the ‘_a7_’ Folding@Home core is crunching data.

![](https://cdn-images-1.medium.com/max/1024/1*FX4vdS14mzroueDRU6DaiQ.png)

By default, training is only running on the CPU. Let’s put that GPU to work!

### Enabling GPU training

I need to edit _/etc/fahclient/config.xml_ (sudo required):

```
<config>
 <! — Client Control →
 <fold-anon v=’true’/>

<! — Folding Slot Configuration →
 **<gpu v=’true’/>**

<! — Slot Control →
 <power v=’full’/>

<! — User Information →
 <user v=’JulienS’/>

<! — Folding Slots →
 <slot id=’0' type=’CPU’/>
 **<slot id=’1' type=’GPU’/>**
</config>
```

Then, I just stop and start the client:

```
sudo /etc/init.d/FAHClient stop

sudo /etc/init.d/FAHClient start
```

This fires up a GPU-optimized Folding@home core (core ‘22’).

![](https://cdn-images-1.medium.com/max/1024/1*6jmTSIxbA_xQ3x42_J7D1A.png)

Pretty soon, _nvidia-smi_ tells me that the GPU is now crunching as well.

![](https://cdn-images-1.medium.com/max/1024/1*98eOkJjVdtR_YhM2atDgAg.png)

Take that, COVID-19. Your days are counted.

Again, please consider donating some GPU time if you can. Thank you.