r3 - 13 Feb 2008 - 16:57:35 - EvanBolligYou are here: TWiki >  Computing Web > VisCluster > VislabStatus > VisLabMenu > VislabCUDA

CUDA FAQ

HPxw6400.jpg

SCS VisLab:

Setting up CUDA

CUDA in your home directory

Problem CUDA may not be installed in a global location on all systems that have CUDA GPUs
Applies To SCS Classroom (i.e. class[01..20]) and Hallway machines (i.e. hallway-[a..f]), as well as any linux machine with a G80 or later NVidia graphics card.
Solution NOTE: In the following instructions "$>" represents a command prompt, not part of the commands.

1) Get the CUDA Toolkit corresponding to your OS installation (for classroom and hallway machines choose "x86"; VisLab? machines use "x86_64").
2) Execute the CUDA Toolkit installer to extract the installation to your home directory or a subdir.
3) Append the contents of the provided shell script to your .cshrc file (translate this if necessary for .bashrc), and update the "cuda_home" line to point to your Toolkit installation.
4) Source the .cshrc file (i.e. "$> source ~/.cshrc")
5) Verify that the NVidia Compiler is on your path (i.e. "$> nvcc" should output a list of compiler options).

CUDA is now ready to be used from your home directory.
Shell Script # Append this to your .cshrc or create a new
# C-shell script (i.e. "cuda.csh") which you
# will source manually everytime you need to
# use CUDA.

# Modify the following variable so it points to your Toolkit installation:
set cuda_home = "$HOME/research/cuda/toolkit/cuda"
set cuda_lib = "$cuda_home/lib"
set cuda_bin = "$cuda_home/bin"

if ( "${path}" !~ * $cuda_bin* ) then
set path = ( $cuda_bin $path )
endif

setenv LD_LIBRARY_PATH "$cuda_lib"
setenv CUDA_INSTALL_PATH "$cuda_home"
Additional Notes 1) The NVidia CUDA capable driver should be installed on all classroom and hallway machines; if your machine does not have this installed contact TSG. CUDA will not run without the driver installed globally.
2) If the shell script does not work, try removing the space between the star (*) and "$cuda_bin*".

Compiling the CUDA SDK and Examples

Problem The CUDA Toolkit is installed but you need examples of how to use it, or you need the CUTIL library (libcutil) which is not provided in the CUDA Toolkit installation.
Solution NOTE: The following instructions depend on the CUDA_INSTALL_PATH environment variable to point to an installation of the CUDA Toolkit (this is automatically setup for you if you followed the "CUDA in your home directory" solution above).

NVidia provides the CUDA SDK which includes libcutil and many examples of how to write CUDA code and build projects (i.e. Makefiles). To set this up locally or globally, follow these instructions:
1) Get the CUDA Toolkit.
2) Execute th SDK installer to extract the CUDA SDK to your desired directory.
3) From inside the SDK directory run the command "$> make"; this will build the SDK examples and CUDA Utility Library (libcutil).
4) When the build is complete you can run the examples from the "bin/{..}/release/" subdirectory ({...} will be platform specific).
5) Look for libcutil in "lib" directory.
Additional Notes The CUTIL library is not mandatory to compile and run CUDA programs; it provides an easy set of CUDA timers and other functions like "safe" calls that provide more verbose feedback when code execution fails.

CUDA Profiler

Problem Your CUDA code runs, but it is not clear if it performs as well as it could.
Solution Install the CUDA Profiler (Beta):
1) make sure qt4.i386 and qt4-devel.i386 are installed globally
2) untar the profiler tarball to your desired directory
3) Append the path for the profiler "bin" directory to your PATH variable (i.e. setenv PATH "${PATH}:CudaProfiler/bin")
4) execute "$> cudaprof"
Additional Notes This profiler is currently Beta.
2) To use this software on Fedora Core 5 (Kirk, Uhura -- 2/11/08) you must "$> setenv LD_LIBRARY_PATH "/opt/CudaVisualProfiler/bin". This will run the application with the Qt libraries provided with the CudaVisualProfiler? (FC5 libraries are incompatible).
Edit | Attach | Printable | Raw View | Backlinks: Web, All Webs | History: r3 < r2 < r1 | More topic actions
 
SCS TWiki

This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback