Media (Intel® Video Processing Library, Intel Media SDK)
Access community support with transcoding, decoding, and encoding in applications using media tools like Intel® oneAPI Video Processing Library and Intel® Media SDK
Announcements
The Intel Media SDK project is no longer active. For continued support and access to new features, Intel Media SDK users are encouraged to read the transition guide on upgrading from Intel® Media SDK to Intel® Video Processing Library (VPL), and to move to VPL as soon as possible.
For more information, see the VPL website.

MFXInit() with MFX_IMPL_AUTO_ANY option doesn't use HW Impl on Windows8.1 if SW Impl dll is present in current directory

Ramashankar
New Contributor III
2,120 Views

Hi,

I am observing a strange behaviour from MFXInit(). 

When I initialize the session with MFX_IMPL_AUTO_ANY option and SW implementation dll (libmfxsw64.dll) is present in the same directory of caller application, then session always gets initialized with SDK's Software implementation on my Windows8.1, even though my system has HW implementation support also (refer the sys_analyzer.log). 

But, if I remove/rename this libmfxsw64.dll while running on windows8.1, or if I run it (without renaming) on a windows7 machine, then it is initializing HW implementation. 

As per my understanding from media sdk manual document:

The application can also initialize a session to be automatic (MFX_IMPL_AUTO or MFX_IMPL_AUTO_ANY), instructing the dispatcher library to detect the platform capabilities and choose the best SDK library available.

So, 

1. Should not the session gets initialized with HW implementation on Windows8.1 also even if libmfxsw64.dll is present in current directory? Or is it expected behaviour from MFX_IMPL_AUTO_ANY option on WIndows8.1? 

2. If it is expected behavior then why its not same on Windows7 OS?

Please reply.

Thanks,

0 Kudos
13 Replies
Ramashankar
New Contributor III
2,120 Views

Hi,

>> Please ignore the above query. There was a mistake in my experiment. So I will correct the query again after further investigation.

I have edited my original post above itself and corrected my query & its explanation there. So please reply on this now.

Thanks,

0 Kudos
Sravanthi_K_Intel
2,120 Views

Hi Ramashankar - This is a weird behavior. You are saying on Win 7, even with SW dll in the project folder, HW gets loaded. But not in Win 8.1. Can you confirm that both OS are on the same platform, and you are still observing the behavior? Also, hope your projects is not blocked on this issue.

0 Kudos
Ramashankar
New Contributor III
2,120 Views

Hi Sravanthi,

1. You are saying on Win 7, even with SW dll in the project folder, HW gets loaded. But not in Win 8.1. 

2. Can you confirm that both OS are on the same platform, and you are still observing the behavior?

3. Also, hope your projects is not blocked on this issue.

1. Exactly. (just to clarify further, this behaviour is when I call MFXInit() with MFX_IMPL_AUTO_ANY option, but in case I call MFXInit() with MFX_IMPL_HARDWARE explicitly then it loads HW impl on win8.1).

2. Yes, both OS are windows-64 bit OS, but SDK's HW impl API  version are different. On Win8.1 it is API version 1.16, and on Win7 it is 1.4.

3. I am sorry to say but yes, it is causing issue in our project. Let me explain a bit of my project scenario here.

I am developing a custom application which performs encoding, decoding, screen capturing operation on Win 7, Win 8 and Win 10 machine, by utilizing intel media sdk's HW & SW capabilities. To achieve the best performance on all os, I wrote a function which is supposed to detect best media SDK library (HW or SW) available on that OS. That is why I used MFX_IMPL_AUTO_ANY option during session initialization. This sample function is already uploaded in this thread: https://software.intel.com/en-us/forums/intel-media-sdk/topic/597925

