CUDA
CUDA is a parallel computing platform and programming model developed by NVIDIA for general computing on GPUs.
Documentation
- Introduction to CUDA, from the NVIDIA website
- CUDA documentation from the NVIDIA website
- Introduction to nvprof, the command line profiler, from the NVIDIA website
- CUDA-MEMCHECK, a suite of tools to diagnose functional correctness
Usage on Bridges-2
To see what versions of CUDA are available and if there is more than one, which is the default, along with some help, type
module spider cuda
To use CUDA, include a command like this in your batch script or interactive session to load the CUDA module: (note ‘module load’ is case-sensitive):
module load cuda
Usage on Bridges
To see what versions of CUDA are available type
module avail cuda
To see what other modules are needed, what commands are available and how to get additional help type
module help cuda
To use CUDA, include a command like this in your batch script or interactive session to load the cuda module:
module load cuda
Be sure you also load any other modules needed, as listed by the module help cuda
command.
Profiling your code
To profile your CUDA code, use the command line profiler nvprof
, which comes with the CUDA Toolkit. More information on nvprof
can be found on the NVIDIA web site (see Documentation above).
Common Errors
Many errors using CUDA are caused by using an outdated version. Try loading the latest version of CUDA with
module load cuda
rather than specifying a specific module.
An error like:
The application being profiled received a signal
can indicate that the code being profiled is incorrect. Some things to check are:
- Memory errors. Try cuda-memcheck. More information on CUDA-MEMCHECK can be found on the NVIDIA web site (see Documentation above).
- DeviceReset or exit calls; these can hinder writing profile logs