Learning GPU programming with CUDA
- Tutorials:
- TutorialsPoint introduction to CUDA
- PluralSight introduction to CUDA
- NVIDIA blog post
- Presentation on CUDA C/C++ basics
- CUDA By Example
- apparently a good book; NOT free
- Accelerated libraries for common operations
- linear algebra, FFT, RNG, algebraic equations, sparse matrices, tensor ops, linear solvers, graph algorithms
- check this out before rolling your own algos!
- Thrust
- high-level library of parallel algorithms and data structures
vscode
intellisense w/ CUDA:- in
vscode
, there is an extension calledvscode-cudacpp
that gets rid of the syntax error highlighting you would get from__global__
,kernel<<<a,b>>>
, etc. in base C/C++ vscode
does not autocomplete from the cuda libraries by default, so you need to- add association of
.cu
or.cuh
files with C++ in yoursettings.json
(i.e. do this, but replace"cuda"
-->"cpp"
) - in your C++ language properties
c_cpp_properties.json
, add/usr/local/cuda/include/**
(or wherever your CUDA headers are) to your include path
- add association of
- in
- CUDA-X libraries
- add
-lcurand
etc. to yournvcc
commands to tell linker where to look
- add
- device specs
- can find simple list of device specifications on wikipedia
- a more complete specification can be found on NVIDIA's documentation, but is difficult to find
- or you can query your device itself by navigating to
~/cuda/samples/1_Utilities/deviceQuery
, build usingmake
, and run./deviceQuery