CUDA

If you want to test CUDA on the math lab-computers, do the following steps once.

  1. Fetch cudatoolkit_4.0.17_linux_64_rhel5.5.run (CUDA Toolkit for RedHat Enterprise Linux 5.5, 64 bit). This is not the latest version, but it is the latest which works together with the graphics driver installed on the lab-machines (and no, I do not have root-privileges so I can install the latest driver).
  2. Make the file executable, chmod u+x cudatoolkit_4.0.17_linux_64_rhel5.5.run 
  3. Execute it and choose a suitable installation path. ./cudatoolkit_4.0.17_linux_64_rhel5.5.run
  4. Update your path and LD_LIBRARY_PATH according to the instructions which appear.

Write a program (copy the CUBLAS-program from the lecture, for example) and then compile it:

nvcc your_program.c -lcublas

and execute it

./a.out

Note that GPU on the math-machines, a GeForce 9500 GT, has compute capability version 1.1, which does not support double precision. This is a mid-range GPU, so do not expect good speedups (if any).

If you want to know more, have a look in the doc-directory (where you installed CUDA).

For better control over execution times (if you want to benchmark), it may be useful to set the environment variable CUDA_LAUNCH_BLOCKING. See page 31 in the NVIDIA CUDA C Programming Guide (doc/CUDA_C_Programming_Guide.pdf) where you have installed the SDK.

Note that long runs (> 5 s) will crash, since the GPU is used to uppdate the display as well. See the handouts for more details.

Back