NVIDIA's real advantage is not the hardware
NVIDIA GPUs are excellent, but Alternative accelerators showed that objectively more elegant chips have failed against them. What makes NVIDIA hard to dislodge is not the silicon: it is CUDA, and the software stack built around it since 2006.
When you write model.cuda() in PyTorch, you trigger a chain whose every link has been optimised and tested for every chip generation: the CUDA runtime allocates memory, cuBLAS does the matrix multiplications, cuDNN the deep learning operations, NCCL the card-to-card communication.
This page explains what that stack actually locks in. It is a more interesting question than it looks, because the obvious answer ("the CUDA language is proprietary") is the least important of the three.
NVIDIA regularly publicises orders of magnitude about its ecosystem: several million registered developers, several hundred accelerated libraries, thousands of applications. Those figures come from the vendor, vary between presentations depending on what is being counted, and are verifiable by nobody else.
They are therefore not repeated here as facts. What matters to the argument is not their exact value anyway, but a qualitative point nobody disputes: the ecosystem gap is measured in engineer-years, not in performance points.
CUDA: the foundation
CUDA stands for Compute Unified Device Architecture. It is simultaneously a language (an extension of C++) a programming model, and a complete platform.
The programming model
The central idea is the kernel: a function launched simultaneously across thousands of threads. That notion, and why launching one costs something, are covered in GPU architecture; we will not repeat them here.
What is worth adding is the hierarchy CUDA imposes on those threads, because it mirrors the hardware:
- a thread: the smallest unit, one computation;
- a warp: 32 threads executing the same instruction at the same instant. This is the hardware's real unit of execution, not an abstraction;
- a block: a group of threads, up to 1,024, that share fast memory and can synchronise with each other;
- a grid: the set of all blocks, that is, the complete launch.

The important rule in that diagram is what it forbids: blocks do not communicate with each other. Only threads within a block share fast memory and can wait for one another. That restriction is what lets the hardware dispatch blocks onto its multiprocessors in any order, and therefore lets one program run on a card with 20 multiprocessors and on a card with 132.
The toolkit
- nvcc: the compiler, which translates CUDA code into machine instructions;
- the runtime: device memory management, kernel launching, synchronisation;
- the libraries: cuBLAS for linear algebra, cuFFT for Fast Fourier Transforms (FFT, a procedure that decomposes a signal into frequencies) cuRAND for random numbers, cuSPARSE for sparse matrices;
- Nsight: the profiling and debugging tools, used to work out why a program is slow.
PyTorch calls CUDA invisibly. You do not need to know how to write a kernel to train a model.
But understanding the basics changes everything at diagnosis time. When a training run is twice too slow, the cause is nearly always one of three things, and all three are CUDA notions: poorly aligned memory accesses, warp divergence, or kernels so small that launching them costs more than the work they do.
cuBLAS: the matrix multiplication engine
cuBLAS is the GPU implementation of BLAS (Basic Linear Algebra Subprograms), a standard interface dating from the 1970s that all of scientific computing uses.
A neural network is, essentially, a succession of GEMM operations (GEneral Matrix Multiply): a linear layer's forward pass is one GEMM, its backward pass is two more, and a transformer chains dozens per layer.
cuBLAS does not multiply naively. It chooses among dozens of implementations according to matrix size (a 4096 × 4096 matrix is not optimised like a 32 × 32) the numeric format, the card generation, and whether Tensor Cores can be used.
This deserves emphasis, because it is the heart of the page: this is not an algorithm but a catalogue of hand-tuned algorithms, redone for every hardware generation. That is what a competitor must reproduce, not a specification.
cuDNN: the deep learning operations
cuDNN (CUDA Deep Neural Network library) gathers optimised implementations of the common operations: convolutions, attention, normalisations, activation functions, pooling, softmax.
The same catalogue logic appears there, pushed further still. For a single convolution, cuDNN has several algorithms from different mathematical families (Winograd, going through an FFT, or implicit GEMM) and measures which is fastest for the exact requested size on the exact card present.
Operation fusion
The mechanism and its rationale are explained in GPU architecture: chaining three operations as three separate kernels means three reads and three writes of main memory, where one fused kernel does one of each.
What is worth adding here is that the gain depends entirely on what is being fused. On a chain of element-wise operations, where all the time goes into memory trips, it can be substantial. On a large matrix multiplication that is already compute-bound, it is negligible. The speedup factors quoted here and there mean nothing without the case that was measured.
NCCL: communication between cards
NCCL (NVIDIA Collective Communications Library, pronounced "nickel") handles GPU-to-GPU communication, within a server over NVLink and between servers over InfiniBand or RoCE (RDMA over Converged Ethernet, a way of carrying direct-memory-access traffic over ordinary Ethernet).
The collective operations
A collective is an operation in which every card takes part at once, and whose result depends on what each contributes. These are the five building blocks of all distributed training:
- all-reduce: each card contributes a tensor, all leave with the sum. This is the operation of data parallelism, described in Data parallelism;
- all-gather: each card contributes a shard, all leave with the complete collection. This is how FSDP reassembles a layer before using it;
- reduce-scatter: sum then split, each card leaves with its share of the sum. The building block of ZeRO;
- broadcast: one card sends the same thing to all the others;
- all-to-all: each card sends different data to every other. This is the operation that makes mixture-of-experts models expensive, since every token must be routed to its assigned expert, see MoE principles.

