Overclock.net › Forums › Overclockers Care › Overclock.net Folding@Home Team › Folding@Home Guides and Tutorials › [Arch Linux] Headless GPU Folding (x64)
New Posts  All Forums:Forum Nav:

[Arch Linux] Headless GPU Folding (x64)

post #1 of 2
Thread Starter 
I'll start off by saying that I am by no means a linux expert, I just messed around with this all day and after I figured everything out (and made a few of my own tweaks) figured I'd share it with everyone else.


to start off, this guide assumes you have a fresh installation of arch linux x64, and may not work otherwise. I may eventually broaden it to include the x86 variety as well, but at this point I will not.

first, uncomment the multilib repository from your pacman.conf. I will use nano as the editor for it's simplicity, but feel free to use whatever you like.
Code:
nano /etc/pacman.conf
then uncomment these 2 lines by removing the # in front of them.
Code:
[multilib]
Include = /etc/pacman.d/mirrorlist
after this, do a full system upgrade with
Code:
pacman -Syu
next, install the nvidia drivers and wine with
Code:
pacman -S wine nvidia
once these are installed, you will need to install the nvidia cuda toolkit from the arch user repository (aur).

this can be done by first downloading the PKGBUILD file, and using the makepkg command, as shown
Code:
wget aur.archlinux.org/packages/lib32-cuda-toolkit/lib32-cuda-toolkit.tar.gz
tar -xzf lib32-cuda-toolkit.tar.gz
cd lib32-cuda-toolkit
makepkg -s --asroot
pacman -U lib32-cuda-toolkit-3.0-1-x86_64.pkg.tar.xz
this will install the x86 version of the cuda toolkit, since the x64 variety will not work for our purposes.

next, run a program in wine (notepad is usually good) to set up the folder structure where we're going to put the modified dlls needed, then download the files to ~/.wine/drive_c/windows/system32
Code:
wine notepad
wget http://www.linuxfah.info/wrapper-3.0/cudart/cudart.dll.so
wget http://www.linuxfah.info/wrapper-3.0/cufft.dll.so
cp cudart.dll.so ~/.wine/drive_c/windows/system32/cudart.dll
cp cufft.dll.so ~/.wine/drive_c/windows/system32/cufft.dll
cd ~/.wine/drive_c/windows/system32
ln -s cudart.dll nvcuda.dll
ln -s cudart.dll cudart32_20_14.dll
ln -s cufft.dll cufft32_20_14.dll
then, test the progress so far with the following command
Code:
ldd cudart.dll
if any part of the output says "not found" something is wrong, and you should recheck your linking.

next, we will download and run a script that will initialize every nvidia gpu in the system.

Code:
cd
wget http://www.overclock.net/attachment.php?attachmentid=181391&stc=1&d=1290295988
mv initgpu.txt initgpu
chmod u+x initgpu
./initgpu
then use the following command to check to see if it worked

Code:
ls /dev/nv*
the output should have an nvidia<gpu number starting with 0> for every gpu in the system. if not, recheck the previous steps.

if your gpus are properly initialized, you may continue on.

