No replies
Bill Haynes
Bill Haynes's picture
User offline. Last seen 4 days 21 hours ago. Offline
Joined: 03/25/2009

Using this tutorial, in about 15 minutes you can have your machine doing both Folding@Home on the processor and utilizing your video card as well. Video cards are capable of an extreme amount of computing power when utilized efficiently. Putting this to work on your machine will definitely boost your points! I have done this to QuickBreeze's machine and tested it successfully. It is running more than 3x the speed of the CPU client with a very similar size WU. This is definitely worth doing!

Code: Select all
sudo apt-get updatesudo apt-get dist-upgradesudo reboot

You
will be asked for your password when using the sudo command. Rebooting
will use the latest kernel version you just downloaded and installed.
If you don't reboot, you may download the wrong header files in Step 7.5. Log back in after rebooting, then install WINE:

Code: Select all
sudo apt-get install wine

6. Download the latest 180-series NVIDIA Linux 64-bit driver and the CUDA 2.0 32-bit toolkit:

Code: Select all
wget http://us.download.nvidia.com/XFree86/Linux-x86_64/180.60/NVIDIA-Linux-x...wget http://developer.download.nvidia.com/compute/cuda/2_0/linux/toolkit/NVIDIA_CUDA_Toolkit_2.0_ubuntu7.10_x86.run

Note:
the forum's line-wrapping may split the second wget statement into two
lines, depending on the width of your browser -- it should be on one
line only. By the way, it's okay to download the toolkit for Ubuntu
7.10... it works fine with 8.04.3. WARNING: As of now, the 185 series
drivers do not work with GPU folding, so make sure you download 180.60.7. Before you install the NVIDIA driver, you need to install some Linux build utilities and header files:

Code: Select all
sudo apt-get install build-essential linux-headers-`uname -r`

Those
are backward apostrophes surrounding the uname command, which allows
the output of uname to be incorporated into the filename of the headers
file. Cut and paste from the above line if you have trouble downloading
the proper headers.8. Install the NVIDIA driver:

Code: Select all
sudo sh NVIDIA-Linux-x86_64-180.60-pkg2.run

Follow
the prompts. You can select "No" when asked to download a kernel
interface. Go ahead and install the OpenGL libraries too. Answer "Yes"
when asked if you would like to run the nvidia-xconfig utility.9. Install the NVIDIA 32-bit toolkit:

Code: Select all
sudo sh NVIDIA_CUDA_Toolkit_2.0_ubuntu7.10_x86.run

Use the default path by hitting Enter when prompted.10. Link the toolkit:

Code: Select all
sudo sh -c "echo '/usr/local/cuda/lib' > /etc/ld.so.conf.d/cuda.conf"sudo ldconfig

11. Create the WINE directory structure:

Code: Select all
wine notepad

Disregard the errors; all we need is the directory structure created in ~/.wine when you run it the first time.12. Download the latest WINE wrapper, save it to WINE's windows/system32 directory, and create a symlink:

Code: Select all
wget http://www.gpu2.twomurs.com/wrapper2ndgen/2.1/cudart.dll.so -O ~/.wine/drive_c/windows/system32/cudart.dllln -s ~/.wine/drive_c/windows/system32/cudart.dll ~/.wine/drive_c/windows/system32/nvcuda.dll

Watch the line wrap again -- there are two commands here.13. Test to make sure the wrapper is properly linked:

Code: Select all
ldd ~/.wine/drive_c/windows/system32/cudart.dll

The output should look something like this:

Code: Select all
        linux-gate.so.1 =>  (0xf7fcb000)        libcudart.so.2 => /usr/local/cuda/lib/libcudart.so.2 (0xf7f63000)        libwine.so.1 => /usr/lib32/libwine.so.1 (0xf7e2c000)        libm.so.6 => /lib32/libm.so.6 (0xf7e05000)        libc.so.6 => /lib32/libc.so.6 (0xf7ca7000)        libdl.so.2 => /lib32/libdl.so.2 (0xf7ca3000)        libpthread.so.0 => /lib32/libpthread.so.0 (0xf7c8a000)        librt.so.1 => /lib32/librt.so.1 (0xf7c81000)        libstdc++.so.6 => /usr/lib32/libstdc++.so.6 (0xf7b93000)        libgcc_s.so.1 => /usr/lib32/libgcc_s.so.1 (0xf7b83000)        /lib/ld-linux.so.2 (0xf7fcc000)

