CUDA Docs

Installing CUDA on a Windows

  1. Follow the instructions on how to install CUDA from NVIDIA’s website.

  2. After CUDA is successfully installed, you will need to tell Continuity where it was installed. Make sure that after installation that you have CUDA_BIN_PATH, CUDA_INC_PATH and CUDA_LIB_PATH set to the location of where CUDA was installed (e.g., C:\CUDA\bin, C:\CUDA\include, C:\CUDA\lib) and also include the CUDA\bin directory in your PATH variable.
  3. Lastly, CUDA needs to be able to link after compiling, and you will need to provide a linking tool (e.g., cl.exe as included with Microsoft’s Visual Studio). You will need to add the location of that cl.exe file to Continuity’s build environment, and that is located at: <CONT_ROOT>/pcty/MglToolsLibWin/msys/1.0/home/<username>/.profile.

Installing CUDA on a Mac OS X

  1. Make sure your OS is up to date (I used Mac OS X 10.5.6)
  2. Download Tookit and SDK from here

  3. Install the Tookit (NVIDIA_CUDA_Tookit_MacOSX.pkg)
    1. When you get to the “Installation Type” step, you must click the “Customize” button!

    2. Make sure that everything is checked including “CUDAKext”
    3. Click “Install”
    4. When installation completes, it should prompt you to restart your computer. If it doesn’t, something is probably wrong!
  4. Open your ~/.profile script, and add this line:
    •       export DYLD_LIBRARY_PATH=/usr/local/cuda/lib:$LD_LIBRARY_PATH

       

  5. Either close any open shells, or type “source ~/.profile” to update them.
  6. Install the SDK (NVIDIA_CUDA_SDK_2.02.xxx.pkg)
  7. From the shell, do this:
    •       cd /Developer/CUDA/
            make
            cd bin/darwin/release
            ./particles

       

Installing on a Snow Leopard

  1. Most of the instructions above work; however, /Developer/CUDA is now /Developer/GPU Computing/C
  2. In addition to the toolkit and SDK, the driver package needed to be installed, Driver 2.3.1a worked for me
  3. There seems to be an issue with the order in which things need to be installed, and it seems if you install the Driver 2.3.1a before the toolkit or SDK, things do not get installed correctly, and so, you should install Driver 2.3.1a after the toolkit and SDK.
  4. Once everything is installed, go to: /Developer/GPU Computing/C and do:
    • make clobber
      make i386=1

       

Running CUDA from Lincoln

  1. Log on to teragrid

    1. Use “User Portal” Login and Password that you received via U.S. Mail
  2. Log on to abe
    1. Click “My Teragrid” > “Accounts”

    2. You should get a list of all the clusters you have access to. Click “Login” for the Abe cluster
  3. 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:

    1. Create a file .ssh/authorized_keys
    2. Add your public key to that file
  4. To enable the cuda environment (compiler, etc.) you must:

    1. Edit ~/.soft
    2. Add these two lines to the bottom of the file:
           +cuda
           +nvidia-sdk

       

    3. You may need to log out and back in after doing this
    4. Test that it worked by typing “which nvcc”
  5. Compile the examples:
    •    cd $HOME
         cp -r /usr/local/NVIDIA_CUDA_SDK nvidia_examples
         cd nvidia_examples/
         make

       

  6. 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

  7. cd ~/nvidia_examples/bin/linux/release
  8. ./deviceQuery
  9. This information was mostly gleaned from these sources:

Installing CUDA on a Ubuntu machine

  1. Make sure you have root access
  2. Download the CUDA Driver, Tookit, and SDK from here

    1. Make sure to select your correct distribution (I used Ubuntu 8.04)
  3. Press Ctrl-Alt-F2 to bring up a non-gui prompt
  4. Install CUDA Driver
    1. 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
    2. uname -a (gives you the kernel version you’ll need for next step)
    3. sudo apt-get install linux-headers-‘uname -r’
    4. sudo apt-get install build-essential
    5. sudo sh NVIDIA…
    6. sudo /etc/init.d/kdm start
  5. Install CUDA Toolkit
  6. Install CUDA SDK
  7. Build SDK examples
    1. sudo apt-get install libxi-dev
    2. sudo apt-get install libglut-dev
    3. export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib/

    4. export PATH=$PATH:/usr/local/cuda/lib/

    5. cd ~/NVIDIA_CUDA_SDK
    6. make
    7. cd bin/bin/linux/release
    8. ./particles

Installing CUDA on a 64 bit Ubuntu machine with 8.10

  1. Follow the instructions above up to the “make” step
  2. open common/common.mk and remove 03 flag from COMMONFLAGS
  3. Some additional packages were missing; using apt-file (apt-get install apt-file;apt-file update) I was able to find them…
  4. First Xmu was missing:
    • apt-file search Xmu | grep dev
    • apt-get install libxmu-dev
  5. Next gnu/stubs-32.h was missing:
    • apt-file search gnu/stubs-32.h | grep dev
    • apt-get install libc6-dev-i386

CUDA Profiler

  1. Run cudaprof
    • – Download if you don’t already have it – /usr/local/cuda/cudaprof/bin/cudaprof
  2. 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.py

      Where test_flaim.py is the name of the python script that runs your code

  3. Profile > Session Settings

    1. Set stuff up, and select which outputs you want
    2. Make sure to tell it to run in detached window
    3. Run!

Other Prerequisites

  1. sympy

  2. ply

  3. pycparser