News Developer Tools

NVIDIA lets apps split GPU resources with green contexts

NVIDIA's CUDA now lets apps reserve parts of a GPU for specific tasks, cutting one latency-sensitive job from 0.140 ms to 0.007 ms in a test.

NVIDIA now lets a single program reserve specific parts of a GPU for specific tasks through a CUDA feature called green contexts. NVIDIA says a latency-sensitive task given its own reserved compute units ran in 0.007 ms instead of 0.140 ms on a Blackwell GPU with 148 of them.

The compute units are called streaming multiprocessors, or SMs. Without partitioning, an urgent task can wait for bulk background work to finish. With a green context, the application assigns a chosen set of SMs to a task, so urgent and background jobs run side by side without competing for the same units.

Green contexts can also set aside workqueues, the lines that feed work to the GPU. NVIDIA says independent jobs can otherwise share one queue and run one after another even when the GPU has free capacity. Reserving queues lets an application state how much work should run at once and removes those false dependencies.

Green contexts have been available in the lower-level Driver API since CUDA 12.4. Starting with CUDA 13.1, the Runtime API also supports them. Applications create work streams from a green context rather than relying on the current device setting. The feature is opt-in and additive, so existing applications can adopt it step by step.

Source: Control How Your GPU Shares Work with Green Contexts | NVIDIA Technical Blog.