- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have reproduced this problem on both Windows 7 Pro and Windows 10 Pro. Frankly, I cannot find a proper solution so I thought I would ask the forum:
We regularly use NVIDIA NVENC and Quick Sync for hardware encoding H.264 simultaneously. When I upgraded my GTX 950M to GTX 1050Ti, my Quick Sync encoding stopped working. Debugging showed this:
Up front: using media_sdk_system_analyzer_64.exe, hardware (HW) is supported on this device setup up to version 1.19 on Win7 and 1.24 on Win10. This always shows HW support us available, regardless of drivers enabled or disabled. Opportunistic version is reported as 1.19 on Win7 and Win10.
With NVIDIA 1050 Ti driver enabled (using Device Manager to enable/disable), a call to mfxSession.init() return sts = 0, and mfxSession.QueryIMPL() returns MFX_IMPL_SOFTWARE. No Hardware acceleration available.
Running the same code with NVIDIA 1050 Ti driver disabled, a call to mfxSession.init() return sts = 0, and mfxSession.QueryIMPL() returns MFX_IMPL_HARDWARE. At this point hardware accelerated Quick Sync encoding works just fine.
To add to the problem: If I run code that links CUDART64_75.DLL (even if nothing is called in that library) with NVIDIA 1050 Ti driver enabled, a call to mfxSession.init() return sts = -13. (MFX_ERROR_DEVICE_LOST)
int CheckForHardwareAcceleratedIntelVideoGPU() { int ret = 0; //Not hardware accelerated. mfxStatus sts = MFX_ERR_NONE; MFXVideoSession mfxSession; mfxVersion version = { 10, 1 }; mfxIMPL impl = MFX_IMPL_AUTO; sts = mfxSession.Init(impl, &version); printf("INTELGPU ->> mfxSession.Init() sts=%d\n", sts); if (sts == MFX_ERR_NONE) sts = mfxSession.QueryIMPL(&impl); if (sts == MFX_ERR_NONE) { if (impl == (MFX_IMPL_HARDWARE | MFX_IMPL_VIA_D3D9)) { ret = 1; printf("Intel HD Video QuickSync Initialized( HARDWARE, D3D9 )\n"); } else printf("Intel HD Video QuickSync Initialized( OTHER, %02X)\n", impl); } else printf("Intel HD Video QuickSync NOT INITIALIZED. sts=%d\n", sts); return ret; }
Thanks for any help you can give.
System: Adlink and Commel mobos: Intel Core i7-6820EQ
GPUs tested: ZOTAC GTX 1050Ti, Aetina MMX 1050ti.
OS: Windows 7 Pro and Windows 10 Pro
Intel drivers: HD Graphics 530 version 23.20.16.4901.
NVIDIA drivers: GTX 1050 Ti 398.11 (24.21.13.9811).
Intel Media DSK 2017 R1
- Tags:
- Development Tools
- Graphics
- Intel® Media SDK
- Intel® Media Server Studio
- Media Processing
- Optimization
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Steven,
mfxVersion version = { 10, 1 };
mfxIMPL impl = MFX_IMPL_AUTO;
sts = mfxSession.Init(impl, &version);
Just to know: Did you try your session initialization mfxSession.Init() with impl = MFX_IMPL_HARDWARE_ANY or may be MFX_IMPL_HARDWARE2/3/4 option?
Logically MFX_IMPL_AUTO should automatically detect hardware at any slot, but once it did not work for me in one scenario and I explicitly asked for MFX_IMPL_HARDWARE_ANY and then it worked. May or may not be applicable/relevant in your case though.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have noticed other posts being answered by Intel since I posted this one. This one has possibly fallen into a hole? :). Is there something I need to do on my post to get it noticed? Thanks for any help you may have.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Steven,
Sorry for the late response, could you refer to the following document at page 139 to see if it helps?
https://github.com/Intel-Media-SDK/MediaSDK/blob/master/doc/mediasdk-man.pdf
Basically, you need to first figure out where the problems are:
1. Could it be the hardware was disabled?
2. Could it be the Intel media driver was not loaded?
3. Could it be the Media SDK library loading failed?
You need to find a proof to these questions and we can discuss how to solve it.
Mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Mark, no problem and thanks for your reply.
I want to make sure I am communicating the problem well, so please forgive me if its pendatic....
Just to clarify, I have been using the QuickSync SDK successfully for many years. We have successfully used QuickSync on 4th and 6th generation Core i7 processors, with or without GPU's. The legacy GPU's we use are Quadro K60, and GTX 950M (because it's what our IT department could get us) Typical applications are with a CAMLINK frame grabber, doing image enhancement and correction algorithms using the CPU (OpenCV) and/or GPU (with straight CUDA kernels and/or OpenCV with CUDA enabled), and then video encoding with QuickSync and/or NVENC on multiple channels, using various encoding options.
All has been running great until..... we upgraded our legacy GPU's with GTX 1050 Ti GPU's.
So, to establish up front: I can run my code with the QS SDK and hardware encoder on a mobo that has NO external GPU. I can run my code with the QS SDK and hardware encoder on the external legacy GPU's mentioned. I can also run the code with the QS SDK and hardware encoder with a GTX 1050 Ti plugged into the PCIe slot, but the with the NVIDIA DRIVER DISABLED. I cannot run the code nor hardware decoder when the GTX 1050 Ti driver is ENABLED.
On all systems I have tested this on, I have run the media_sdk_system_analyzer_64.exe. In all cases hardware (HW) is supported on the device. They always shows HW support us available, regardless of drivers enabled or disabled.
My guess is that maybe its somehow related to DirectX9's inability to enumerate multiple GPU's, but my code has not initialized DirectX9 at the time that mfxSession.Init fails to find the hardware encoder.
The problem behaves as if, when NVIDIA 1050Ti drivers are enabled, mfxSession.Init(impl, &version) cannot FIND the Intel hardware, so it returns MFX_IMPL_SOFTWARE. When I disable the NVIDIA driver then mfxSession.Init(impl, &version) works just fine.
Hope that clarifies the problem. Please let me know what other information you might need. Thanks for any help you can give.
Steve.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Steven,
mfxVersion version = { 10, 1 };
mfxIMPL impl = MFX_IMPL_AUTO;
sts = mfxSession.Init(impl, &version);
Just to know: Did you try your session initialization mfxSession.Init() with impl = MFX_IMPL_HARDWARE_ANY or may be MFX_IMPL_HARDWARE2/3/4 option?
Logically MFX_IMPL_AUTO should automatically detect hardware at any slot, but once it did not work for me in one scenario and I explicitly asked for MFX_IMPL_HARDWARE_ANY and then it worked. May or may not be applicable/relevant in your case though.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Ramashankar for the good suggestions,
To add my opinion to the problem, my understanding is: mfxSession.Init() loads the library first and it will first check if the driver is available or not. It looks like the Intel media driver was not detected by the library.
Normally, this is not MSDK's responsibility since the issue should happen in the system environment.
Mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hey Ramashankar,
Thank you for your reply. I will try your suggestion and let you know tomorrow.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hey Mark,
Thanks for your reply.
To add my opinion to the problem, my understanding is: mfxSession.Init() loads the library first and it will first check if the driver is available or not. It looks like the Intel media driver was not detected by the library.\
If that is the case (that the Intel media driver was not detected), why is it that the same exact process, detects the library and runs fine when the NVIDIA GTX 1050Ti driver is DISABLED on the Device Manager panel. Shouldn't these be unrelated to the accessibility of the Intel Media Driver? Or what mechanism are you foreseeing would cause the Intel media driver to not be detected when NVIDIA driver is enabled?
As a reminder, with the GTX 950M, and Quadro K620 this is not a problem. This is my quandary.
I unfortunately did not get a chance to try Ramashankar's suggestion tonight, so I will give feed back in the morning.
Thank you both VERY much for your assistance.
Steven.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ramashankar,
Thank you. I tried your suggestion to initialize with MFX_IMPL_HARDWARE_ANY, and interestingly, mfxSession.QueryIMPL(&impl)returned MFX_IMPL_HARDWARE2! Everything started to work after that! :)
Years ago, in my early tests with mfxSession.Init(), MFX_IMPL_HARDWARE_ANY would error out, so I have never looked back at that option.
So thank you.
Next I need to test the CUDART64_75.DLL conflict and see if its still there. I will report results.
Many thanks to you and Mark for your prompt and helpful replies.
Steven.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Steven,
Glad to know that it worked :)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have the same issue: Dell Laptop with GTX 1050 ti, Intel Graphics 630, Windows 10 x64.
Problems with CUDA linkage order.
- GTX enabled, CUDA not linked - OK.
- GTX disabled, CUDA linked - OK.
- GTX enabled, CUDA linked - Neither MFX_IMPL_HW nor MFX_IMPL_HW2 works.
Seems like order of cuda-mfx DLLs initialization does matter, because it is possible to run qsv+nvenc mix with ffmpeg:
ffmpeg -y -c:v h264_qsv -i in.mp4 -c:v h264_nvenc -an out.mp4
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ok, i have a proof:
1. Place all cuda-depended code into DLL. This DLL is linked to CUDART* as usually.
2. In simple main program init mfx stuff first, begin video decoding. After that do LoadLibrary(DLL)+GetProcAddr to obtain pointers to cuda-depended code.
3. Now i can do HW decoding and CUDA in the same process.
Limitation - i must init HW MFX contexts before CUDA. I can not create new HW MFX contexts after loading CUDA libs.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page