<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Hugh Xie on Medium]]></title>
        <description><![CDATA[Stories by Hugh Xie on Medium]]></description>
        <link>https://medium.com/@hughxie?source=rss-9f47e32cab07------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*7pZ7GX_uf3QscIsmo8zceA@2x.jpeg</url>
            <title>Stories by Hugh Xie on Medium</title>
            <link>https://medium.com/@hughxie?source=rss-9f47e32cab07------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 09:24:36 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@hughxie/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Run Folding@home in an Azure VM]]></title>
            <link>https://medium.com/@hughxie/run-folding-home-in-an-azure-vm-3d2df989a33e?source=rss-9f47e32cab07------2</link>
            <guid isPermaLink="false">https://medium.com/p/3d2df989a33e</guid>
            <category><![CDATA[folding-at-home]]></category>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[distributed-systems]]></category>
            <category><![CDATA[covid19]]></category>
            <category><![CDATA[azure]]></category>
            <dc:creator><![CDATA[Hugh Xie]]></dc:creator>
            <pubDate>Sun, 26 Apr 2020 07:06:57 GMT</pubDate>
            <atom:updated>2020-04-26T07:06:57.832Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*x7aGVT3WChtjpca_pqSNjg.png" /><figcaption>Photo by <a href="https://unsplash.com/@mohamadaz">Mohammad Alizade</a> on <a href="https://unsplash.com/">Unsplash</a></figcaption></figure><p><a href="https://foldingathome.org/">Folding@home</a> has gained a lot of attention recently, largely due to the current COVID-19 pandemic. Contributing to the project is pretty straightforward and there are lots of <a href="https://foldingathome.org/start-folding/">guides</a> on getting things running locally. However, it isn’t quite as easy running it cloud-side, especially when trying to leverage GPU acceleration.</p><p><em>There are plenty of people who receive Azure MSDN subscriptions through their employer. This gives you ~$150/month of credits. There are also lots of schools that offer sign-up bonuses for their students.</em></p><h4>Step 1</h4><p>You’ll need to create a VM, there are plenty of options but anything in the GPU family will yield considerably more points per day. Here is a <a href="https://foldingforum.org/viewtopic.php?f=16&amp;t=27849">thread</a> discussing yield differences between CPU and GPU folding. I’ve found it to be ~8x the points/dollar when folding with a single Tesla K80 vs 16 vCPUs which come in at similar prices.</p><p>Create the VM, if you have an MSDN subscription, this is where you’ll want to select it, but any Pay-As-You-Go subscription will work just fine. You can make a new resource group to make cost tracking a bit easier.</p><p>Name the virtual machine whatever you’d like.</p><p>Some regions may not support the VM size you want, so you may need to return to this, however, I’ve found that <em>West US</em> and <em>East US </em>have supported pretty much anything I can afford to run.</p><p>Spot instances aren’t available for me, but this would be a great way to limit the hourly cost.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9mUOHD0Q5n2CBFXUIs1j4w.png" /></figure><p>Select your VM size, check out the <a href="https://azure.microsoft.com/en-us/pricing/details/virtual-machines/windows/">Azure pricing tool</a> for more info. <strong>Make sure you select something in the N-series.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sqvkCVq7JW8Lgr-Jp6Dfdg.png" /></figure><p>Finally, create a username and upload your SSH public key. If you don’t have one, see this <a href="https://help.github.com/en/github/authenticating-to-github/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent">guide</a>.</p><pre>cat ~/.ssh/id_rsa.pub</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9zvjfMn7M8Ur1XUAzb5vmQ.png" /></figure><h4>Step 2</h4><p><strong>From the VM you just created, install and run FAHClient and FAHControl.</strong></p><p>Connect to the VM via SSH and run the following commands to install the FAHClient and FAHControl, as instructed by the <a href="https://foldingathome.org/support/faq/installation-guides/linux/manual-installation-advanced/">Manual Installation guide</a>.</p><pre>sudo wget <a href="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</a></pre><pre>sudo wget <a href="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</a></pre><pre>sudo dpkg -i --force-depends fahclient_7.4.4_amd64.deb</pre><p>The FAHClient package will ask for username, team number, passkey and system resources load. It should look like this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6YKQGwsXauTZtShAGYMctg.png" /></figure><p>Finally, install the FAHControl package.</p><pre>sudo dpkg -i --force-depends fahcontrol_7.4.4-1_all.deb</pre><p>At this point, the client will be running but only with the vCPUs.</p><h4>Step 3</h4><p><strong>If you don’t intend on using GPUs to fold you can skip this step. If you do, you’ll need to install NVIDIA drivers and CUDA Toolkit.</strong></p><p>You’ll need to install NVIDIA drivers and CUDA toolkit in order to use the GPUs with FAH.</p><p>Install NVIDIA drivers:</p><pre>wget <a href="http://us.download.nvidia.com/tesla/375.66/nvidia-diag-driver-local-repo-ubuntu1604_375.66-1_amd64.deb">http://us.download.nvidia.com/tesla/375.66/nvidia-diag-driver-local-repo-ubuntu1604_375.66-1_amd64.deb</a></pre><pre>sudo dpkg -i nvidia-diag-driver-local-repo-ubuntu1604_375.66-1_amd64.deb</pre><pre>sudo apt-get update</pre><pre>sudo apt-get install cuda-drivers</pre><pre>sudo reboot</pre><p>Install CUDA Toolkit:</p><pre>wget <a href="https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/cuda-repo-ubuntu1604_8.0.61-1_amd64.deb">https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/cuda-repo-ubuntu1604_8.0.61-1_amd64.deb</a></pre><pre>sudo dpkg -i cuda-repo-ubuntu1604_8.0.61-1_amd64.deb</pre><pre>sudo apt-get update</pre><pre>sudo apt-get install cuda</pre><p>Change the Folding Slot Configuration gpu flag to ‘true’ and add a folding slot for each GPU available in the virtual machine.</p><pre>sudo vi /etc/fahclient/config.xml</pre><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/03819aff28be21de9c5077c733936f95/href">https://medium.com/media/03819aff28be21de9c5077c733936f95/href</a></iframe><p>Restart the FAHClient.</p><pre>sudo /etc/init.d/FAHClient restart</pre><p>To verify that we are in fact using the GPUs, we can grab the FAH logs.</p><pre>tail -f /var/lib/fahclient/log.txt -n 150</pre><p>Alternatively, we can use <a href="https://www.cyberciti.biz/faq/ubuntu-linux-install-nvidia-driver-latest-proprietary-driver/">nvidia-smi</a>.</p><pre>watch -d -n 0.5 nvidia-smi</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rep20ieyW3IGtLBWdFsnsQ.png" /></figure><p>That’s it!</p><p>If you want to join our team, check it out here: <a href="https://stats.foldingathome.org/team/243344">GucciGang</a>.</p><p>Thanks for reading!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3d2df989a33e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>