Search

A technology, a device or an article

Occupying a GPU is different from keeping it productive

Registers, resident blocks, and ready instructions explain why occupancy is useful without being a universal performance score.

Fabric pieces within a limited placement area
AI-generated conceptual illustration. A metaphor for limited residency and the distinction between presence and readiness.ITNWS · OpenAI image generation · AI-generated for ITNWS; usage subject to OpenAI terms

One extra local value can change how much work fits on a GPU multiprocessor. The expression looks harmless in a kernel: retain an intermediate result, use it again later, avoid recomputing it. The compiler may need another register. If allocation crosses a resource boundary, fewer thread blocks can remain resident together. There is no necessary proportional relationship between the extra value and the change in residency. These are notes about execution resources, not measurements of an ITNWS kernel or a claim about one graphics card.

Write a margin note beside the word local. A source-language local variable is not a promise of a dedicated physical register. The compiler decides how to represent values, how long they remain live, and whether storage is required at all. An expression can disappear, be recomputed, or spill into local memory. Local memory in CUDA names a thread’s address space; it does not mean a small, separately installed memory chip beside that thread. The relationship between a source declaration and hardware storage must be established from the compiled kernel.

The CUDA Best Practices Guide defines occupancy through active warps relative to the multiprocessor’s supported maximum. A resident warp has its execution context on the multiprocessor. That does not mean it issues an instruction in every cycle. It can be waiting for data, an earlier result, or synchronization. Occupancy describes available resident work, while productivity depends on what that work can do. Treating the percentage as a direct measure of useful arithmetic confuses presence with progress.

A register count with a staircase behind it

Registers are finite resources shared by the threads resident on a streaming multiprocessor, or SM. A block’s requirements must fit together with those of other resident blocks. Allocation has granularity: hardware does not necessarily hand out precisely the arithmetic product of source variables and threads. Constraints also include threads, warps, blocks, and shared memory. Consequently, a simple division of register-file capacity by a displayed register count is a useful first thought but an incomplete occupancy calculator.

Here is deliberately simplified arithmetic. Suppose an imaginary execution unit has 4096 register slots available, each block contains 64 threads, and each thread requires 32 slots. One block consumes 2048, so two fit by this constraint. Raise the requirement to 33 and the product becomes 2112; two would require 4224 and no longer fit. This invented machine ignores allocation rounding and every other resource limit. It demonstrates the staircase, not the register organization or expected occupancy of a real NVIDIA architecture.

That caveat matters more than the numbers. On actual devices, allocation units and architectural maxima change the steps. A shared-memory limit could already have allowed only one block, making our register change irrelevant to residency. Alternatively, a different block size can change the limiting resource. Reporting that a kernel uses fewer registers does not establish a corresponding increase in active warps. The full launch configuration and target architecture are part of the proposition, including dynamically requested shared memory.

NVIDIA documents occupancy-calculation tools in Nsight Compute. They answer a capability question for a specified kernel and configuration. The theoretical result is not a promise that every SM remains filled throughout execution. A grid with too little work cannot populate all available capacity. Unequal block durations leave a tail as shorter blocks finish and the last blocks continue. These effects change achieved occupancy without changing the compiled register count.

An annotation is needed beside active. Resident warps are candidates for future scheduling; eligible warps have a next instruction that can be issued under the relevant conditions. A warp waiting on an unresolved dependency remains present but cannot supply that instruction yet. The scheduler benefits from alternatives that are actually ready. Filling the SM with more copies of the same dependency structure may help hide latency, yet it cannot make an unavailable value arrive simply because the occupancy percentage looks satisfying.

This is the purpose of abundant threads in a throughput machine. While one warp waits, another can provide useful work. The latency experienced by the first warp has not necessarily shortened. More of it can overlap with other execution. Distinguishing hiding latency from reducing latency avoids a familiar misunderstanding: a kernel can finish more work per unit time without making each individual memory access intrinsically faster. Whether enough independent work exists depends on its algorithm and resource use.

A note on instruction-level parallelism belongs here. One thread can expose independent operations as well as dependencies. Keeping several intermediate values may allow the compiler to schedule useful arithmetic around waiting operations. Removing those values to reduce register demand can destroy that freedom. There are therefore competing kinds of parallelism within the same kernel. A version with lower occupancy may keep execution resources productive through independent instructions, whereas a more densely resident version may have less useful work ready in each thread.