Now due to the above mentioned issue, my decoding, encoding operation are forced to run with sw library on Win 8.1 OS (haven't verified it on Win 8.0 & Win 10, but I believe same issue will be there also).

I am providing you a custom code (.cpp only) to check this issue. Just add libmfxsw64.dll or libmfxsw32.dll (based on your platform) in the path where you place this custom app (CheckHWCap.exe).

Let me know if I need to provide any further information here.

Thanks.

 

0 Kudos
Ramashankar
New Contributor III
2,120 Views

Hi All,

Is there any update on this issue? Please suggest if there is any solution available for this?

Thanks,

0 Kudos
Ramashankar
New Contributor III
2,118 Views

Hi Sravanthi, other Intel members,

Please let me know if there is any update on this issue? Its been more than a week time.

Is this issue reproducible in your environment? Do you find it as an issue or it is an expected behaviour / limitation of SDK? 

Thanks,

0 Kudos
Surbhi_M_Intel
Employee
2,120 Views

Hi Ramashankar, 

Can you provide details of the underlying platform like CPU info, graphic driver , driver version and Media SDK/Media Server Studio version. You can get all this info from system analyzer log, system analyzer is present in the installed directory under tools folder. This is not an expected behavior, if we choose implementation to be AUTO_ANY it should choose select HW acceleration if available. Uisng your code on windows 4th generation windows 8.1 system with latest driver version installed, I am seeing correct behavior, the o/p looks like 

 HW support to be checked: 3
Mem support to be checked: 512
 Queried IMPL[203]
Detected IMPL[202], Version[1.16], HWSupport[1], MemoryType[1]

I am selecting AUTO_ANY and checking for d3d9 support and it detects d3d9 memory and hardware implementation to be supported on the underlying hw. 

Can you please make sure you have latest graphics driver installed on your system? You can check that on downloadcenter.intel.com 

Thanks,
Surbhi

 

0 Kudos
Ramashankar
New Contributor III
2,120 Views

Hi Surbhi,

Thanks for your reply. 

Can you provide details of the underlying platform like CPU info, graphic driver , driver version and Media SDK/Media Server Studio version. You can get all this info from system analyzer log, system analyzer is present in the installed directory under tools folder.

I have already provided the system analyzer log (its in my first post itself). Still, I am attaching it again for your reference.

Regarding the reproducibility of this issue, there are two conditions to make sure:

1. SW dll (libmfxsw64.dll or libmfxsw32.dll) is present in the current exe path.

2. While specifying option AUTO_ANY for hw support, choose VIA_ANY (256) option for memory also or don't specify memory option at all (choose 0). Sorry i didn't specify this condition earlier. Hope it will help to reproduce the issue at your end also.

At my end, results are as following:

-----------------------------------------------------------------------------------------------------------------------------------------

Case 1: HW: MFX_IMPL_AUTO_ANY, Memory: Not specified
 HW support to be checked: 3
Mem support to be checked: 0
 Queried IMPL[3]
Detected IMPL[1], Version[1.15], HWSupport[0], MemoryType[0]  => Error case

 

Case 2: HW: MFX_IMPL_AUTO_ANY, Memory: MFX_IMPL_VIA_ANY
 HW support to be checked: 3
Mem support to be checked: 256
 Queried IMPL[103]
Detected IMPL[1], Version[1.15], HWSupport[0], MemoryType[0]  => Error case

Note: For case 1 & 2, if I rename/remove libmfxsw64.dll from current exe path and then do this test again with same input, result will change to following:
 Detected IMPL[202], Version[1.16], HWSupport[1], MemoryType[1]

 

Case 3: HW: MFX_IMPL_AUTO_ANY, Memory: MFX_IMPL_VIA_D3D9
 HW support to be checked: 3
Mem support to be checked: 512
 Queried IMPL[203]
Detected IMPL[202], Version[1.16], HWSupport[1], MemoryType[1]  => OK case

 

Case 4: HW: MFX_IMPL_AUTO_ANY, Memory: MFX_IMPL_VIA_D3D11
 HW support to be checked: 3
Mem support to be checked: 768
 Queried IMPL[303]
Detected IMPL[302], Version[1.16], HWSupport[1], MemoryType[2]  => OK case

-----------------------------------------------------------------------------------------------------------------------------------------

For query with MFX_IMPL_SOFTWARE (1) or MFX_IMPL_HARDWARE (2) value, output is as per expectation, so no issue. But as I mentioned earlier, I wanted to check the best performance option on system (HW or SW availability, using best available memory option)  so I am using MFX_IMPL_AUTO_ANY | MFX_IMPL_VIA_ANY option in my actual implementation. 

Thanks,

0 Kudos
Surbhi_M_Intel
Employee
2,120 Views

Hi Ramashankar, 

Thanks for describing your scenarios and options to choose. Sorry I missed that you have already provided the system analyzer info before.

Unfortunately I am still not able to achieve your result after keeping sw and hw dll in the executable directory. here are the o/p- 

 HW support to be checked: 3
Mem support to be checked: 3
 Queried IMPL[3]
Detected IMPL[202], Version[1.16], HWSupport[1], MemoryType[1]
 Continue(press 'n' to exit)?: 1

 HW support to be checked: 3
Mem support to be checked: 0
 Queried IMPL[3]
Detected IMPL[202], Version[1.16], HWSupport[1], MemoryType[1]
 Continue(press 'n' to exit)?:

After discussing this with one of the experts here, we have encountered similar situation in the past which we are believing could be related but there are many MSDK install + OS+ driver variants possible so it is hard to configure if particular system will see this issue. 

I would recommend you to update to latest package i.e. Media SDK 2016 (standalone, not part of INDE anymore) and to the latest driver, remove old version of media sdk i.e. 6.0.0.349  and 6.0.0.388 . Make sure environment variable is set properly, build your sample again(don't use same executable). Any reason you are keeping dlls in executable directory? make sure to replace them with latest sw and hw dlls. 
Rerun the application and check result, if you see same result please send us the executable you are running, tracer logs(capture media sdk calls and can probably explain this issue)

Regarding "I wanted to check the best performance option on system (HW or SW availability, using best available memory option)  so I am using MFX_IMPL_AUTO_ANY | MFX_IMPL_VIA_ANY option in my actual implementation."

 

To check the best options available on your underlying platform, I will suggest you to check with IMPL_AUTO_ANY and once it says hw is supported then check whether d3d11 implementation is supported or not, memory will pick d3d9 even if d3d11 is supported because of the that is default implementation it will choose. 

Thanks,
Surbhi

0 Kudos
stoop__tomes
Beginner
2,120 Views

Hi,

It seems like I have the same issue. If the SW dll is in the same directory as the exe AUTO_ANY selects SW over HW. If the dll is removed from the directory, HW is chosen.

I'm using the latest Media SDK version and the graphics driver has been updated to the latest version.
In the attachment you can find the system analyzer output.

Thanks.

Plain text icon analyzer.txt

0 Kudos
celli4
New Contributor I
2,120 Views

Having the same issue here, three systems tested:

All three tested with the same SW version: File Version: 7.16.5.13    Product Version: 7.0.0.358

Windows 8.1, libmfxhw64.dll: File Version: 7.15.12.20   Product Version: 7.0.1536.305   WORKS AS EXPECTED

Windows server 2012 R2,  libmfxhw64.dll: File Version: 7.15.12.20   Product Version: 7.0.1536.305   WORKS AS EXPECTED

Windows 10 , libmfxhw64.dll: File Version: 8.18.2.2  Product Version: 8.0.0.21  **NOT** WORKING AS EXPECTED (SW given priority over HW loading with MFX_IMPL_AUTO_ANY in same directory)

 

This is a real bug, IMSDK team.

 

0 Kudos
Ramashankar
New Contributor III
2,120 Views

Hi Camkego,

I think this issue is somehow linked with combination of SW dll (libmfxsw64.dll) version + OS + Graphics card and driver. 

Right now, on my Windows 8.1 64 bit OS, having Intel HD Graphics 510 and driver version 21.20.16.4565 and using (MFX_IMPL_AUTO_ANY | MFX_IMPL_VIA_ANY) combination:

If I use SW dll from an old sdk release (which is exposing API version 1.17), then this issue is always reproducible, SW implementation is being preferred over HW. But if I use SW dll from latest sdk (which is exposing API version 1.26) then issue is not reproducible, HW implementation is being preferred.

Above was just for information.

0 Kudos
celli4
New Contributor I
2,120 Views

Ramashankar,

Thanks for the note.

For us, ultimately, the issue turned out to be using an old (2016) dispatcher library (libmfx64.lib), and no the hw/sw backend doing the coding. (libmfxhw64.dll/libmfxsw64.dll)

When we switched to the 2019 R1 release, with just the libmfx64.lib library, the problem was resolved. Unfortunate no one at Intel clarified that here.

 

0 Kudos
Ramashankar
New Contributor III
2,120 Views

Yes, I also think it is problem of dispatcher library only because it is the one who decides which implementation (Sw / Hw) to use.

0 Kudos
Reply