What is GPU occupancy?

The ratio of warps actually resident on a GPU SM to the maximum it can hold, determined by register and shared-memory use, block size and similar factors.

Field: GPU Programming

Japanese name: 占有率

What the value expresses

On NVIDIA GPUs, each SM has a maximum number of warps it can hold at once. Occupancy is the number of warps actually resident divided by this maximum. For example, if 48 warps are resident on an SM whose maximum is 64, occupancy is 48 ÷ 64 = 75%. Warps are placed on an SM a whole block at a time. The number of blocks that fit therefore sets the occupancy. The maximum differs between GPU generations.

What determines it

An SM's registers are divided among warps and its shared memory among blocks. If each thread uses many registers, or each block uses much shared memory, fewer blocks fit. Take the SM maximum to be 64 warps again. A block of 256 threads is 256 ÷ 32 = 8 warps. If shared memory allows only 4 blocks to fit, that is 4 × 8 = 32 warps. Occupancy is then 32 ÷ 64 = 50%.

Relation to performance

With low occupancy, there are too few warps to run in place of those waiting for memory. The arithmetic units tend to sit idle during the waits, and performance drops. Higher occupancy is not always faster, however. Above a certain level, raising it further brings no gain. Cutting registers to raise occupancy can even slow a kernel down, because more values are spilled to memory. The decision is made by measuring.

Try it: questions about GPU occupancy

Which statement about GPU occupancy is correct?

  1. A100% occupancy always gives peak performance
  2. BEven with low occupancy, high performance is possible if each thread has many independent computations, raising instruction-level parallelism
  3. COccupancy has no relation to performance
Show answer and explanation

Answer: B. Even with low occupancy, high performance is possible if each thread has many independent computations, raising instruction-level parallelism

Occupancy is one means of hiding latency, not the goal. If each thread can issue several independent computations or memory loads, fewer warps suffice to fill the waiting time. Conversely, cutting registers to raise occupancy can increase spills to memory and slow things down. Measuring with a profiler is the reliable way to judge performance.

FAQ

Should occupancy be driven to 100%?

Not necessarily. Once there are enough warps to hide the waits, adding more may not make the kernel faster. Occupancy is one means of improving performance, not the goal.

How is occupancy found?

It can be calculated or measured with a profiler. The calculation compares the registers and shared memory a kernel uses with what an SM provides. The compiler can be asked to report the number of registers used per thread.

Books on GPU Programming Ad

As an Amazon Associate I earn from qualifying purchases.

This page was drafted with AI and fact-checked by a separate AI review before publication. Our Editorial policy explains how we write and check content. If you spot an error, please tell us on our Contact page.

Back to the glossary