About Me

A Computer Enthusiast who's learning as much as I can, while attempting to share and re-distribute the knowledge! Enjoy! :D

Monday, May 24, 2010

CUDA (Version 3.0) on Linux

Installing a working CUDA Environment

Assumptions: You have a working c/c++ environment (compilers and libraries)

I was able to install the drivers, toolkit, and SDK on Red Hat Enterprise 5 (without root access).

Please refer to NVIDIA's CUDA website to confirm your video card is CUDA ready (or you can check it here --> http://www.nvidia.com/object/cuda_gpus.html

1. Create the following directories on your Desktop (or another location specified by you):
  • Download Directory: /path/to/your/Desktop/cudaDownload (create the cudaDownload directory)
  • CUDA Installation Directory: /path/to/your/Desktop/cudadir (create the cudadir directory)
  • SDK Installation Directory: /path/to/your/Desktop/NVIDIA_GPU_COMPUTING_SDK ( create the NVIDIA_GPU_COMPUTING_SDK)

2. Set the following variables in your .bash_profile or .cshrc (I use csh at work, but bash at home)
  • PATH: /cuda/bin
  • LD_LIBRARY_PATH: /cuda/lib

3. Download the Development Drivers, Toolkit, and SDK from:
  • http://developer.nvidia.com/object/cuda_3_0_downloads.html

4. Install the drivers as root. If you've installed Proprietary NVIDIA drivers before, the process is the same. I wasn't able to install the drivers at work b/c of the root access problem:
  • Alt-Ctrl-F2
  • Log in as root (or yourself)
  • Stop your window manager: telinit 3 usually does it
  • Become root (if not already)
  • Navigate to the directory where you've downloaded the NVIDIA graphic drivers
  • Run sh .run

5. I usually reboot the system after installing the video card drivers, but I guess you could restart the window manager and log back in.

6. Install the Toolkit

7. Install the SDK:
I ran into a few problems at this point. Some Linux distributions look for glut libraries (specifically libglut.so) in /usr/lib (/usr/lib64 for 64-bit libraries). Red Hat Enterprise was complaining about -lglut library not being found when I ran the make command. A Google search led me to this website:
  • http://forums.nvidia.com/lofiversion/index.php?t46575.html
It explains on how I need to create a symbolic link (which you may or may not need to complete).

[root@rhel-boot lib] pwd
[root@rhel-boot lib] ln -s /usr/lib/libglut.so.3 /usr/lib/libglut.so
[root@rhel-boot lib] cd ../lib64
[root@rhel-boot lib] ln -s /usr/lib64/libglut.so.3 /usr/lib64/libglut.so

cd into /path/to/your/Desktop/NVIDIA_GPU_Computing_SDK/C

run the make command

8. At this point after the make command you should have a fully functional CUDA Development Environment. To test your environment:
  • cd into /path/to/your/Desktop/NVIDA_GPU_Computing_SDK/C/bin/linux/release
  • execute the binary deviceQuery: ./deviceQuery

The output should give you information on your CUDA Enabled Device!


1. NVIDIA CUDA 3.0 Downloads
  • http://developer.nvidia.com/object/cuda_3_0_downloads.html
2. NVIDIA Forums
  • http://forums.nvidia.com/lofiversion/index.php?t46575.html
3. Trial & Error

No comments:

Post a Comment