fn keep_primary_context(device: CUdevice)Expand description
Hold one reference on device’s primary CUDA context for the life of the process, once a
session on it has opened. A capture restarted while a game fills the GPU’s memory then
retains the context it had instead of creating one, which can fail there and leave the
stream on the CPU. The cost is the idle context’s 106 MiB of VRAM on a device that has
encoded once, kept also while no session runs. Its own copy of the driver’s entry points
keeps libcuda loaded after the last session’s copy goes.