What Is a Streaming Multiprocessor (SM)? CUDA Block Placement and Occupancy
An SM is an NVIDIA GPU hardware unit that runs CUDA thread blocks and schedules warps. This guide maps a 1,000-element array to blocks, explains resource-limited occupancy, and shows how to inspect a kernel without treating SM count as a speed rating.
What Is a Streaming Multiprocessor (SM)? CUDA Block Placement and Occupancy
A streaming multiprocessor (SM) is an NVIDIA GPU hardware unit that executes CUDA thread blocks and schedules warps. Threads in one block run on one SM, but a program cannot choose or rely on which SM receives a block or when it runs. SM count and occupancy help explain performance; neither determines speed by itself.
How thread blocks are assigned to SMs
An SM has a register file, functional units, and a unified data cache that provides resources for L1 and shared memory; the exact design varies by GPU architecture. It divides a block’s threads into warps of 32, then a warp scheduler issues instructions from warps that are ready to run.
A kernel launch consists of thread blocks arranged in a grid. In the CUDA model, the threads of one block execute on one SM, and an SM can keep multiple blocks active at once if resources allow. The number is limited because each block needs a certain amount of threads, registers, and shared memory. The execution order of different blocks is not guaranteed, so a typical kernel should not depend on a particular order between them.
For example, to transform each element in a large array, threads can process subsets of elements, blocks group threads, and a grid covers the array. The GPU distributes those blocks across multiple SMs. This is a simplified mapping example; exact execution order and internal scheduling depend on hardware and runtime.
Worked example: map 1,000 array elements to blocks
Set the block size to 256 threads. The grid needs ceil(1000 / 256) = 4 blocks, and a thread can derive its index as i = blockIdx.x * blockDim.x + threadIdx.x. Block 0 covers 0–255, block 1 covers 256–511, block 2 covers 512–767, and block 3 covers 768–1023. Only 232 indices in the final block are valid, so check i < 1000 before accessing the array. The scheduler may assign blocks to SMs in any order; this grid exposes only four distinct blocks, not hundreds of them at once.
How to interpret SM performance
SM count is useful product information, but it is not a standalone performance metric. Arithmetic units, tensor processors, schedulers, and memory structures within each SM can differ by generation. A kernel that uses many registers or much shared memory may allow fewer active threads, leaving some resources underused. Check SM count in a specification, then interpret it alongside a profile of the actual kernel.
The CUDA hardware model is also an abstraction for portable expression of work. The same programming model can run despite physical layout differences, so do not assume that a block remains assigned to a particular SM number.
What occupancy tells you
Occupancy is the number of active warps on an SM divided by the maximum number of active warps it supports. Threads, registers, shared memory, block limits, and architecture-specific resources constrain how many blocks and warps can be resident. In NVIDIA’s CUDA Programming Guide example for compute capability 10.0, an SM supports up to 2,048 resident threads. A 768-thread block therefore allows at most two blocks from the thread limit alone: 1,536 resident threads, or 75% occupancy. Those values describe that guide example, not every GPU; register or shared-memory limits can lower the result. Occupancy can help hide latency, but a higher value does not by itself prove that a kernel is faster or efficient.
How to check a real kernel
Query the target device’s compute capability and per-SM limits with `cudaGetDeviceProperties()`; do not assume every GPU has the same limits.
Inspect the kernel’s register and shared-memory use with `nvcc --resource-usage`, along with its block size and dynamic shared-memory request.
Use `cudaOccupancyMaxActiveBlocksPerMultiprocessor()` with the kernel, block size, and dynamic shared memory to estimate the active-block limit for that device. Treat this as a configuration estimate, not a speed guarantee.
Verify output correctness, then profile the same workload and compare total time and SM/memory activity. Change one launch or resource setting at a time; do not optimize the occupancy number alone.
Sources
[NVIDIA CUDA Programming Guide: Programming Model](https://docs.nvidia.com/cuda/cuda-programming-guide/01-introduction/programming-model.html)
[NVIDIA CUDA Programming Guide: Advanced Kernel Programming](https://docs.nvidia.com/cuda/cuda-programming-guide/03-advanced/advanced-kernel-programming.html)
[NVIDIA CUDA Programming Guide: Writing SIMT Kernels](https://docs.nvidia.com/cuda/cuda-programming-guide/02-basics/writing-cuda-kernels.html)
[NVIDIA CUDA Runtime API Reference: Occupancy](https://docs.nvidia.com/cuda/cuda-runtime-api/cuda_runtime_api/group__CUDART__OCCUPANCY.html)
[NVIDIA: Measuring the GPU Occupancy of Multi-stream Workloads](https://developer.nvidia.com/blog/measuring-the-gpu-occupancy-of-multi-stream-workloads/)