NVENC with Direct3D 11 resources

We have an application that renders images in the background with Direct3D 11 and then encode them in H264 with NVENC. Our application generates YUV resources directly. But it looks like we cannot register Direct3D 11 resources with NvEncRegisterResource, which states that DirectX interface is not implemented. Currently we are having two options, both works but have their own problems:

  1. We can read the resource to system memory and feed it to NVENC. This has quite a lot performance penalty.
  2. We can also register the resource with CUDA first, and then register the registered CUDA resource with NVENC. This somewhat also works and have better performance, however CUDA doesn’t work in session 0 service which is still a problem in our case.

So here there are actually two problems, but the one I concern the most is how can we register a Direct3D resource with NVENC directly without system memory copy or CUDA?

But it looks like we cannot register Direct3D 11 resources with NvEncRegisterResource

I have been looking at this post a few times hoping that someone from Nvidia would reply.

@Nvidia : It seems pretty strange that a direct path dx11-> Nvenc is not supported. Do you expect to improve this in an upcoming SDK update ?

@LLYZS : So if you want to avoid video to system memory round trip and if you can’t use cuda in your use case, then I guess you can try dx11->dx9->nvenc instead.

dx9->dx11 surface sharing should not be a problem, but I am not sure with the other way around. Please do share if you make any good discoveries. Meanwhile, it would definitely make good sense if someone from nvidia could elaborate an a good post like this one.

I need this functionality as well. Does anyone from nvidia ever look at this forum I wonder?

Hi, I am seeing similar issue but only with windows 7. And with windows 8 I am able to register a Dx11 resource to nvEncRegisterResource?

Could one of you confirm if you are seeing this on windows 7 or any other platform?