Quantcast
Channel: Intel® Software - Media
Viewing all articles
Browse latest Browse all 2185

GPU memory leak with MSDK using D3D11 for rendering (sample_decode)

$
0
0

We're using Intel MSDK to decode H.264 video streams in our software, rendered with D3D11/DXGI. We discovered when stopping and starting streams we had a memory leak in GPU memory (observed primarily through ProcessExplorer/"System GPU memory"). We verified with DX debug layer that all objects were released correctly, and then we turned to checking the functionality in "sample_decode" to verify if the problems were in our implementation. 

Unfortunately (?) the memory issues can be seen even with sample_decode, with minor changes. The only changes done in code are:
- Added a for-loop to run the same decoder/render task 5 times instead of only 1 time.
- Ignoring the result of the RegisterClass call (to not abort since class already registered)
Code is attached, along with a compiled debug .exe.

* sample_decode based on "2018 R2" samples
* GPU memory issues seems to happen when rendering with D3D11
* Using D3D9 no memory leak could be observed
* Tested on multiple machines, but results below were running on a Skylake processor (HD 530)
 

D3D11 rendered
h264 -hw -d3d11 -r -async 4 -rgb4 -i c:\temp\bbb_sunflower_1080p_30fps_normal.mp4.264
=> GPU-memory increasing

D3D11 NOT rendered
h264 -hw -d3d11 -async 4 -rgb4 -i c:\temp\bbb_sunflower_1080p_30fps_normal.mp4.264
=> GPU-memory returns to 0 between each run

D3D9 rendered
h264 -hw -d3d -r -async 4 -rgb4 -i c:\temp\bbb_sunflower_1080p_30fps_normal.mp4.264
=> GPU-memory returns to 0 between each run

D3D11 software rendered
h264 -sw -d3d11 -r -async 4 -rgb4 -i c:\temp\bbb_sunflower_1080p_30fps_normal.mp4.264
=> GPU-memory increasing

 

See screenshots from Process Explorer below. 

D3D11 - rendering

D3D11 - not rendering

D3D9 - rendering

 

Could somebody from Intel look into this issue? Could it be something that may need to be handled differently in the code to mitigate this issue? Something not released correctly?  Obviously sample_decode is built to run once, but looking into how to handle opening/closing decoding streams with MSDK and D3D11 we would hope that the sample would at least initiate and close everything correctly anyway.

 

Best Regards,
Carl

AttachmentSize
Downloadapplication/zipsample_decode.zip14.16 MB

Viewing all articles
Browse latest Browse all 2185

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>