locked
GPU Accelerated Media Extensions: Selecting the GPU to use

    Question

  • Hi,

    I was experimenting with the Media Extension Sample and the Media Capture Sample and wondered how to select the GPU that will process the image in the "Invert" effect. I've got two GPUs in my PC. The MFT is choosing the first one. Unfortunately this is the slower one ;) I would like to add the effect from C# by adding some information to the PropertySet passed to MediaCapture.AddEffectAsync(...) but any other working solution would be nice, too.

    If you need to know "why":
    I'm creating a shared DX11 texture that will be used from outside to get a fast access on the GPU. (this actually works for the graphics device that is selected automatically)

    Thank you very much!!


    • Edited by XnDerKai Tuesday, December 9, 2014 4:10 PM
    Tuesday, December 9, 2014 1:54 PM

All replies

  • Hi XnDerKai,

    I'm not expert on GPU accelerated, but I simply search on the Internet, looks like this documentation should help you: Video Processor MFT

    The video processor supports GPU-accelerated video processing, using Microsoft Direct3D 11. For more information, see MF_SA_D3D11_AWARE.

    The device is the one we need to set before we start to play the video. Also pointed at this documentation: Supporting Direct3D 11 Video Decoding in Media Foundation

    A diagram that shows the software decoder and the DXGI Device Manager.

     --James

    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, December 10, 2014 7:47 AM
    Moderator
  • Hi James,

    Thanks for these docu links. But this explains how to get DX11 support in your MFT but that's not the question.
    I'm getting a MFT_MESSAGE_SET_D3D_MANAGER message with a valid pointer to a IMFDXGIDeviceManager. But as far I understand it, this manager is for one specific device. To get another device I need to get another IMFDXGIDeviceManager handle and that is what i'm looking for. The closest topic of the docu I found was to return MF_E_UNSUPPORTED_D3D_TYPE in the SetInputType and SetOutputType methods to fall back into software mode but that's not desired ;)


    • Edited by XnDerKai Wednesday, December 10, 2014 11:56 AM
    Wednesday, December 10, 2014 8:53 AM
  • Hi XnDerKai,

    Thanks for your comments, and I will try to involve some experts to look for you, this might take few days, please be patient :) Appreciate for your understanding.

    --James


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, December 17, 2014 1:44 AM
    Moderator
  • Hello,

    You should be able to specify the device by modifying the CInvert::UpdateDX11Device function and passing a specific adapter as the first parameter of the D3D11CreateDevice function.

    I hope this helps,

    James


    Windows SDK Technologies - Microsoft Developer Services - http://blogs.msdn.com/mediasdkstuff/

    Friday, December 26, 2014 9:38 PM
    Moderator