- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I've been using Intel Media SDK VPP to apply some image pre-processing effect under Win32 Service (Session 0).
This code works normally under Intel HD Graphics 4000.
But I am just discover a very weird behaviour when I switch to my new laptop.
My new laptop has two display adapters Intel HD Graphics 4600 and NVIDIA GT 745M.
I installed Intel Media SDK 2013 R2 and use the API version 1.6
The Driver version of my Intel HD Graphics 4600 is 9.18.10.3165
MFXVideoSession::Init (MFX_IMPL_VIA_D3D11 , version) return MFX_ERR_NONE.
But When I query the implementation type using MFXQueryIMPL() function , the return implementation type is 1 (MFX_IMPL_SOFTWARE).
Normally the return implementation type should be 770 (MFX_IMPL_VIA_D3D11 | MFX_IMPL_HARDWARE).
I am also need to comment this line "VPPRequest[1].Type |= WILL_READ;" , otherwise the output frame of MEDIA SDK VPP will be green color (the value of Y , U and V channel are all zero).
I also found out that it used NVIDIA GT 745 to create the D3D11 Device Instead of Intel HD Graphics 4600.
This weird behavior did slow down my apps, because the actual implementation is MFX_IMPL_SOFTWARE not MFX_IMPL_VIA_D3D11 ,but I am using DX11 as the memory allocator. (Processing time around 22ms on 640X480 input frame , normal processing time around 2-4ms on 640X480 input frame).
This problem only exist when I am using MEDIA SDK VPP VIA DX11 under the Win32 Service(Session 0).
I didn't see it when I am using MEDIA SDK VPP VIA DX11 in Desktop or Metro mode.
Any suggestions and helps are highly appreciated.
Many thanks,
Hendrik
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Hendrik,
Some comments that may help you isolate the issue.
- Windows 8 is required for DX11 processing uisng Media SDK. Just want to make sure you are no trying to do this on Windows 7.
- Also, for the service usage you're pursuing it is very much preferred to use DX11, since DX9 in a service have numerous limitations
- Regarding your system with 2 gfx devices. It sounds like you're falling back on SW codecs, thus the decreased performance, Make sure that the Intel gfx device is active and that Media SDK selects the adapter associated with the Intel device (preferred way is to use MFX_IMPL_HARDWARE_ANY). Also, make sure the DirectX device is created on the Intel adapter and not the discrete adapter. The Media SDK sample code showcases how to achieve both of these tasks.
Regards,
Petter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Petter ,
Yes I am running Windows 8 Pro 64 bit and I am using DX11 (init the session using MFX_IMPL_VIA_D3D11)
Below is two different attempt I tried on my Intel HD Graphics 4600 machine ,
1. First I init the session with MFX_IMPL_HARDWARE_ANY
here is the result of MFXQueryIMPL( ) after a successful call of MFXVideoSession::Init( )
under Win32 Service return 0x0305 which is MFX_IMPL_HARDWARE2 | MFX_IMPL_VIA_D3D11
But D3D11CreateDevice() Failed with HRESULT = 0x887A0004 (DXGI_ERROR_UNSUPPORTED)
I am sure that I am using Intel adapter to create the device .
2. The second is , I init the session with MFX_IMPL_VIA_D3D11
The result of MFXQueryIMPL( ) after a successful call of MFXVideoSession::Init( ) is
Under Metro Apps the result is 0x0302 which is MFX_IMPL_VIA_D3D11 | MFX_IMPL_HARDWARE ***Correct query result
Under Win32 Desktop Apps the result is 0x0302 which is MFX_IMPL_VIA_D3D11 | MFX_IMPL_HARDWARE ***Correct query result
Under Win32 Service the result is 0x0001 which is MFX_IMPL_SOFTWARE ***Wrong query result
MFXVideoSession::Init( ) return MFX_ERR_NONE but the query result just wrong.
Although the query result is wrong , I still tried to create DX11 Device with Intel graphics adapter but it failed with HRESULT = 0x887A0004 DXGI_ERROR_UNSUPPORTED ( D3D11CreateDevice() return S_OK if I use the discrete graphics adapter to create the device).
The same code could run under Win32 Service on my Ivy bridge Intel HD Graphics 4000 machine (this machine doesn't have discrete graphics adapter).
The weird thing is the result of MFXQueryIMPL() is MFX_IMPL_SOFTWARE instead of MFX_IMPL_VIA_D3D11 | MFX_IMPL_HARDWARE.
Thanks
Hendrik
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Hendrik,
so based on the info you shared it seems the Intel device is associated with the second adapter (MFX_IMPL_HARDWARE2), which is fine.
In (2) it seems you are trying to explicitly use Intel device on the first adapter (MFX_IMPL_HARDWARE), which is expected to fail based on the configuration you have. I recommend you use MFX_IMPL_HARDWARE_ANY to make sure Media SDK gets initialized regardless of adapter config.
"D3D11CreateDevice()" is possibly failing due to trying to initialize it on non-Intel adapter. Please explore the Media SDK samples for examples on how to find the correct adapter number.
Regards,
Petter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Petter ,
Thanks for your kind reply.
As you recommended , I use MFX_IMPL_HARDWARE_ANY to initialize the Media SDK Session.
But under Win32 Service (session 0) , D3D11CreateDevice() still failed with HRESULT 0x887A0004 (DXGI_ERROR_UNSUPPORTED)
Since I am using MFX_IMPL_HARDWARE_ANY , I don't need to care about which graphics adapter is used to create the D3D Device, because Media SDK will automatically select Intel Graphics Adapter.
any suggestions ?
Many thanks,
Hendrik
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Petter ,
I just made a simple experiment on three different devices , I init the Media SDK session with MFX_IMPL_HARDWARE_ANY.
1st device is Intel core i5-3317u with Intel HD Graphics 4000 (no discrete graphic adapter)
2nd device is Intel core i7-4500u with Intel HD Graphics Family (no discrete graphic adapter)
3rd device is Intel core i7-4700HQ with Intel HD Graphics 4600 (NVIDIA GT 745M discrete graphic adapter)
All devices have the newest Intel Graphics Driver.
I run the experiment under Win32 Service(Session 0), the same code could run on the 1st and 2nd devices without problems.
But failed on the 3rd device , D3D11CreateDevice() failed with HRESULT 0x887A0004 (DXGI_ERROR_UNSUPPORTED).
Thanks,
Hendrik
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Hendrik,
Your statement " I don't need to care about which graphics adapter is used to create the D3D Device, because Media SDK will automatically select Intel Graphics Adapter" is a bit puzzling.
By selecting MFX_IMPL_HARDWARE_ANY when initializing the Media SDK session it means that Media SDK will find the adapter associated withe Intel graphics device. You are doing the right thing here. But... you still need to make sure you create your DirectX device on the adapter associated with the Intel graphics device. I suspect your code is statically using default adapter when creating the device, thus for the system with discrete card the Intel graphics adapter is not the primary (default) and then device creation will fail. Can you confirm this please?
For details on how to initialize Media SDK and create DirectX device, please refer to the Media SDK sample code, "d3d_device.cpp" and "d3d11_device.cpp". As you can see from this code, the DirectX device creation determines the current Intel Graphics device adapter dynamically before creating the device.
Regards,
Petter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Petter ,
I apologize for the ambiguity in my statement.
Yes I did use the same way like "GetMSDKAdapterNumber()" inside "d3d11_device.cpp" to get the the Intel Graphics Adapter number.
I also double checked the result of IDXGIFactory2::EnumAdapters by checking the adapter description
IDXGIAdapter* adapter;
DXGI_ADAPTER_DESC adapterDescription ;
m_pDXGIFactory->EnumAdapters(adapterNum, &adapter);
adapter->GetDesc(&adapterDescription);
adapterDescription.Description = "Intel HD Graphics......"
So I am sure that I used Intel Graphics Adapater to create the DX11 Device.
Many thanks,
Hendrik
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Hendrik,
Thanks for confirming your method for device creation.
From your description, the issue seems to be specifically related to DX11 device creation and not Media SDK. I suspect the issue may be somehow related to the device creation parameters used.
Would you be able to share the device creation and service wrapper code which showcases this issue so that we can try to replicate it here on our side. If you prefer you can share it as a private forum post to me.
Regards,
Petter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Petter ,
below is my device creation parameter
D3D_FEATURE_LEVEL pFeatureLevelsOut;
UINT dxFlags = 0;
static D3D_FEATURE_LEVEL FeatureLevels[] = {
D3D_FEATURE_LEVEL_11_1,
D3D_FEATURE_LEVEL_11_0,
D3D_FEATURE_LEVEL_10_1,
D3D_FEATURE_LEVEL_10_0
};
D3D11CreateDevice(m_pAdapter,
D3D_DRIVER_TYPE_UNKNOWN,
NULL,
dxFlags,
FeatureLevels,
(sizeof(FeatureLevels) / sizeof(FeatureLevels[0])),
D3D11_SDK_VERSION,
&m_pD3D11Device,
&pFeatureLevelsOut,
&m_pD3D11Ctx);
As for the service wrapper code , I will try to provide you a simpler version via private forum post , but it will take me some time to do this.
Thanks,
Hendrik
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page