NVIDIA CUDA enables graphics cards to do far more than render images. It allows them to perform complex sci­entif­ic and AI-related cal­cu­la­tions at high speed. Without CUDA and similar ac­cel­er­a­tion platforms, many recent advances in gen­er­at­ive AI would be difficult to achieve at today’s pace and scale.

Key Takeaways

Key takeaways:

  • CUDA is NVIDIA’s pro­pri­et­ary platform for using the computing power of NVIDIA GPUs for general-purpose cal­cu­la­tions (GPGPU).
  • The CUDA hierarchy splits a large com­pu­ta­tion into threads, blocks and grids; streaming mul­ti­pro­cessors execute them in groups of 32 threads called warps.
  • For AI and LLMs, CUDA delivers the massive par­al­lel­isa­tion that makes training and inference practical.
  • Since the Volta ar­chi­tec­ture, Tensor Cores have further ac­cel­er­ated matrix op­er­a­tions, and spe­cial­ised libraries scale workloads across multiple GPUs.
  • An ecosystem of libraries such as cuBLAS, cuDNN, NCCL, TensorRT and cuFFT, plus tools such as the CUDA Toolkit, NVCC and Nsight, means most de­velopers rarely need to write CUDA code them­selves.
  • Frame­works such as PyTorch and Tensor­Flow build on CUDA in the back­ground, so CUDA remains the technical found­a­tion of today’s AI systems.
IONOS CLOUD GPU VM
Maximum AI per­form­ance with your Cloud GPU VM
  • Exclusive NVIDIA H200 GPUs for maximum computing power
  • Guar­an­teed per­form­ance thanks to fully dedicated CPU cores
  • 100% European hosting for maximum data security and GDPR com­pli­ance
  • Simple, pre­dict­able pricing with fixed hourly rate

What is CUDA?

The acronym CUDA ori­gin­ally stood for ‘Compute Unified Device Ar­chi­tec­ture’, but NVIDIA now uses it primarily as the name of its pro­pri­et­ary platform for parallel computing on graphics cards. It allows de­velopers to harness the computing power of NVIDIA GPUs for general-purpose cal­cu­la­tions. These are no longer limited to tra­di­tion­al graphics tasks, but are known as General-Purpose GPU Computing (GPGPU).

Unlike a CPU, which is designed for a smaller number of complex tasks, a GPU contains thousands of smaller pro­cessing units. These can perform many similar cal­cu­la­tions sim­ul­tan­eously, making GPUs par­tic­u­larly suitable for highly parallel workloads. CUDA provides the required pro­gram­ming in­ter­faces, compilers and runtime en­vir­on­ments to enable software to take advantage of this parallel pro­cessing cap­ab­il­ity.

De­velopers can access CUDA through pro­gram­ming languages such as C++, Python or Fortran. The actual cal­cu­la­tion code runs on the GPU as a so-called kernel function, while the CPU manages the overall program flow. CUDA also provides APIs and runtime functions that enable data transfers between CPU and GPU memory and simplify memory man­age­ment through features such as Unified Memory.

Over time, CUDA has developed from a developer platform into a com­pre­hens­ive software ecosystem. Many widely used tools, including PyTorch, Tensor­Flow and NVIDIA RAPIDS, use CUDA in the back­ground to ac­cel­er­ate cal­cu­la­tions on NVIDIA GPUs. This means users can benefit from GPU ac­cel­er­a­tion without having to write every CUDA operation them­selves.

Note

CUDA is closely tied to NVIDIA hardware because it is a pro­pri­et­ary platform developed and supported ex­clus­ively for CUDA-com­pat­ible NVIDIA GPUs. Ap­plic­a­tions that rely directly on CUDA therefore cannot easily run on GPUs from other man­u­fac­tur­ers, such as AMD or Intel. This close in­teg­ra­tion between hardware and software is con­sidered one of the reasons for CUDA’s high per­form­ance and wide­spread adoption in AI and high-per­form­ance computing.

Technical found­a­tions of the CUDA hierarchy

The core idea behind CUDA is the division of complex com­pu­ta­tions into many smaller tasks. Rather than pro­cessing op­er­a­tions se­quen­tially, CUDA dis­trib­utes them across thousands of parallel execution units. This or­gan­isa­tion is struc­tured through the CUDA hierarchy.

The smallest unit is a thread. Threads execute the same kernel code while pro­cessing different data. Depending on con­di­tion­al state­ments, they may also follow different execution paths. For example, each thread can process an in­di­vidu­al element of a matrix.

