Question about CUcontext in the AppDecD3D sample


Is there any good reason why the CUcontext is passed to the FramePresenterD3D so that the decoder and the D3D are using the same CUcontext object? or is it OK to create another instance of CUcontext(and CUdevice) inside the FramePresenterD3D in order to fully decouple the decoding and the rendering?

Based on a simple test I did it works fine, the questions is are there any implications in doing so?

thank you

Hi inodelman,

You could have a separate CUDA context for the renderer, there is absolutely no issues with that. But we typically encourage share the Cuda context so that you can save the memory associated with the Cuda context creation. There are many use cases where NVDECODEPI need to be optimized for memory consumption and hence leveraging the same Cuda context results to memory saving.


Ryan Park