Violet bars in alcoves with only some illuminated
AI-generated conceptual illustration. A metaphor for limited residency and the distinction between presence and readiness. — ITNWS · OpenAI image generation · AI-generated for ITNWS; usage subject to OpenAI terms

The spilled value did not vanish

Register pressure can force some values into local memory. Address-space ownership remains private to the thread, but accesses use the memory hierarchy rather than ordinary register storage. Caching can affect their cost; calling every spill a direct uncached trip to external DRAM would be wrong. Calling it free because the storage is local would be equally misleading. Generated loads and stores, cache behavior, and actual timing determine whether the transformation improved the kernel.

This makes a strict register cap an intervention rather than a universal optimization. The compiler may satisfy the cap by spilling or recomputing values. More resident warps can then compete with extra instructions and memory traffic. The result can improve, deteriorate, or remain effectively unchanged. The cap’s numeric success establishes only that a constraint was met. It does not establish the application’s desired outcome. The official CUDA compiler documentation describes register controls and resource reporting; their availability does not select the best value for an arbitrary algorithm.

Loop unrolling makes the trade especially visible. It can remove control overhead and expose independent work, while extending live ranges or increasing the number of simultaneously needed values. A source change intended to reduce overhead may therefore increase register pressure. Conversely, reducing unrolling may shorten live ranges while adding loop work. Neither direction is automatically correct. The interesting evidence connects the generated instructions and resource use with the execution time of the same required calculation.

Block size can change several relationships at once. Larger blocks change how threads and resources pack onto an SM, and they can change cooperation within the algorithm. A barrier joins threads of one block; increasing that group changes which work must reach the rendezvous. A smaller block may improve placement while requiring another organization for shared results. A comparison that changes the algorithm as well as the block dimension should describe both changes instead of crediting every difference to occupancy.

Shared memory is another resident resource, separate from registers. A kernel can reserve enough shared memory per block to limit residency even when its register use is modest. Some designs deliberately spend that resource to reuse data and reduce other traffic. Cutting the reservation can raise theoretical occupancy and simultaneously remove useful reuse. The profiler must therefore be read as a relationship among resources. The percentage alone does not reveal whether the bytes being reserved are preventing repeated expensive work.

There is a distinction from the utilization chart shown by an operating system. Such a chart can report activity over an interval and engine without describing resident warps in the kernel under study. A GPU can appear busy while serving work that uses its arithmetic resources inefficiently. Conversely, a brief efficient kernel can be surrounded by CPU preparation or gaps between launches. The application and individual kernel have different boundaries. Their percentages cannot be exchanged merely because both appear under a heading containing GPU.

Nsight Compute’s profiling guide explains metrics and the overhead of collecting them. Profiling can require repeated execution to collect different observations. A report should therefore preserve its collection conditions and separate them from ordinary application timing. We have collected no such report for this article. Its teaching arithmetic supplies no measured speedup, no selected register cap, and no claim that a particular architecture is inefficient. A concrete conclusion would require an actual kernel and its result.

The most useful margin note may be beside the output. Before comparing configurations, decide what constitutes the same correct calculation. Changing arithmetic precision, omitting work, or silently reducing input size can make the kernel shorter without demonstrating a better use of resident resources. After correctness is preserved, elapsed time and completed useful work can assess the change. Occupancy helps explain why that outcome occurred; it does not replace the outcome with a percentage that happens to be easier to display.

A resource report becomes useful when it accompanies a specific completed calculation. The record can preserve the target architecture, launch configuration, compiled register use, achieved behavior, and elapsed time without forcing them into one score. A lower register count can then be understood as a change with consequences, rather than an achievement in isolation. The useful target remains sufficient ready work for the execution resources. Once the calculation finishes correctly and sooner, occupancy has helped explain a result that matters beyond the report.

Sources checked on October 22, 2026. This explanation uses current CUDA documentation and a clearly invented resource example, without presenting documentation revisions as product news.

Sources & documentation

  1. CUDA Best Practices Guide ↗
  2. Nsight Compute user guide ↗
  3. Nsight Compute profiling guide ↗
  4. CUDA nvcc compiler documentation ↗