NVIDIA CUDA enables graphics cards to do far more than render images. It allows them to perform complex sci­en­tif­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­a­tive AI would be difficult to achieve at today’s pace and scale.

Key Takeaways

Key takeaways:

  • CUDA is NVIDIA’s pro­pri­etary 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­proces­sors execute them in groups of 32 threads called warps.
  • For AI and LLMs, CUDA delivers the massive par­al­leliza­tion that makes training and inference practical.
  • Since the Volta ar­chi­tec­ture, Tensor Cores have further ac­cel­er­at­ed matrix op­er­a­tions, and spe­cial­ized 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­vel­op­ers rarely need to write CUDA code them­selves.
  • Frame­works such as PyTorch and Ten­sor­Flow build on CUDA in the back­ground, so CUDA remains the technical foun­da­tion of today’s AI systems.

What is CUDA?

The acronym CUDA orig­i­nal­ly stood for “Compute Unified Device Ar­chi­tec­ture,” but NVIDIA now uses it primarily as the name of its pro­pri­etary platform for parallel computing on graphics cards. It allows de­vel­op­ers 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­cess­ing units. These can perform many similar cal­cu­la­tions si­mul­ta­ne­ous­ly, making GPUs par­tic­u­lar­ly suitable for highly parallel workloads. CUDA provides the required pro­gram­ming in­ter­faces, compilers and runtime en­vi­ron­ments to enable software to take advantage of this parallel pro­cess­ing ca­pa­bil­i­ty.

De­vel­op­ers 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­hen­sive software ecosystem. Many widely used tools, including PyTorch, Ten­sor­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­etary platform developed and supported ex­clu­sive­ly for CUDA-com­pat­i­ble NVIDIA GPUs. Ap­pli­ca­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­te­gra­tion between hardware and software is con­sid­ered one of the reasons for CUDA’s high per­for­mance and wide­spread adoption in AI and high-per­for­mance computing.

Technical foun­da­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­cess­ing op­er­a­tions se­quen­tial­ly, CUDA dis­trib­utes them across thousands of parallel execution units. This or­ga­ni­za­tion is struc­tured through the CUDA hierarchy.

The smallest unit is a thread. Threads execute the same kernel code while pro­cess­ing 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­vid­ual element of a matrix.

Multiple threads are combined into a block. Threads within the same block can com­mu­ni­cate with one another and share access to a fast memory area known as shared memory. This allows them to work together ef­fi­cient­ly 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 au­to­mat­i­cal­ly assigns these blocks to the available pro­cess­ing units on the GPU.

At the hardware level, blocks are executed by streaming mul­ti­proces­sors (SMs). Each SM can handle multiple blocks si­mul­ta­ne­ous­ly, helping to maximize hardware uti­liza­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­for­mance of many CUDA ap­pli­ca­tions.

Im­por­tance for AI and LLMs

Progress in the field of AI is largely driven by deep learning models that require enormous numbers of math­e­mat­i­cal op­er­a­tions. Training and inference of LLMs mainly involve matrix mul­ti­pli­ca­tions, vector op­er­a­tions and tensor cal­cu­la­tions. GPUs and NVIDIA CUDA are specif­i­cal­ly designed to ac­cel­er­ate these highly parallel workloads.

CUDA provides not only high com­pu­ta­tion­al per­for­mance, but also the software foun­da­tion behind many major AI frame­works. This enables de­vel­op­ers to train and run complex models without having to implement every in­di­vid­ual GPU operation them­selves.

Massive par­al­leliza­tion for neural networks

Neural networks consist of millions or even billions of pa­ra­me­ters. During training, huge numbers of math­e­mat­i­cal op­er­a­tions have to be carried out. Many of these cal­cu­la­tions are in­de­pen­dent 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­pli­ca­tions, ac­ti­va­tion functions and gradient cal­cu­la­tions can thus be massively ac­cel­er­at­ed. Depending on the model, hardware and im­ple­men­ta­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­te­grat­ed special computing units called Tensor Cores. These were developed specif­i­cal­ly for AI workloads and can execute matrix op­er­a­tions sig­nif­i­cant­ly faster than classic CUDA cores. CUDA enables software libraries to use this hardware au­to­mat­i­cal­ly. In many cases, de­vel­op­ers do not have to address Tensor Cores directly. Instead, frame­works such as PyTorch or Ten­sor­Flow use the relevant CUDA libraries in the back­ground. Tensor Cores deliver a sub­stan­tial per­for­mance boost, es­pe­cial­ly for deep learning, gen­er­a­tive AI and LLMs.