Multiple threads are combined into a block. Threads within the same block can com­mu­nic­ate with one another and share access to a fast memory area known as shared memory. This allows them to work together ef­fi­ciently on a task.

Multiple blocks are combined into a grid. Each kernel launch creates a grid con­sist­ing of one or more blocks. The CUDA runtime auto­mat­ic­ally assigns these blocks to the available pro­cessing units on the GPU.

At the hardware level, blocks are executed by streaming mul­ti­pro­cessors (SMs). Each SM can handle multiple blocks sim­ul­tan­eously, helping to maximise hardware util­isa­tion. Within an SM, threads are further grouped into sets of 32 called warps. These warps are scheduled together and execute in parallel when their threads follow the same in­struc­tion path. This warp-based execution model is a key factor behind the high per­form­ance of many CUDA ap­plic­a­tions.

Im­port­ance for AI and LLMs

Progress in the field of AI is largely driven by deep learning models that require enormous numbers of math­em­at­ic­al op­er­a­tions. Training and inference of LLMs mainly involve matrix mul­ti­plic­a­tions, vector op­er­a­tions and tensor cal­cu­la­tions. GPUs and NVIDIA CUDA are spe­cific­ally designed to ac­cel­er­ate these highly parallel workloads.

CUDA provides not only high com­pu­ta­tion­al per­form­ance, but also the software found­a­tion behind many major AI frame­works. This enables de­velopers to train and run complex models without having to implement every in­di­vidu­al GPU operation them­selves.

Massive par­al­lel­isa­tion for neural networks

Neural networks consist of millions or even billions of para­met­ers. During training, huge numbers of math­em­at­ic­al op­er­a­tions have to be carried out. Many of these cal­cu­la­tions are in­de­pend­ent of each other and can be executed in parallel. This is exactly where the strength of CUDA lies. Instead of using a few CPU cores, thousands of GPU cores can work on the same task at the same time. Matrix mul­ti­plic­a­tions, ac­tiv­a­tion functions and gradient cal­cu­la­tions can thus be massively ac­cel­er­ated. Depending on the model, hardware and im­ple­ment­a­tion, this can reduce training time from months to days or weeks.

Tensor Cores and AI ac­cel­er­a­tion

Since the Volta ar­chi­tec­ture, NVIDIA has in­teg­rated special computing units called Tensor Cores. These were developed spe­cific­ally for AI workloads and can execute matrix op­er­a­tions sig­ni­fic­antly faster than classic CUDA cores. CUDA enables software libraries to use this hardware auto­mat­ic­ally. In many cases, de­velopers do not have to address Tensor Cores directly. Instead, frame­works such as PyTorch or Tensor­Flow use the relevant CUDA libraries in the back­ground. Tensor Cores deliver a sub­stan­tial per­form­ance boost, es­pe­cially for deep learning, gen­er­at­ive AI and LLMs.

Note

With CUDA Toolkit 13.0, offline com­pil­a­tion and library support for Maxwell, Pascal and Volta ar­chi­tec­tures have been dis­con­tin­ued. Systems using these GPU ar­chi­tec­tures should continue to use the CUDA 12.x series.

Scaling across multiple GPUs

Very large LLMs can exceed the memory capacity of a single GPU. Depending on model size, numerical precision and available GPU memory, they may need to be dis­trib­uted across multiple GPUs. NVIDIA CUDA provides the found­a­tion for this scaling approach. Spe­cial­ised libraries enable fast com­mu­nic­a­tion between GPUs within a single server or across entire GPU clusters. This allows datasets, models and com­pu­ta­tions to be dis­trib­uted across many ac­cel­er­at­ors.

Found­a­tion for modern AI frame­works

Most de­velopers do not interact with CUDA code directly. Instead, they rely on frame­works such as PyTorch or Tensor­Flow, which auto­mat­ic­ally convert many op­er­a­tions into CUDA-based processes. This allows users to take advantage of GPU ac­cel­er­a­tion without needing to manage the un­der­ly­ing hardware details. However, CUDA remains the core technical layer behind this func­tion­al­ity. When a tensor in PyTorch is trans­ferred to an NVIDIA GPU, the cal­cu­la­tions are ul­ti­mately executed through CUDA libraries and kernels.

The CUDA ecosystem of libraries and tools

CUDA is more than just a pro­gram­ming interface. Over time, NVIDIA has developed a com­pre­hens­ive ecosystem of libraries, de­vel­op­ment tools and op­tim­isa­tion frame­works around the platform. This ecosystem is one of the key factors behind the wide­spread use of NVIDIA CUDA in AI. Most de­velopers no longer write custom CUDA code them­selves. Instead, they use spe­cial­ised libraries that are already optimised for modern NVIDIA GPUs, enabling high per­form­ance without having to handle every aspect of GPU op­tim­isa­tion manually.

