CUDA
CUDA is Nvidia's proprietary platform and programming model for running general-purpose computations on its GPUs, and the software layer most AI frameworks were built on.
CUDA lets programmers use an Nvidia GPU for calculations that have nothing to do with graphics. It includes drivers, a compiler, libraries for common maths such as linear algebra (cuBLAS) and Fourier transforms (cuFFT), and developer tools. The name was originally an acronym for Compute Unified Device Architecture.
The basic flow is simple. Data is copied from the computer's main memory into the GPU's memory. The CPU then launches a kernel, a function that the GPU runs across thousands of threads at once, each handling its own slice of the data. The results are copied back. Threads run in groups of 32, and getting good performance means keeping those groups busy and limiting slow copies between CPU and GPU memory.
CUDA grew out of research by Ian Buck, a Stanford PhD student who built Brook, a language for general-purpose GPU computing. Nvidia hired him in 2004 and paired him with John Nickolls, who turned Brook into CUDA. The first public software kit came out in February 2007. By 2015 CUDA's development was increasingly focused on machine learning and neural networks.
CUDA works only on Nvidia GPUs. AMD offers ROCm and HIP, Intel offers oneAPI, and open standards such as OpenCL and SYCL exist, along with projects such as ZLUDA that try to run CUDA programs on other hardware. CUDA's conventions run so deep that PyTorch's build for AMD GPUs deliberately reuses the existing torch.cuda programming interface so code needs few changes.
In practice, most people building AI never write CUDA themselves. They use frameworks such as PyTorch, which call CUDA libraries underneath. But the years of tuned libraries and tools behind those frameworks are part of why moving AI work to other chips takes engineering effort.
CUDA is used to run parallel calculations on Nvidia GPUs. Its main uses are training and running AI models, scientific simulation and other high-performance computing. Most AI frameworks use CUDA libraries behind the scenes when running on Nvidia hardware. Not officially. CUDA is proprietary and supports only Nvidia GPUs. AMD's ROCm platform and its HIP language offer a similar programming model, and some third-party projects try to translate or run CUDA code on other hardware, with varying completeness. Usually not. Most AI work is done in Python with frameworks such as PyTorch, which handle GPU programming for you. CUDA skills matter for people who write custom GPU kernels, optimise performance or build the frameworks and libraries themselves. Because so much AI software, tooling and expertise has been built on CUDA since its 2007 release, and it runs only on Nvidia GPUs. Rival chipmakers must match not just Nvidia's hardware but the libraries and developer habits built on CUDA, which makes customers slower to switch.Common questions
What is CUDA used for?
Does CUDA work on AMD GPUs?
Do I need to learn CUDA to work in AI?
Why is CUDA called Nvidia's moat?
Search for "CUDA programming model", "CUDA vs ROCm" or "PyTorch GPU backend". Nvidia's own CUDA documentation and the documentation of AI frameworks such as PyTorch are the primary sources; independent benchmarks are the best way to compare performance across vendors. Claims that a rival platform is a drop-in replacement for CUDA should be checked against real workloads.Finding more
Working out what this means for your business?
Aileron Shift builds the systems behind this site: AI newsrooms that research, write and publish on their own, marketing automation and WordPress hosting for companies that need to move faster than their competitors.