One piece of vocabulary from the image: a rank is a participant's number within the group. The term is used throughout distributed computing, and has nothing to do with the rank of a matrix.
Automatic adaptation to topology
NCCL detects how the cards are wired and picks its algorithm accordingly:
- ring: cards pass data from neighbour to neighbour. Efficient, and the natural shape for an all-reduce;
- tree: a hierarchy that cuts the number of steps, better on large groups;
- SHARP (Scalable Hierarchical Aggregation and Reduction Protocol): the additions happen inside the InfiniBand switches, in transit. Data no longer has to come back to the GPUs to be summed, which cuts traffic accordingly.
Three figures are routinely quoted side by side: NVLink 4 at 900 GB/s, InfiniBand NDR at 400 Gbit/s, and PCIe. The first is in bytes, the second in bits. Converted, the InfiniBand figure is 400 ÷ 8 = 50 GB/s, and the ratio to NVLink is 18, not 2.
This is the most frequent error in the field and it is settled once and for all in Bits and bytes. The networking detail is in Networking for distributed training.
As for what share of training time communication takes, it depends so heavily on the model, the sharding and the machine that no general percentage means anything. What is true everywhere is that the share grows with the number of cards, and eventually dominates: that is the whole reason for everything described in Advanced parallelism.
TensorRT: compiling for inference
TensorRT takes a trained model and turns it into an inference engine. It is a model compiler, applying layer fusion, quantization with calibration, reuse of memory buffers between layers, and above all kernel selection by measurement: it times several implementations of each operation on the card actually present and keeps the fastest.
TensorRT-LLM is its language-model variant, with paged attention cache, continuous batching and optimised attention, the techniques described in Serving frameworks.
Triton: writing kernels without writing CUDA
Triton, created at OpenAI, lets you write GPU kernels in Python rather than C++, leaving the compiler to handle tiling and memory placement, the most tedious and most hardware-specific part.
It has become the ordinary tool for writing a custom kernel, and it carries particular strategic importance: it is a level of abstraction above CUDA, hence potentially portable. If alternatives to NVIDIA ever break through, it will most likely be through this kind of intermediate layer rather than through direct rewriting.
The full stack, and what it locks in
Here is the stack a PyTorch training run traverses, top to bottom: PyTorch and its automatic differentiation engine, then ATen (its C++ tensor library), then cuDNN and cuBLAS, then NCCL, then the CUDA runtime, then the driver, then silicon.

What is locked in, in order of importance
Now that the stack is visible, we can answer the question posed at the top. The lock-in is not primarily legal, nor linguistic.
1. The long tail of hand-tuned kernels. This is the main lock. What has value in cuBLAS and cuDNN is not the interface, which is public and easy to copy, but the thousands of specialised implementations behind it, each tuned for one matrix size, one numeric format and one chip generation. A competitor can reproduce the ten most common cases in a few months. The tail of rare cases has no end, and it is always a rare case that collapses the performance of a real model.
2. The moving target. A corollary of the first, and what makes the race so thankless. While a competitor catches up with the previous generation, NVIDIA ships the next one with new instructions, and its own catalogue is ready on launch day because the same teams designed both. A translation layer (AMD's HIP, or the various attempts at running CUDA binaries elsewhere) targets by construction a past state of the ecosystem.
3. What people know how to do. The accumulated know-how sits on the CUDA side: the tutorials, the answered questions, the diagnostic tools, and above all the fact that the reference implementation of nearly every published paper is in CUDA. A team reproducing a recent result therefore starts from CUDA code. That is not a choice, it is the default starting point.
A fourth lock, quieter, deserves a mention: numerical reproducibility. Two implementations of the same matrix product can add the same numbers in a different order and give results that differ in the last bits. Over a training run of several weeks, those differences accumulate. Migrating platforms is therefore not only a porting job: it is a revalidation job, whose cost nobody can guarantee in advance.
Why this is a general lesson
Remember the mechanism rather than the product names. A dominant position is not necessarily defended by the superiority of the core product, but by the thickness of what has been built around it and that a competitor must rebuild in full before its own product becomes usable. Reproducing one link is feasible; reproducing the chain while it keeps moving is not.
That is exactly what Graphcore's commercial failure and the TPU's ceiling outside Google illustrate, each in their own way.
1. A competitor secures the right to use the CUDA language freely and ships a compatibility translation layer. Has it broken the main lock?
2. Two figures are quoted side by side: NVLink 4 at 900 GB/s and InfiniBand NDR at 400 Gb/s. What is the real ratio between them?
3. In the CUDA model, blocks within one launch can neither communicate nor synchronise with each other. What is that restriction for?
4. For a given convolution, cuDNN has several algorithms from different mathematical families available. How does it choose?
5. A team is considering migrating a multi-week training run to a competing platform. Which cost is most easily underestimated?