This guide describes the process to get Folding@Home running under Linux on your CPU as well as on your Nvidia Graphics card.
This works on Ubuntu 9.04 as of October 1st, 2009. This guide will only work for Nvidia cards, 8×00 cards or newer. I’ve heard about a wrapper for ATi cards, but seeing as I don’t own one I can’t really test it out.
Editors Note: This guide was tested on December 2nd, 2009 to still be working. If tested in the future, this note will be updated again to reflect these instructions are up to date.
This guide was done using Ubuntu 9.04 64-bit, and should work without any modification on other Debian based distros. To get SMP folding on the CPU client, you must have a 64-bit system.
Note: When copying terminal commands, copy after the $ symbol. The $ is used to indicate a new command, since some commands span over more than one line.
Update your distro
$ sudo apt-get update
$ sudo apt-get dist-upgrade
Setting up the CPU Client:
Setting up the CPU client is pretty straight-forward.
Start by opening a terminal (located in Applications > Accessories > Terminal).
Then type in or copy/paste this into the terminal:
$ sudo apt-get install ia32-libs
$ mkdir -p ~/folding
$ cd ~/folding
$ wget http://www.stanford.edu/group/pandegroup/folding/release/FAH6.24beta-Linux.tgz
$ tar xzf FAH6.24beta-Linux.tgz
Now you have created a folder in /home/yourname/ called folding, downloaded the linux F@H client and extracted it.
Now, to configure the client:
$ ./fah6 -configonly
Enter your settings, and then you can run the client using the following command:
$ ./fah6 -smp -verbosity 9
If you are using an i7, use
$ ./fah6 -smp 8 -verbosity 9
and furthermore, if you are running your i7 stable 24/7 you can use the -bigadv flag for a point bonus.
This is where it gets tricky, because there is no Linux GPU client, only the Windows binaries. Therefore we will use Wine to run it.
But first, we need to install drivers and the CUDA toolkit.
Let’s download the latest CUDA enabled driver.
Go to System > Administration > Hardware Drivers and select the 180 drivers, let them download and install.
The next step is downloading the CUDA toolkit. Open a new terminal and type:
$ wget http://developer.download.nvidia.com/compute/cuda/2_0/linux/toolkit/NVIDIA_CUDA_Toolkit_2.0_ubuntu7.10_x86.run
Then, within the same terminal type:
$ sudo sh NVIDIA_CUDA_Toolkit_2.0_ubuntu7.10_x86.run
Just hit enter to verify install path when asked. CUDA has been set up and you are ready to go.
In case you were wondering, the reason that I’m using the 7.10 toolkit is because the GPU2 wrapper was written for that version of the toolkit, newer toolkits do not work.
Then, we need to link the toolkit:
$ sudo sh -c “echo ‘/usr/local/cuda/lib’ > /etc/ld.so.conf.d/cuda.conf”
$ sudo ldconfig
The following command will download the latest stable binary release of wine:
$ sudo apt-get install wine
If you just installed Wine, you might want to create the directory structure before starting up the GPU client, do so by simply running notepad:
$ wine notepad
You need to download the CUDA wrapper, so the windows binaries can communicate with the Linux driver:
$ wget http://www.gpu2.twomurs.com/wrapper2ndgen/2.1/cudart.dll.so -O ~/.wine/drive_c/windows/system32/cudart.dll
$ ln -s ~/.wine/drive_c/windows/system32/cudart.dll ~/.wine/drive_c/windows/system32/nvcuda.dll
$ ldd ~/.wine/drive_c/windows/system32/cudart.dll
the result should be something like this:
user@computer:~$ ldd /usr/local/lib/wine/nvcuda.dll.so
linux-gate.so.1 => (0xf7fae000)
libcudart.so.2 => /usr/local/cuda/lib/libcudart.so.2 (0xf7f34000)
libwine.so.1 => /usr/local/lib/libwine.so.1 (0xf7dfd000)
libm.so.6 => /lib32/libm.so.6 (0xf7dd6000)
libc.so.6 => /lib32/libc.so.6 (0xf7c78000)
libdl.so.2 => /lib32/libdl.so.2 (0xf7c74000)
libpthread.so.0 => /lib32/libpthread.so.0 (0xf7c5b000)
librt.so.1 => /lib32/librt.so.1 (0xf7c52000)
libstdc++.so.6 => /usr/lib32/libstdc++.so.6 (0xf7b64000)
libgcc_s.so.1 => /usr/lib32/libgcc_s.so.1 (0xf7b54000)
If you see any not founds, it probably has something to do with the CUDA toolkit; make sure you installed 32-bit toolkit, not the 64-bit, even though you are running a 64-bit kernel.
Setting up the client
$ mkdir ~/gpu0
$ cd ~/gpu0
$ wget http://www.stanford.edu/group/pandegroup/folding/release/Folding@home-Win32-GPU_XP-623.zip
$ unzip Folding@home-Win32-GPU_XP-623.zip
Then run the client by typing:
$ nice -n 19 wine Folding@home-Win32-GPU.exe -forcegpu nvidia_g80
(even if you have a newer card than a G80, this is the flag to be given)
After configuring it, your client should be folding away.
Dual GPU Folding
If you have more than one GPU, you can use them both at the same time, just as you would do in Windows.
$ mkdir ~/gpu1/
$ cp ~/gpu0/Folding@home-Win32-GPU_XP-623.zip ~/gpu1/
$ cd ~/gpu1/
$ unzip Folding@home-Win32-GPU_XP-623.zip
Then run this client by typing:
nice -n 19 wine Folding@home-Win32-GPU.exe -forcegpu nvidia_g80 -gpu 1
And put machineid as 3
Scripts for running the clients.
I don’t like to have a lot of programs start up with my OS, so I have a simple script to start my clients.
Run these commands to create scripts for every client (Users with only one GPU need not do the last command):
$ echo -e “cd ~/folding/\n./fah6 -smp -verbosity 9 -advmethods” > ~/fahcpu
$ echo -e “cd ~/gpu0/\nnice -n 19 wine Folding@home-Win32-GPU.exe -forcegpu nvidia_g80 -verbosity 9 -advmethods -gpu 0” > ~/fahgpu0
$ echo -e “cd ~/gpu1/\nnice -n 19 wine Folding@home-Win32-GPU.exe -forcegpu nvidia_g80 -verbosity 9 -advmethods -gpu 1” > ~/fahgpu1
$ echo -e “gnome-terminal -x ./fahcpu\ngnome-terminal -x ./fahgpu0\ngnome-terminal -x ./fahgpu1” > ~/fah
$ chmod +x fahcpu fahgpu0 fahgpu1 fah
Now you can run all your clients by typing:
Running the clients on startup
Go to System > Preferences > Startup Applications
Now add the clients you want to run
Comment: cpu client
Comment: GPU0 client
Comment: GPU1 client
Next time you reboot your system, your folding clients will be running in the background.
However, as I stated earlier, I personally prefer running the ./fah script myself on each startup so I can monitor the output of each client, instead of having them run in the background.
Overclocking your GPU in Linux
If you are doing this, I assume you have already done so in Windows and know the safe clocks for your card(s). To overclock your video card in Linux you have to enable ‘coolbits’ in your nvidia control panel. To do this we will have to edit the xorg configuration:
$ sudo gedit /etc/X11/xorg.conf
And then add ‘Option “CoolBits” “1”‘ under ‘Section: “Device”‘ like so:
Identifier “Configured Video Device”
Option “NoLogo” “True”
Option “Coolbits” “1”
Save the file and quit. Now you will have access to the CoolBits menu under your nvidia control panel.
Access the control panel by typing $ sudo nvidia-settings in a terminal. You should now see a ‘Clock Frequencies’ section where you can set your clocks. This has to be done every time you boot up Linux though, so the most convenient way would be to flash your video card with a BIOS with increased clock settings. Doing that is risky and is NOT RECOMMENDED UNLESS YOU KNOW EXACTLY WHAT YOU ARE DOING.
For monitoring, I will use FahMon. If you have been folding on Windows, you have perhaps been using FahMon. So, we’ll grab the latest build using subversion. We’ll have to compile it from source ourselves, which can be very frustrating at times if you don’t have the correct dependencies. You can always run your favorite windows monitoring program using wine:
$ sudo apt-get install subversion
$ svn export http://svn.fahmon.net/trunk fahmon
$ cd fahmon
Now we have the source code ready to install. Before we do this, however, we need to fetch some libraries to compile them:
$ sudo apt-get install build-essential
$ sudo apt-get install libwxgtk2.8-0 libwxgtk2.8-dev libcurl4-gnutls-dev
Then we install with these commands:
$ sudo make install
Assuming you didn’t get any errors, FahMon is now installed and can be accessed from Applications > System Tools > FahMon, or by typing “fahmon” into a terminal.
This guide was based on information from:
http://folding.stanford.edu/English/LinSMPGuide Folding@Home – Linux SMP Guide
http://gpu2.twomurs.com/index.php?title=Main_Page bGPU2 – Linux
http://foldingforum.org/viewtopic.php?f=52&t=6793 NVIDIA GPU2 Linux/WINE Headless – Install Guide
Feel free to improve this guide and redistribute it, giving me credit would be greatly appreciated
If you have any questions, issues or anything regarding F@H under Linux, feel free to send me a PM on OCF and I will get back to you.
Questions and discussion of this article are on Overclockers Forums, join in!