Control How Your GPU Shares Work with Green Contexts

AI-generated summary of reporting by NVIDIA Developer Blog. Read the original for the full story.

Why it matters

CUDA developers with multiple workloads on one GPU can now dedicate specific SMs to latency-critical kernels, cutting critical kernel latency 20x versus stream priorities alone in CUDA 13.1.

Read this as

NVIDIA's CUDA 13.1 adds a feature called green contexts that lets a program slice one GPU into sections. Each section gets its own share of the GPU's small processing units, called SMs, so a short, urgent task no longer waits behind a big background job. This helps people building AI systems and other software that runs several jobs on a single GPU at once.

Green contexts, now available through the CUDA Runtime API in CUDA 13.1, let teams isolate latency-sensitive GPU work from throughput workloads running on the same device. In NVIDIA's test, a critical kernel ran in 0.007 ms versus 0.140 ms with stream priorities alone. Adoption is opt-in, so existing applications can adopt it incrementally; the cost is fewer SMs left for bulk work.

CUDA 13.1 exposes green contexts via the Runtime API (cudaGreenCtxCreate, cudaExecutionCtxStreamCreate), letting a process partition SMs and workqueues without hardware context-switch overhead. In a benchmark on a 148-SM Blackwell GPU, dedicating 8 SMs to a critical kernel cut latency to 0.007 ms versus 0.140 ms with high-priority streams alone, a 20x gap caused by waiting for bulk blocks to drain. Driver API support has existed since CUDA 12.4; the runtime change makes the feature practical for existing stream-based code.

Read the original

This summary exists to save you time, not to replace the source.

Key terms

CUDA 13.1 CUDA NVIDIA Blackwell NVIDIA Holoscan CUDA Programming Guide

Was this summary useful?

One click, anonymous. It tells us which summaries to re-run.

Related reading