Important CUDA libraries

A key part of the CUDA ecosystem is its range of spe­cial­ised libraries, which provide commonly used com­pu­ta­tion­al functions that are already highly optimised for CUDA-com­pat­ible GPUs. This sim­pli­fies de­vel­op­ment by allowing pro­gram­mers to use existing, efficient im­ple­ment­a­tions instead of creating them from scratch. The most important libraries include:

  • cuBLAS: cuBLAS stands for CUDA Basic Linear Algebra Sub­routines. It is a GPU-optimised im­ple­ment­a­tion of the BLAS library for linear algebra op­er­a­tions. It provides functions for matrix mul­ti­plic­a­tions, vector op­er­a­tions and other common math­em­at­ic­al cal­cu­la­tions.
  • cuDNN: cuDNN stands for CUDA Deep Neural Network Library. It provides highly optimised functions for deep learning and neural network op­er­a­tions and is widely used by frame­works such as PyTorch and Tensor­Flow.
  • NCCL: NCCL (NVIDIA Col­lect­ive Com­mu­nic­a­tions Library) handles com­mu­nic­a­tion between multiple GPUs. It enables the fast exchange of para­met­ers and in­ter­me­di­ate results during the training of large models and is par­tic­u­larly important for dis­trib­uted training of large LLMs.
  • TensorRT: TensorRT is designed to optimise and ac­cel­er­ate trained AI models for inference. The library analyses models and improves their execution per­form­ance on NVIDIA GPUs.
  • cuFFT: cuFFT provides GPU-ac­cel­er­ated Fourier transform functions. It is mainly used in sci­entif­ic computing, signal pro­cessing and sim­u­la­tion ap­plic­a­tions.

Important CUDA tools

In addition to its libraries, the CUDA ecosystem includes a range of de­vel­op­ment and analysis tools that help de­velopers create, debug and optimise GPU-ac­cel­er­ated ap­plic­a­tions:

  • CUDA Toolkit: The CUDA Toolkit is the found­a­tion of CUDA de­vel­op­ment. It includes compilers, libraries, runtime com­pon­ents and doc­u­ment­a­tion.
  • NVCC: NVCC is NVIDIA’s official CUDA compiler. It converts CUDA code into ex­ecut­able GPU code and auto­mat­ic­ally separates the CPU and GPU com­pon­ents of a program. De­velopers typically use NVCC when building their own CUDA ap­plic­a­tions.
  • Nsight Systems: Nsight Systems is a per­form­ance analysis tool for complex ap­plic­a­tions. It provides insights into how the CPU, GPU and memory interact during program execution, helping de­velopers identify bot­tle­necks and op­tim­isa­tion op­por­tun­it­ies.
  • Nsight Compute: Nsight Compute enables detailed analysis of in­di­vidu­al CUDA kernels. De­velopers can use it to examine memory access patterns, resource util­isa­tion and GPU ef­fi­ciency. The tool is often used to optimise par­tic­u­larly demanding ap­plic­a­tions.
  • CUDA-GDB: CUDA-GDB extends the GNU debugger with GPU debugging cap­ab­il­it­ies. It allows de­velopers to analyse CUDA ap­plic­a­tions and in­vest­ig­ate errors directly within GPU code, sim­pli­fy­ing the de­vel­op­ment of CUDA-based software.
Note

The CUDA Toolkit can be installed on Ubuntu 24.04 using NVIDIA’s official package re­pos­it­or­ies. Al­tern­at­ively, local in­stall­a­tion packages and runfile in­stallers are available for specific use cases. For most users, NVIDIA re­com­mends using the package manager, as it sim­pli­fies the man­age­ment of CUDA com­pon­ents and future updates.

Why CUDA remains central to AI de­vel­op­ment

CUDA has developed from a platform for GPU pro­gram­ming into one of the most important software found­a­tions in modern computing. Its ar­chi­tec­ture enables efficient use of the massive parallel pro­cessing cap­ab­il­it­ies of CUDA-com­pat­ible NVIDIA GPUs and provides the technical found­a­tion for numerous AI, deep learning and HPC ap­plic­a­tions. In par­tic­u­lar, CUDA has become a key con­nec­tion between software and hardware in the de­vel­op­ment of large language models and gen­er­at­ive AI. Un­der­stand­ing the basics of NVIDIA CUDA is therefore essential for anyone who wants to un­der­stand how modern AI systems are trained and operated.

Reviewer

Go to Main Menu