Installing CUDA, wine & FAH GPU2 client in linux

biodoc

Diamond Member
Dec 29, 2005
6,320
2,240
136
Since there's no native FAH GPU2 client for linux yet, the only way to run GPU2 is through "wine", the windows emulator.

Check out the new Wiki here

These instructions are for 64-bit Ubuntu 8.04 "hardy heron'

Installing CUDA:

Here's the link I used to install CUDA. Kudos to "curran" and others for putting this together!:)

The instructions at the above link are for 32-bit ubuntu so I made a few modifications for 64-bit:

# Install the build tools we need
sudo apt-get install build-essential libglut3-dev -y

#Install the NVidia Drivers
#from http://www.nvidia.com/object/cuda_get.html -> Linux 64 bit
wget http://developer.download.nvid...x86_64-177.67-pkg2.run
chmod +x ./NVIDIA-Linux-x86_64-177.67-pkg2.run
# this will kick you to a terminal (the NVidia installer requires that X be shut down).
sudo /etc/init.d/gdm stop
hit ctrl+alt+F1, login, and execute the rest of the commands
sudo ./ NVIDIA-Linux-x86_64-177.67-pkg2.run (answer yes/ok to all the prompts)
sudo /etc/init.d/gdm start
# open a terminal window
rm ./ NVIDIA-Linux-x86_64-177.67-pkg2.run
# this next step resolves a driver conflict.
# if we don't do this, the machine will start in low-graphics mode on reboot
# add add 'nv' to DISABLED_MODULES ('DISABLED_MODULES="nv"') and save
sudo gedit /etc/default/linux-restricted-modules-common

# Install the CUDA Toolkit
wget http://developer.download.nvid..._ubuntu7.10_x86_64.run
chmod +x NVIDIA_CUDA_Toolkit_2.0_ubuntu7.10_x86_64.run
sudo ./NVIDIA_CUDA_Toolkit_2.0_ubuntu7.10_x86_64.run
rm NVIDIA_CUDA_Toolkit_2.0_ubuntu7.10_x86_64.run

# Add environment variables
echo "# CUDA stuff
PATH=\$PATH:/usr/local/cuda/bin
LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:/usr/local/cuda/lib
export PATH
export LD_LIBRARY_PATH" >> ~/.bashrc
# restart the terminal for the changes to take effect.

# Install the CUDA SDK
wget http://developer.download.nvid...02.0807.1535_linux.run
chmod +x ./NVIDIA_CUDA_SDK_2.02.0807.1535_linux.run
# press enter at both prompts
./NVIDIA_CUDA_SDK_2.02.0807.1535_linux.run
rm ./NVIDIA_CUDA_SDK_2.02.0807.1535_linux.run

# compile and run test programs
cd NVIDIA_CUDA_SDK/
sudo make

cd bin/linux/release/

ls to view test programs.

./?test program? to check installation (?passed? is good)

Installing wine (patched to get wine to recognize your nvidia card):

Kudos to Zerix01 and others at the overclockers forum for putting this together!:beer:

EDIT: #make sure you have the 32-bit libs installed before you start this.

sudo apt-get install ia32-libs

Here's the link to Zerix01's instructions for patching and installing wine from source. Scroll down to post #160.

I stopped after the "make install" step. You can use his instructions for the final steps but I went to the folding forum for the remaining steps in which they put together a "throttled" cudart which works well in my hands.

Compiling and installing cudart:

Go to this link over at the folding forum and read through it to see what kind of effort went into developing a "cuda wrapper" for wine. :beer:

Cheers to actong, andromeda, radaB, and everyone else who developed this!:beer::beer:

Go to page 6 of the thread and follow the instructions in radaB's post "howto for gentoo linux x86-64 users".

Start at 1.1 since CUDA is already installed.

The errors that nadaB mentions when you run "make" are a bit of a pain but you need to note the error like "Makefile:68" and then open the Makefile file with gedit and scroll down to line 68 and replace the spaces at the beginning of the line with a "tab". Keep doing this to correct all the format errors. (rerun make and correct next format error until it compiles successfully.

The last few steps are a bit different for ubuntu:

cp -a cudart.dll.so ~/.wine/drive_c/windows/system32/nvcuda.dll

sudo cp -a /usr/local/cuda/lib/* /usr/lib32

#make a directory in Program files

cd ~/.wine/drive_c/Program Files
mkdir fahgpu

download the fah GPU client for windows XP here and copy it to the folder you just created.

cd ~/.wine/drive_c/Program Files/fahgpu

# Make sure it's executable

chmod +x folding@home-Win32-GPU.exe

#configure

nice -n19 wine folding@home-Win32-GPU.exe -configonly

#run

nice -n19 wine folding@home-Win32-GPU.exe


Thanks again to all the people who put a lot of work into this.:beer::beer:

Let me know if I made any errors.










 

PCTC2

Diamond Member
Feb 18, 2007
3,892
33
91
YEAH! YOU ARE THE MAN BIODOC. Thanks. ;beer; :beer: :beer:

I'll have to do this soon. Once I migrate my server to some other computer.
 

biodoc

Diamond Member
Dec 29, 2005
6,320
2,240
136
There's a new Wiki for this process here

The instructions for installing CUDA on ubuntu 64 bit in my original post are still relevant.

You don't need to compile the CUDA test programs but I did it just to test my CUDA installation.

The Wiki has a link to download the second generation wrapper nvcuda.dll.so so you don't need to compile it.

Read the Wiki completely before you start!;)