Note

With CUDA Toolkit 13.0, offline com­pi­la­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 foun­da­tion for this scaling approach. Spe­cial­ized libraries enable fast com­mu­ni­ca­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­a­tors.

Foun­da­tion for modern AI frame­works

Most de­vel­op­ers do not interact with CUDA code directly. Instead, they rely on frame­works such as PyTorch or Ten­sor­Flow, which au­to­mat­i­cal­ly 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­i­ty. When a tensor in PyTorch is trans­ferred to an NVIDIA GPU, the cal­cu­la­tions are ul­ti­mate­ly 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­hen­sive ecosystem of libraries, de­vel­op­ment tools and op­ti­miza­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­vel­op­ers no longer write custom CUDA code them­selves. Instead, they use spe­cial­ized libraries that are already optimized for modern NVIDIA GPUs, enabling high per­for­mance without having to handle every aspect of GPU op­ti­miza­tion manually.

Important CUDA libraries

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

  • cuBLAS: cuBLAS stands for CUDA Basic Linear Algebra Sub­rou­tines. It is a GPU-optimized im­ple­men­ta­tion of the BLAS library for linear algebra op­er­a­tions. It provides functions for matrix mul­ti­pli­ca­tions, vector op­er­a­tions and other common math­e­mat­i­cal cal­cu­la­tions.
  • cuDNN: cuDNN stands for CUDA Deep Neural Network Library. It provides highly optimized functions for deep learning and neural network op­er­a­tions and is widely used by frame­works such as PyTorch and Ten­sor­Flow.
  • NCCL: NCCL (NVIDIA Col­lec­tive Com­mu­ni­ca­tions Library) handles com­mu­ni­ca­tion between multiple GPUs. It enables the fast exchange of pa­ra­me­ters and in­ter­me­di­ate results during the training of large models and is par­tic­u­lar­ly important for dis­trib­uted training of large LLMs.
  • TensorRT: TensorRT is designed to optimize and ac­cel­er­ate trained AI models for inference. The library analyzes models and improves their execution per­for­mance on NVIDIA GPUs.
  • cuFFT: cuFFT provides GPU-ac­cel­er­at­ed Fourier transform functions. It is mainly used in sci­en­tif­ic computing, signal pro­cess­ing and sim­u­la­tion ap­pli­ca­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­vel­op­ers create, debug and optimize GPU-ac­cel­er­at­ed ap­pli­ca­tions:

  • CUDA Toolkit: The CUDA Toolkit is the foun­da­tion of CUDA de­vel­op­ment. It includes compilers, libraries, runtime com­po­nents and doc­u­men­ta­tion.
  • NVCC: NVCC is NVIDIA’s official CUDA compiler. It converts CUDA code into ex­e­cutable GPU code and au­to­mat­i­cal­ly separates the CPU and GPU com­po­nents of a program. De­vel­op­ers typically use NVCC when building their own CUDA ap­pli­ca­tions.
  • Nsight Systems: Nsight Systems is a per­for­mance analysis tool for complex ap­pli­ca­tions. It provides insights into how the CPU, GPU and memory interact during program execution, helping de­vel­op­ers identify bot­tle­necks and op­ti­miza­tion op­por­tu­ni­ties.
  • Nsight Compute: Nsight Compute enables detailed analysis of in­di­vid­ual CUDA kernels. De­vel­op­ers can use it to examine memory access patterns, resource uti­liza­tion and GPU ef­fi­cien­cy. The tool is often used to optimize par­tic­u­lar­ly demanding ap­pli­ca­tions.
  • CUDA-GDB: CUDA-GDB extends the GNU debugger with GPU debugging ca­pa­bil­i­ties. It allows de­vel­op­ers to analyze CUDA ap­pli­ca­tions and in­ves­ti­gate 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 repos­i­to­ries. Al­ter­na­tive­ly, local in­stal­la­tion packages and runfile in­stallers are available for specific use cases. For most users, NVIDIA rec­om­mends using the package manager, as it sim­pli­fies the man­age­ment of CUDA com­po­nents 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 foun­da­tions in modern computing. Its ar­chi­tec­ture enables efficient use of the massive parallel pro­cess­ing ca­pa­bil­i­ties of CUDA-com­pat­i­ble NVIDIA GPUs and provides the technical foun­da­tion for numerous AI, deep learning and HPC ap­pli­ca­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­a­tive 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