If you see any of the libraries with "not found" then the linking didn't work. Go back to step 10.14. Create the following script to initialize CUDA without running X:

Code: Select all
nano -w cudainit

Paste the following into the file:

Code: Select all
#!/bin/bashPATH=$PATH:/usr/local/cuda/binmodprobe nvidiaif [ "$?" -eq 0 ]; then# Count the number of NVIDIA controllers found.N3D=`/usr/bin/lspci | grep -i NVIDIA | grep "3D controller" | wc -l`NVGA=`/usr/bin/lspci | grep -i NVIDIA | grep "VGA compatible controller" | wc -l`N=`expr $N3D + $NVGA - 1`for i in `seq 0 $N`; domknod -m 666 /dev/nvidia$i c 195 $i;donemknod -m 666 /dev/nvidiactl c 195 255elseexit 1fi

To exit nano and save the file, hit CTRL-X.15. Make the cudainit file executable.

Code: Select all
chmod u+x cudainit

16. Run the cudainit script as root.

Code: Select all
sudo ./cudainit

You should now have a few extra devices in /dev; check to make sure:

Code: Select all
ls /dev/nv*

If you have one video card, you should see the following:

Code: Select all
/dev/nvidia0  /dev/nvidiactl

You
will need to rerun this script before starting the client whenever you
reboot your system. You may want to include this in a login/startup
script so it executes automatically whenever you reboot.17. Time to download the console version of the GPU2 folding client (finally!):

Code: Select all
wget http://www.stanford.edu/group/pandegroup/folding/release/Folding@home-Win32-GPU_XP-623.zip

18. Ubuntu doesn't come with an unzip program, so we'll install it:

Code: Select all
sudo apt-get install unzip

19. Create a directory to keep your folding files, then unzip the client into it:

Code: Select all
mkdir ~/fahgpu2unzip Folding@home-Win32-GPU_XP-623.zip (0) -d fahgpu2

20. Time for the moment of truth: let's start the client!

Code: Select all
cd ~/fahgpu2nice wine Folding@home-Win32-GPU.exe -verbosity 9 -forcegpu nvidia_g80

If
you have more than one video card, you can run a separate instance of
the client using the -gpu flag. Use -gpu 0 for the first card, then
-gpu 1 for the second card, etc. If you have only one card, you don't
need the -gpu flag. Make sure that you assign different Machine IDs
during the configuration if you run more than one client!Since
we're running 64-bit Ubuntu, we can run an SMP client at the same time
if you have a dual or quad core processor. I recommend Ivoshiee's
excellent finstall script. Just enter the following commands:

Code: Select all
cdwget http://ra.vendomar.ee/~ivo/finstallchmod u+x finstall./finstall smpfoldingathome/folding start

More info is available at the finstall wiki page.Some notes:I prefer to run the GPU2 client using the screen utility. To install:

Code: Select all
sudo apt-get install screen

To
start, just type "screen" at the prompt, and you will create a new
terminal. Start the folding client, then you can "detach" the screen by
pressing CTRL-A, release, then d. To reconnect, type "screen -r" at the
prompt. Type "man screen" at the prompt for more info if you're not
familiar with it.When you stop folding by hitting CTRL-C, make
sure all of your core files terminate before restarting the client. If
the core doesn't terminate and you restart, the WU will EUE. After
exiting the client, type "top" to see if any processes labeled
"FahCore_11.exe" or "FahCore_14.exe" are still running. Note the PID
number of the process on the left, then quit out of top (hit "q"), then
type "kill" followed by the PID number and hit Enter. Check "top" again
to make sure it's killed.I recommend using Ubuntu 8.04.3
instead of 8.10 or 9.04, especially if you have a quad core system and
want to run an SMP client at the same time. SMP performance on 8.10 is
much slower for quads, and 9.04 isn't much better. Dual core CPUs don't
seem to be affected.Special thanks to all who contributed to the GPU2 Linux/WINE thread, especially shatteredsilicon, actong, and Shelnutt, and to Mindmatter, who created the wiki page. Extra special thanks to ihaque for his input from the Pande Group side of things.

Share/Save

Recent activity