Showing results for 
Search instead for 
Did you mean: 

MFXInitEx() failure on /MDd when MFX_IMPL_SOFTWARE


I have a very strange bug in my program : on Windows 10 (17-6500U + graphics 520).
I got bugs in my application so I have built a very simple test program and reproduce this problem :
I execute a for() loop : setting impl successively to : MFX_IMPL_SOFTWARE / MFX_IMPL_HARDWARE_ANY / MFX_IMPL_HARDWARE /MFX_IMPL_AUTO_ANY

for (...) {
        mfxInitParam initParam = { 0 };
        initParam.Version.Major = 1;
        initParam.Version.Minor = 0;
        initParam.Implementation = pImpl->impl
        sts = MFXInitEx(initParam, &session);
	if (MFX_ERR_NONE == sts) {
		sts = MFXQueryVersion(session, &versionReturn);
		if (MFX_ERR_NONE == sts) {...}  else {...}
		sts = MFXQueryIMPL(session, &implReturn);
		if (MFX_ERR_NONE == sts) {...}  else {...}
		sts = MFXClose(session);
		if (MFX_ERR_NONE == sts) {...} else {...}
	} else {...}

In general, this code works fine, except in a very specific case : when I compile and link with Runtime libray = Multi-threaded Debug DLL (/MDd) and impl = MFX_IMPL_SOFTWARE .
I get the return value : MFXInitEx() FAILED with sts = -3 = MFX_ERR_UNSUPPORTED
For the others, I have those outputs :

Loop MFXInitEx() with impl = HARDWARE_ANY = 0x4
MFXInitEx() succeeded
MFXQueryVersion() succeeded : version = 1.19
MFXQueryIMPL() succeeded : impl = 0x202 = HARDWARE | VIA_D3D9
MFXClose() succeeded

When impl is different than SOFTWARE, it success. And when compiling and linking with other options (/MT ; /MD ; /MTd), it works for all, including SOFTWARE.
The problem exists for both x86 and x64.
To do so, I have compiled the mfx_dispatcher in all possible ways : x86 and x64 and : Debug / Debug_THM / Release / Release_THM.
I have even tried another compilation method which is Debug_MDd and Release_MD : I created them from Debug_THM and Release_THM but without defining preprocessor WIN_THRESHOLD_MOBILE. The result is the same !

I tried to run this test program and also my application on another computer (Windows 10 but with nvidia graphics) : with AUTO_ANY, it success in /MD but fails in /MDd...

Last weird thing : I tried to run the tool mediasdk_tracer : when the tool is executed, the call to MFXInitEx are always succeding, even with /MDd and IMPL_SOFTWARE so this has a side-effect on my program.

Is anybody having the same problem ? Or knows how to solve that ?


0 Kudos
1 Reply


The system registry contains information about platform-specific HW SDK implementations.

Software SDK implementations reside in the application’s local folder.

The dispatcher locates software SDK implementations by their reserved names.

libmfxsw32.dll  for IA-32 architecture

libmfxsw64.dll  for Intel® 64 architecture

The problem that compiling with /MTd  ( static debug VC runtime) as well as /MDd ( dynamic debug VC runtime) enforces _DEBUG symbol to be defined by Visual Studio.

As result mfx dispatcher looks for libmfxsw64_d.dll that missing  in  application’s local folder.

HW library is located by registry key that doesn’t  affected by _DEBUG symbol definition.

Solution is simple make a copy  libmfxsw64.dll -> libmfxsw64_d.dll in app folder.