Low-latency streaming when the game maxes out your GPU
A game at 100 % GPU makes the stream wait its turn. Punktfunk asks for real-time GPU priority by default on Windows and Linux. Where, and what it costs.
On an idle desktop every streaming host looks fast. The case that matters is a demanding game holding the GPU at 100 %. There the stream can fall to a fraction of the game's frame rate, while the GPU's encoder sits idle.
The encoder isn't the bottleneck
NVENC, AMF and Quick Sync are separate blocks on the GPU and sit mostly idle. What waits is the work that feeds them: taking the frame, converting its colour, copying it into the encoder. That work queues behind the game on the same GPU scheduler. With priority lowered, one loaded NVIDIA host delivered about 25 of a game's 60 fps and reported 70 ms of encode latency while NVENC barely worked (PR #488).
Real-time priority at every layer
Punktfunk asks for the highest GPU priority it can get, by default:
- Windows: the host process and the display driver's process, where the encoder runs, both get the
REALTIMEGPU scheduling class (D3DKMTSetProcessSchedulingPriorityClass). - Linux: hardware encoders use the GPU's video engine and need no GPU priority. PyroWave encodes on the shader cores the game uses, so it runs in
punktfunk-encode-workeron a real-time Vulkan queue. That needsCAP_SYS_NICE, which every Linux package grants to the worker and never to the host. On an RTX 5070 Ti under GRID 2, PyroWave's encode p99 fell from 6.4 to 4.4 ms.
On both, capture and encode threads also run at raised CPU priority.
Priority takes GPU time from the game; it doesn't create any. The game gives up a little frame rate so the stream keeps its own.
The newest frame wins
On Windows the driver hands frames to the encoder through a pool of three. The encoder holds at most two; when it falls behind, the oldest waiting frame is overwritten. The encoder always starts on the newest picture, and Windows never waits on the stream.
Turning it down
If NVENC freezes with hardware-accelerated GPU scheduling on and VRAM nearly full, set PUNKTFUNK_GPU_PRIORITY_CLASS=high. On Linux, PYROWAVE_QUEUE_PRIORITY=off helps if the desktop stutters while streaming.
Every knob is in Configuration. How the encoder moved into the driver: this post.