# D3D11 With NVDEC\_VideoDecoder

**URL:** <https://forums.developer.nvidia.com/t/d3d11-with-nvdec-videodecoder/56990>\
**Category:** Video Codec, PyNv & OFA\
**Created:** [January 12, 2018, 2:01am UTC](https://forums.developer.nvidia.com/t/d3d11-with-nvdec-videodecoder/56990 "2018-01-12T02:01:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![1251212394](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@1251212394](https://forums.developer.nvidia.com/u/1251212394)\
**Post date:** [January 12, 2018, 2:01am UTC](https://forums.developer.nvidia.com/t/d3d11-with-nvdec-videodecoder/56990/1 "2018-01-12T02:01:58Z")

</div>

I am studying “media sdk” and “nvdec” to write a video palyer using d3d11.  
Glad to tell you, msdk does not work on windows7 with d3d11, but nvdec performs perfectly.  
But when I turn to windows 10, I work out a brilliant idea to create an “id3d11tex2d” with nv12 format  
This time, media sdk performs 1000 fps(render mode 1080p), faster than nvdec 500fps.  
I guess the “nv12torgba” kernel function is to blame.  
So I want to konw how to create register nv12 “id3d11tex2d” with cuda resource.  
And How to copy from decode data to the cuda resource,  
Because the width and pitch for nv12 format is hard to describe, there are 2 planes.  
Can you write a demo?

---

<div class="post-metadata">

**Author:** ![1251212394](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@1251212394](https://forums.developer.nvidia.com/u/1251212394)\
**Post date:** [January 12, 2018, 2:28am UTC](https://forums.developer.nvidia.com/t/d3d11-with-nvdec-videodecoder/56990/2 "2018-01-12T02:28:11Z")

</div>

Another quetion:  
“cuGraphicsSubResourceGetMappedArray” works well and i can get a cuarray.  
but “cuGraphicsResourceGetMappedPointer” fails and return CUDA\_ERROR\_INVALID\_HANDLE.

---

<div class="post-metadata">

**Author:** ![1251212394](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@1251212394](https://forums.developer.nvidia.com/u/1251212394)\
**Post date:** [January 12, 2018, 2:28am UTC](https://forums.developer.nvidia.com/t/d3d11-with-nvdec-videodecoder/56990/3 "2018-01-12T02:28:29Z")

</div>

Another quetion:  
“cuGraphicsSubResourceGetMappedArray” works well and i can get a cuarray.  
but “cuGraphicsResourceGetMappedPointer” fails and return CUDA\_ERROR\_INVALID\_HANDLE.
