Bookmarks

CUDA — CUDA platform

Compute Unified Device Architecture

NVIDIA’s software platform for general-purpose computing on GPUs: a C/C++ language extension, a driver, a compiler and a set of libraries and tools.

Also: NVIDIA CUDA, CUDA C++

checked 9 Nov

All terms

CUDA turns a graphics accelerator into a general-purpose processor: neural networks are trained and run on NVIDIA GPUs, physics is simulated and data is processed. NVIDIA released the platform in 2007. CUDA is proprietary — programs written for it run only on NVIDIA GPUs; OpenCL, by contrast, is an open cross-platform standard.

What it consists of

ComponentWhat it provides
Driverlinks the program to the GPU, manages memory and task launching; the driver version determines which CUDA Toolkit versions the application works with
CUDA Toolkitthe nvcc compiler, a debugger, a profiler and libraries, such as cuBLAS for matrix operations; cuDNN for neural networks and NCCL for communication between GPUs are installed separately
Language and extensionsa C/C++ extension for writing kernels, plus running code in Python, Julia and Fortran through bindings

How a kernel works

The programmer writes a kernel — code that runs on the GPU in parallel across thousands of threads. Threads are grouped into blocks, blocks into a grid, and the same operation is applied to thousands of data elements at once.

cudaA vector addition kernel and its launch on 65,536 threads
            __global__ void add(const float* x, const float* y, float* z, int n) {                int i = blockIdx.x * blockDim.x + threadIdx.x;                if (i < n) z[i] = x[i] + y[i];            }            add<<<256, 256>>>(x, y, z, n);            

Compatibility

Each GPU generation has a compute capability number, for example 8.9 for Ada Lovelace and 9.0 for Hopper. Binary code built for a given version runs on GPUs of the same generation with a higher second digit; for a new generation it is rebuilt, or intermediate PTX bytecode is kept, which the driver compiles for the specific GPU on the fly. Since CUDA 11, minor version compatibility applies: applications from one major Toolkit family run on a sufficiently new driver without updating it.

Sources

the term is written from these pages

Verified 9 Nov

Not to be confused with

what it is mixed up with and how it differs

  • GPUgraphics processing unit

    The GPU is the processor itself, while CUDA is NVIDIA’s software platform for writing and running code for it.

In depth in the references

where the topic is covered in detail