There is a lot of discussion about how to get the GPU2 client to run in Linux using WINE in this thread and on this wiki page, but I thought it would be helpful to put together a step-by-step guide to running GPU2 on a headless system, without running X or other unnecessary software.
This guide requires a little familiarity with Linux, but I'll try to be as descriptive as possible while still keeping it brief. It covers the whole install, from getting the Ubuntu ISO to running the GPU2 client. It's much easier to cut and paste the commands from this guide instead of typing them in by hand, so I recommend following this guide while running an ssh connection from another computer.
1. Download the ISO of the 64-bit version of Ubuntu Server 8.04.3. Here's a download link to mirrors.kernel.org. Burn the ISO and boot from the CD.
2. Go through the install, accepting all defaults (careful: this will wipe your hard drive, as this guide is designed for dedicated folding rigs). When asked which server software to include near the end of the install, select OpenSSH Server if you will be accessing the box remotely (move the cursor down with the tab key and then hit the spacebar when the cursor is next to the OpenSSH Server box).
3. Upon completion, the system will reboot. Log in on the console using the username and password you created during the install (or use ssh to log in from another system if you selected OpenSSH Server).
4. Update the system software and restart by entering the following three commands:
- Code: Select all
sudo apt-get update
sudo apt-get dist-upgrade
sudo reboot
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-x86_64-180.60-pkg2.run
wget http://developer.download.nvidia.com/compute/cuda/2_0/linux/toolkit/NVIDIA_CUDA_Toolkit_2.0_ubuntu7.10_x86.run
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`
8. Install the NVIDIA driver:
- Code: Select all
sudo sh NVIDIA-Linux-x86_64-180.60-pkg2.run
9. Install the NVIDIA 32-bit toolkit:
- Code: Select all
sudo sh NVIDIA_CUDA_Toolkit_2.0_ubuntu7.10_x86.run
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
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.dll
ln -s ~/.wine/drive_c/windows/system32/cudart.dll ~/.wine/drive_c/windows/system32/nvcuda.dll
13. Test to make sure the wrapper is properly linked:
- Code: Select all
ldd ~/.wine/drive_c/windows/system32/cudart.dll
- 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)
14. Create the following script to initialize CUDA without running X:
- Code: Select all
nano -w cudainit
- Code: Select all
#!/bin/bash
PATH=$PATH:/usr/local/cuda/bin
modprobe nvidia
if [ "$?" -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`; do
mknod -m 666 /dev/nvidia$i c 195 $i;
done
mknod -m 666 /dev/nvidiactl c 195 255
else
exit 1
fi
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
- Code: Select all
ls /dev/nv*
- Code: Select all
/dev/nvidia0 /dev/nvidiactl
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 ~/fahgpu2
unzip Folding@home-Win32-GPU_XP-623.zip -d fahgpu2
20. Time for the moment of truth: let's start the client!
- Code: Select all
cd ~/fahgpu2
nice wine Folding@home-Win32-GPU.exe -verbosity 9 -forcegpu nvidia_g80
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
cd
wget http://ra.vendomar.ee/~ivo/finstall
chmod u+x finstall
./finstall smp
foldingathome/folding start
Some notes:
I prefer to run the GPU2 client using the screen utility. To install:
- Code: Select all
sudo apt-get install screen
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.
Edit 11/11/08: ineffective nice command removed
Edit 12/09/08: Changed recommended Ubuntu version to 8.04.1, updated driver & client links, added nice command back, added dist-upgrade & reboot to Step 4, clarified multi-GPU use
Edit 2/3/09: Updated recommended Ubuntu version to 8.04.2
Edit 2/25/09 & 2/26/09: Warning about new Core 14 WUs that crash with current CUDA wrapper; new wrapper to be released soon
Edit 3/2/09: New wrapper posted for Core 14 WUs, cleaned up installation text, linked to latest NVIDIA driver, added more names to thank-you section
Edit 3/4/09: Deleted unnecessary symlink step, updated wrapper link to GPU2 wiki
Edit 3/6/09: Fixed and reordered wrapper test step
Edit 5/5/09: Updated link to latest NVIDIA driver
Edit 8/1/09: Removed warning about Core 14, updated links to Ubuntu 8.04.3 and NVIDIA driver 180.60
Edit 9/8/09: Fixed typo spotted by bollix47





