Reducing NVENC Memory Usage

Hello! My team has been using the reconfigure NVENC API and found it to work well, but one thing that’s confused us is the VRAM usage of an NVENC session that has not encoded anything. Specifically, we find that setting maxEncodeWidth=2880 and maxEncodeHeight=1800, without encoding any frames, takes 130mB of VRAM. We’d like to lower this, while still having the ability to begin encoding quickly, instead of only starting the encoder when we know we need to start encoding. We’re using OpenGL at the moment, but maybe CUDA could help?

We’ve gone through all the usual suspects:

  • maxNumRefFrames is 1
  • Single pass, no AQ
  • enableOutputInVidmem is false

Is there a way to do most of the latency heavy NVENC startup routine without using lots of VRAM?

Alternatively, is there a way to save the NVENC VRAM state in system memory? Maybe this is possible with CUDA?