next, we need to download the nvclock utility, which handles overclocking (and who doesn't love overclocking?) and more importantly, fan control for our cards, since the fans don't change speeds in console mode.

Code:
pacman -S nvclock
then use the command
Code:
nvclock -f -C <card number 1-?> -F auto
to set the fan to automatic control based on the card's bios.

finally, we can download the folding client.
Code:
wget http://www.stanford.edu/group/pandegroup/folding/release/Folding@home-Win32-GPU_Vista-623.zip
then install unzip (to be able to open zip files) and extract the client. copy the nvcuda.dll file you downloaded earlier into the directory with the client after it is unzipped.
Code:
pacman -S unzip
mkdir gpu0
unzip Folding@home-Win32-GPU_vista-623.zip -d gpu0
cp nvcuda.dll.so gpu0/nvcuda.dll
please note the folder name gpu0 is important here, as I will upload a modified initialization script that will also start a client for each gpu it initializes.

next, I find it easier to run the first client with the configonly flag set to generate a config file, and then copy it to every additional client.

Code:
cd gpu0    # the cd command is important here
nice -n 19 wine Folding\\@home-Win32-GPU.exe -configonly
configure your client as normal. after finishing, use the cd command to return to the previous directory, and then make as many copies of your client as needed. I have 3 folding cards, so I made 2 additional copies.
Code:
cd
cp -r gpu0 gpu1
cp -r gpu0 gpu2
then, edit the client.cfg file in each directory to have a different machine id using your preferred text editor.
Code:
nano gpu1/client.cfg
nano gpu2/client.cfg
I did not edit the first, since it did not need changing.

now, test your clients to see if they will run without error using the following commands (substitute your flags as necessary)
Code:
cd gpu0
nice -n 19 wine Folding\\@home-Win32-GPU.exe -gpu 0 -forcegpu nvidia_g80
note, this will be just like starting a windows client in a command prompt menu, and you will not be able to enter any additional commands. to avoid this, append a & to the end of the command like so. the output will still be returned to that terminal though, so you may also want to redirect the output to null after you are sure it's working.
Code:
nice -n 19 wine Folding\\@home-Win32-GPU.exe -gpu 0 -forcegpu nvidia_g80 &    #starts in background
cd ..
cd gpu1
nice -n 19 wine Folding\\@home-Win32-GPU.exe -gpu 0 -forcegpu nvidia_g80 >/dev/null &     #starts in background and discards normal output
cd ..
cd gpu2
nice -n 19 wine Folding\\@home-Win32-GPU.exe -gpu 0 -forcegpu nvidia_g80 >/dev/null 2>&1 &     #starts in background and discards all output
cd ..
as promised above, you can also download a modified initialization script that will automatically start a client for every gpu initialized as long as there is a folder for each client (set up for gpu2 only with the -forcegpu nvidia_g80 flag set)

to get and run it, use the following commands
Code:
cd
wget http://www.overclock.net/attachment.php?attachmentid=181397&stc=1&d=1290298396
mv initandfold.txt initandfold
chmod u+x initandfold
./initandfold

If followed properly, everything above should allow you to take a system running a clean installation of Arch Linux x64 and download and run a gpu folding client for every one of your nvidia gpus. If it doesn't, I want to know so that I can work to improve this guide so that it works for everyone.


I must give credit to the other's whose work I used, so here it is:

http://foldingforum.org/viewtopic.php?f=54&t=6793 for all the headless features
and I can't seem to find the other guide I used that was based on gpu2 and ubuntu (no it wasn't zodac's) but I will add it when I find it again.
post #2 of 2
Bump.

And if someone does this... I want to see some pics.
Megadoomer
(14 items)
 
Family Computer
(13 items)
 
 
CPUMotherboardGraphicsRAM
Phenom II X6 1090T @ 4.0Ghz ASUS M4A89GTD PRO Sparkle GTS 450 2x4GB G-Skill Sniper 
Hard DriveCoolingOSMonitor
Samsung F1 1TB CM Hyper 212+ Windows 7 Professional x64 Samsung T220 
KeyboardPowerCaseMouse
Logitech MX3000 Laser CM 1000M HAF 922 Logitech VX Revolution 
CPUMotherboardGraphicsRAM
Q6600 Asus PN5-D 750i Evga GTS 250 2x2GB Crucial Ballistix 
Hard DriveOptical DriveOSMonitor
750GB Hitachi Samsung Super Writemaster Windows 7 Professional x64 19" Dell 
PowerCase
Corsair 450VX Antec 900 
  hide details  
Reply
Megadoomer
(14 items)
 
Family Computer
(13 items)
 
 
CPUMotherboardGraphicsRAM
Phenom II X6 1090T @ 4.0Ghz ASUS M4A89GTD PRO Sparkle GTS 450 2x4GB G-Skill Sniper 
Hard DriveCoolingOSMonitor
Samsung F1 1TB CM Hyper 212+ Windows 7 Professional x64 Samsung T220 
KeyboardPowerCaseMouse
Logitech MX3000 Laser CM 1000M HAF 922 Logitech VX Revolution 
CPUMotherboardGraphicsRAM
Q6600 Asus PN5-D 750i Evga GTS 250 2x2GB Crucial Ballistix 
Hard DriveOptical DriveOSMonitor
750GB Hitachi Samsung Super Writemaster Windows 7 Professional x64 19" Dell 
PowerCase
Corsair 450VX Antec 900 
  hide details  
Reply
New Posts  All Forums:Forum Nav:
  Return Home
Overclock.net › Forums › Overclockers Care › Overclock.net Folding@Home Team › Folding@Home Guides and Tutorials › [Arch Linux] Headless GPU Folding (x64)