Folding@home on Vast.ai: Support disease research by leveraging cheap GPU compute .

Jason Price
4 min readApr 5, 2020

--

We are at an amazing time in history where peer to peer distributed computing sites like vast.ai, offer over 75 Tflops (e.g. 4 x 2080 ti) of compute power for less than a cup of coffee. Fun fact … that is more powerful than the best supercomputer in 2002. What this means, is that anyone can support projects like folding@home, which is a distributed computing project focused on shared computational power for disease research. Research in the medical community requires a great deal of computing power and Folding@Home enables computers around the world to help out the cause.

So I was inspired by Team Hackaday using of Folding@Home to run simulation for the protein structure of COVID-19, in the hope for finding a cure for the coronavirus. In the tutorial below, I will show how you can support research in finding a cure, by renting compute power on vast.ai.

1. Select your image

a. In your browser, select your image and rig of choice at https://vast.ai/console/create/.

b. Select edit image and config.

c. Choose your image: I’ve made a folding@home image on docker hub that is compatible with vast.ai. There are two docker images:

  • Leave and forget: headless connection (ohgodatrini/fahclient:v7_5_1)
  • Hands on: shh into the machine and see what is happening (ohgodatrini/fahclient:v7_5_1_ssh).

I describe both options to connect in section 2 and 3 below.

2. Leave and forget: headless connection

This option is great if you just wish to put in your name and team and go about your day.

a. After selecting Edit image and config in step 1.b, input the image and your own information in the advanced arguments.

Name of a docker image: ohgodatrini/fahclient:v7_5_1

Advanced pass arguments to docker: --user=ohgodatrini --team=44851 --gpu=true --smp=true

b. Once the info is inputted, press select.

Note: you can find out more about creating a team and username here, but for now, I’ve joined Hackadays’s Team (44851) and used my username (ohgodatrini). The passkey is not needed, but you can generate on if you wish here.

c. Select your rig of choice

d. Navigate to your instance that has just been created https://vast.ai/console/instances/.

Note: your instance could take from 30 sec to 5 min to load, depending on the host connection speed, if the image is already on the host rig and the size of the image. Pro tip: ask the host to pre-load the image for you, so you can get started in less than a minute every time.

Also, with the headless option, you are not able to view the logs, but could ask the host if it is needed. However, on your instance page, the temperature and load on the GPU increases once the GPU gets work as shown above (GPU 75% Temp 45 deg C).

3. Hands on: shh into the machine

For this option, you can ssh into the machine, view the logs and tweak the parameters.

a. First select Edit image and config and choose Run interactive shell sever. SSH.

Name of a docker image: ```ohgodatrini/fahclient:v7_6_9_ssh

c. Select your rig of choice

d. Navigate to your instance that has just been created https://vast.ai/console/instances/ and click connect when loaded.

You can find my previous tutorial on connecting to Vast.ai via ssh on windows here.

Once connected, in the terminal change directory to the FAHClient by typing:

cd /usr/bin

You can then run the the FAHClient by inputting the info below (use my parameters or use your own):

FAHClient --user=ohgodatrini --team=44851 --gpu=true --smp=true

Below is the tmux terminal where you can see the logs.

What next ?

After a few hours you should be able to see your stats on folding.extremeoverclocking.com

or https://stats.foldingathome.org/teams

If you are having issues, feel free to reach out in the comments below or even better, join the Vast.ai Discord community (My handle is OhGodATrini#8608).

More info on Vast.ai’s peer to peer system can be found in the FAQ.

Edit 1(30–04–2020):

--

--

Jason Price

Process Engineer | Data Scientist | Crypto-Enthusiast