Contents
Installing CUDA on a Mac OS X
- Make sure your OS is up to date (I used Mac OS X 10.5.6)
Download Tookit and SDK from here
- Install the Tookit (NVIDIA_CUDA_Tookit_MacOSX.pkg)
When you get to the "Installation Type" step, you must click the "Customize" button!
- Make sure that everything is checked including "CUDAKext"
- Click "Install"
- When installation completes, it should prompt you to restart your computer. If it doesn't, something is probably wrong!
- Open your ~/.profile script, and add this line:
export DYLD_LIBRARY_PATH=/usr/local/cuda/lib:$LD_LIBRARY_PATH
- Either close any open shells, or type "source ~/.profile" to update them.
- Install the SDK (NVIDIA_CUDA_SDK_2.02.xxx.pkg)
- From the shell, do this:
cd /Developer/CUDA/ make cd bin/darwin/release ./particles
Running CUDA from Lincoln
Log on to teragrid
- Use "User Portal" Login and Password that you received via U.S. Mail
- Log on to abe
Click "My Teragrid" > "Accounts"
- You should get a list of all the clusters you have access to. Click "Login" for the Abe cluster
This will open up a web-based ssh client. I prefer to use putty, ssh, or just about anything else to this environment. If you don't mind using this web-based client, you can skip this step. Otherwise, authorize a public key like this:
- Create a file .ssh/authorized_keys
- Add your public key to that file
To enable the cuda environment (compiler, etc.) you must:
- Edit ~/.soft
- Add these two lines to the bottom of the file:
+cuda +nvidia-sdk - You may need to log out and back in after doing this
- Test that it worked by typing "which nvcc"
- Compile the examples:
cd $HOME cp -r /usr/local/NVIDIA_CUDA_SDK nvidia_examples cd nvidia_examples/ make
- Request an interactive job on 1 node with 8 processors for 5 minutes:
qsub -A bzx -I -V -q lincoln -l walltime=00:05:00,nodes=1:ppn=8
- cd ~/nvidia_examples/bin/linux/release
- ./deviceQuery
- This information was mostly gleaned from these sources:
Installing CUDA on a Ubuntu machine
- Make sure you have root access
Download the CUDA Driver, Tookit, and SDK from here
- Make sure to select your correct distribution (I used Ubuntu 8.04)
- Press Ctrl-Alt-F2 to bring up a non-gui prompt
- Install CUDA Driver
- sudo /etc/init.d/kdm stop
with gnome you may need to use this: /usr/X11R6/etc/rc.d/gdm.sh stop
- or with gnome you may need to use this: /etc/init.d/gdm stop
- uname -a (gives you the kernel version you'll need for next step)
sudo apt-get install linux-headers-<kernel version>
- sudo apt-get install build-essential
- sudo sh NVIDIA...
- sudo /etc/init.d/kdm start
- sudo /etc/init.d/kdm stop
- Install CUDA Toolkit
- Install CUDA SDK
- Build SDK examples
- sudo apt-get install libxi-dev
- sudo apt-get install libglut-dev
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib/
export PATH=$PATH:/usr/local/cuda/lib/
- cd ~/NVIDIA_CUDA_SDK
- make
- cd bin/bin/linux/release
- ./particles
Installing CUDA on a 64 bit Ubuntu machine with 8.10
- Follow the instructions above up to the "make" step
- open common/common.mk and remove 03 flag from COMMONFLAGS
- Some additional packages were missing; using apt-file (apt-get install apt-file;apt-file update) I was able to find them...
- First Xmu was missing:
- apt-file search Xmu | grep dev
- apt-get install libxmu-dev
- Next gnu/stubs-32.h was missing:
- apt-file search gnu/stubs-32.h | grep dev
- apt-get install libc6-dev-i386
CUDA Profiler
- Run cudaprof
- - Download if you don't already have it - /usr/local/cuda/cudaprof/bin/cudaprof
- Make a file somewhere called "temp.sh" like this
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib/ /usr/bin/python /home/lionetti/rl2_gen_dev/ode_cuda_be/test_odes.pyWhere test_flaim.py is the name of the python script that runs your code
Profile > Session Settings
- Set stuff up, and select which outputs you want
- Make sure to tell it to run in detached window
- Run!
