How I heated my home whilst also supporting Covid-19 (SARS-Cov2) research.

Jamie
5 min readOct 14, 2020

Like many other people during the COVID pandemic, I’ve moved my working environment to be exclusively at home. This has meant claiming the attic as my office. Although I have a pretty decent setup at home, I have noticed that things have started to get a bit chilly and find that my hands are ice cold in the evenings after a day of bashing on a keyboard.

Rather than running the house heating all day, I thought OK let’s get a heater for my attic space. As a started to look through all the different electrical heaters available and began to compare the wattage I thought why not instead just make sure that one of my GPU’s are running flat out when things get cold. After a quick search, it seems that I’m not the only person who thinks that using your computer, server, or GPU to heat your home could be an interesting idea. The guys at Qarnot launched a fan-less GPU rad back in 2018 and have since created a boiler to go with it. Heating your home along with hot water from computers. Love the concept.

Photo: ©Qarnot

Anyway, I wasn’t in the market for dropping £3600 on a fancy new GPU rad and after recently purchasing an NVIDIA 2080 ti to aid with the training of various models for my company fifty.io, maybe this would serve me well as a heater.

There are couple of options available here, I mean I could mine a few ETH and make about a £1 a day if I’m lucky which would just about offset the energy usage. Wow cool, I thought! That’s heating for free. (Well of course only if you have a spare beast of a GPU lying around). But that only applies if it’s still profitable to mine using your spare hardware.
Then I remembered hearing about the folding@home project a while back. FAH is a distributed computing project aimed to help scientists develop new therapeutics for a variety of diseases by the means of simulating protein dynamics. You can choose which area to support from COVID-19, Alzheimer’s, Cancer, Huntington’s, and Parkinson’s.

Great…this seems like a perfect choice for my GPU/CPU’s. I’m not going to go into much detail on how to setup across all operating systems etc. There is plenty of information available here: https://foldingathome.org/start-folding/ It runs on all operating systems and gives you a few config options such as how aggressive it should be and should it only work when idle.

As most techies are used to spinning up docker images locally and prefer to isolate code and resources for various reasons, I’ll focus on that. Although it appears quite simple to just install it natively and off you go.

It’s really as simple as creating a directory locally where the config and data files will be stored and cached. Lets call this /home/me/fah.
The only dependency that is required to be created before you spin up the image is a config file called config.xml. This will be placed in /home/me/fah or where ever you choose to create the cache dir on the host machine.

There is an example file:

https://gist.githubusercontent.com/oguya/5924b94c1be6ae9e070d/raw/c78f7371ee5ca14eb4abcd85124f490d8ab0778c/fah-config.xml

<config>
<!-- Folding Slot Configuration -->
<cause v='COVID_19'/>
<!-- HTTP Server -->
<allow v='127.0.0.1 172.17.0.1'/>
<power value="medium"/><!-- User Information get here https://foldingathome.org/support/faq/points/passkey/ -->
<passkey v='mykeyhere'/>
<user v='myusername'/>
<!-- Web Server -->
<web-allow v='127.0.0.1 172.17.0.1'/>
<web-enable v='true'/>
<disable-viz v='true'/>
<gui-enabled v='false'/>
<!-- Folding Slots -->
<slot id='0' type='GPU'>
</slot>
<slot id='1' type='CPU'>
<cpus v='2'/>
</slot>
</config>

As my docker seems to use a different IP range for connecting to them I had to change the web-allow and allow parameters to be my host IP of 127.0.0.1 172.17.0.1

In order for docker to share your hosts GPU or GPU’s with each image you must first make sure that you have installed nvidia-docker which you can find instructions here. You can test that it works by running:

docker run --rm --gpus all nvidia/cuda:11.0-base nvidia-smi

Which should output some stats about CUDA and the GPU’s visible. If this doesn’t work then you may also need to have installed the latest NVIDIA drivers and nvidia-cuda-toolkit on your main host.

Once you are happy that docker can see your GPU you are ready to run the folding@home image. I also like to restrict how many CPU’s the docker container has access too with the parameter cpuset-cpus. Also as I have 2 GPU’s and wanted to keep the main one that powers my UI free from load so I manually specified the spare using the value device=1. You can find out what id relates to which card by running the command nvidia-smi on the host machine first.

Now run:

docker run --gpus device=1 --name fah0 -d --cpuset-cpus 0–2 -p 7396:7396 --user "(id -u):$(id -g)" \
--volume /home/me/fah:/fah foldingathome/fah-gpu:latest

You image should start running and you will then be able to access the web UI from localhost:7396 which enables you to track whats going on with your processing.

After leaving this for an hour I found to no surprise my loft was super toasty and warmer than the rest of the house. Obviously, if I want to take this one step further I could look into setting up something like a Rasberry pi or smart home thermometer that could detect when to turn the docker image on or off by using something like IFTTT. For the time being this will be fine but will keep you posted on if I take this little project further and have the whole process thermostat driven.

Finally warm hands whilst also doing my bit for COVID.

If you are going to spend money on heating your home, then why not do your bit for humanity in the process .

--

--