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.
3056 Discussions

Error in old Media SDK with latest available drivers

Joerg_R_
Beginner
530 Views

Hi,

We developed a plugin for our software products (OS: Windows) based on the original sample "sample_encode".
For some reasons we use MFX_IMPL_HARDWARE_ANY with MemType SYSTEM_MEMORY instead of D3D9 or D3D11.

Some customers reported that it crashed while encoding MPEG2. I don't know if there are also crashes with other codecs, because the product does only encode MPEG2.
The error was always the same:
Every single MFXVideoCORE_SyncOperation call returns MFX_ERR_DEVICE_FAILED.
As mentioned in the documentation and the sample code, we try to close and restart encoding after MFX_ERR_DEVICE_LOST or MFX_ERR_DEVICE_FAILED.
After that everything works well again, until the first MFXVideoCORE_SyncOperation.

I read all the other topics here, concerning SyncOperation and the device failed error. But found no solution.

So I did some further tests - about 2 weeks, up to now.
Results:

  1. Reproducible on 2 different graphics adapters and CPUs
    - Intel(R) HD Graphics 4600 @ Core i7-4700HQ
    - Intel(R) HD Graphics 515 @ Core m5-6Y57
  2. Reproducible with the current code samples on GIT (sample_encode).
    Command line: sample_encode.exe mpeg2 -hw -i test_stream_176x96.yuv -o test1.mpg -w 176 -h 96 -async 8 -framerate 25 -u quality
  3. All systems had Media SDK version 1.16.

Using the "mediasdk_tracer" tool from the SDK, I found out:

We call: MfxInit(MFX_IMPL_HARDWARE_ANY, &ver)
Tracer log: MFXInitEx(par.Implementation=MFX_IMPL_HARDWARE|MFX_IMPL_VIA_D3D9 ...)

Or we call: MfxInit(MFX_IMPL_HARDWARE, &ver)
Tracer log: MFXInitEx(par.Implementation=MFX_IMPL_HARDWARE|MFX_IMPL_VIA_D3D9 ...)

If we run the "sample_encode" with parameter d3d or d3d11 there are NO problems.
There are only errors/crashes if we use the system memory allocator.

After an update of the graphics drivers @ the Core m5-6Y57 the system was updated to Media SDK 1.19.
The tracer log also shows "par.Implementation=MFX_IMPL_HARDWARE|MFX_IMPL_VIA_D3D9", but it works!
Also if we use the system memory allocator. No more errors at all.

This seems to be an issue in Media SDK 1.16 only and can be fixed in 2 ways:
1. Updating the graphics drivers
2. Use D3D memory allocators for the encoder

Are there any other options to fix it, if there are no graphics driver updates available and there is no way to change the encoder?

Kind regards,
Joerg

 

0 Kudos
1 Reply
Joerg_R_
Beginner
530 Views

No response?! Perhaps a little update helps to get any reaction....

A whole month is over and we released an updated version of our latest product including a changed encoder.
The new version of the encoder now uses D3D(9) memory.
After that, we received reports from our customers confirming that this new version works at Media SDK versions 1.16 and later.

BUT we also received numerous reports that the problem remains with Media SDK 1.11 AND these customers are running the latest drivers available for their systems.
On these systems the encoding starts and after a while (i.e. > 6000 encoded pictures) the SyncOperation returns 
MFX_ERR_DEVICE_FAILED. We try to reset the encoder, which results in MFX_ERR_UNDEFINED_BEHAVIOR while resetting the hardware device (D3D9).

It seems to be a slightly different problem now with Media SDK 1.11, because we changed the encoder from system memory to D3D memory.
But I think the main problem is, that there is no driver with a current Media SDK version available for these systems.
(e.g. Intel Core i5-3210M with Intel HD Graphics 4000)

Is there a way to provide a current version of the Media SDK together with our software and use this instead of the old version integrated in the drivers?

Greets from Germany,
Joerg

P.S. I am going to update the thread title, because it is also a bug in MSDK 1.11.

0 Kudos
Reply