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.

Issues with using system memory with H.264/HEVC encoding/decoding on Skylake on Windows 10

AaronL
Beginner
461 Views

If I use the -d3d or -d3d11 with the sample_encode and sample_decode samples on Windows 10 Skylake, this works fine for H.264 encoding and decoding and HEVC encoding (HEVC decoding isn't working for other reasons, as I described in the following post:  https://software.intel.com/en-us/forums/intel-media-sdk/topic/596382 ).  However, if I instead use system memory (no -d3d nor -d3d11 option), it doesn't work at all.

For HEVC encoding using system memory, it seems to work, but the resulting .hevc file is very small.  For example, if I use the following command-line options to encode the test_stream_176x66.yuv that is included with the samples:

sample_encode.exe h265 -i ..\..\..\_bin\content\test_stream_176x96.yuv -o test_stream.hevc -w 176 -h 96 -hw -p 6fadc791a0c2eb479ab6dcd5ea9da347 -d3d

it generates a file that is 149,746 bytes in size.  If I then mux that into an .mp4 container (I used MKVToolNix for this), this generates a 3 second clip that plays fine in VLC.

If I instead use the following command-line:

sample_encode.exe h265 -i ..\..\..\_bin\content\test_stream_176x96.yuv -o test_stream.hevc -w 176 -h 96 -hw -p 6fadc791a0c2eb479ab6dcd5ea9da347

this instead generates a file that is 1,551 bytes in size.  After muxing the file into an .mp4 container, this generates a 3 second clip which plays fine in VLC, but the contents of each frame are the same--all the pixels are the same "green" color.  So, it clearly didn't work.

The results for H.264 encoding/decoding using system memory are in some ways worse.  With both sample_decode, it fails the first time it calls SyncOperation() with MFX_ERR_DEVICE_FAILED.

With sample_encode, it gets into an infinite loop because it doesn't have enough surfaces prior to needing to synchronize the first task--that is, early on in the pipeline, it calls GetFreeSurfaceIndex() and never returns (or rather, it will eventually return, but it will take a _long_ time).  I compared the value stored in NumFrameSuggested after QueryIOSurf() is called when -d3d is used and when it isn't.  When -d3d is used, NumFrameSuggested is set to 7, while when it isn't used, it is set to 6.  I was able to get past the infinite loop by adding 1 to nEncSurfNum in the case that system memory is used.  This gets me to the first call to SyncOperation(), which fails with MFX_ERR_ABORTED.

So, the Intel Media SDK is totally hosed when using system memory on Skylake.  This works fine on 3rd, 4th, and 5th generation Intel Core processors but fails utterly on 6th generation Core processors.

Are they any workarounds for this?  If not, when can I expect to see a fix for this?

0 Kudos
8 Replies
Surbhi_M_Intel
Employee
461 Views

Pretty much same details are needed here as well - 

Can you tell us your system details - Processor , Graphics device, graphic driver version?
Which version of media sdk you have installed on your system? Are you using Media Server Studio, only Media Server Studio has HEVC SW plugin and it doesn't support 6th generation. 

Can you send us a reproducer or tracer for your issue? There is no reason why video memory should fail if you meet pre-requisites.
By default if you mention -d3d, it will use video memory, otherwise it will pick system memory. With your results I definitely suspect something not right in setting up of Media SDK. I have tested your use cases today on a skylake system an do not see any issue with H265 encoding/decoding or H264 encoding/decoding. 


Thanks,
Surbhi

0 Kudos
AaronL
Beginner
461 Views

Surbhi,

I'm sorry, but it seems you didn't read my post if you are if you are talking about video memory.  My post specifically talks about it failing when system memory is used.  It works fine if video memory is used.  So, it works when -d3d or -d3d11 are used.  It fails utterly when either option is not used.  This applies to H.264 encoding, H.264 decoding, and HEVC encoding.  HEVC decoding fails for other reasons, as I already mentioned.

I'm using all the prerequisites described in your Skylake post on a 64-bit Windows 10 system with an i5-6600K processor.

I expect that this is something that will be easily reproduced on your end.

Thanks,

Aaron Levinson

0 Kudos
Surbhi_M_Intel
Employee
461 Views

Hi Aaron, 

I did read your question. My bad, I forgot to include the system memory part. Without any change to sample, I am successfully able to do H264 encoding and decoding 
System used: SKL GT4 system 

C:\Users\mediasdk\Documents\Intel Media Samples 6.0.0.68>sample_encode.exe h264 -i "C:\Users\mediasdk\Documents\Intel Media Samples 6.0.0.68\_bin\content\test_stream_176x96.yuv" -o out -w 176 -h 96 -b 1000 -f 30 -hw
Encoding Sample Version 1.0.0.0

Input file format       YUV420
Output video            AVC
Source picture:
        Resolution      176x96
        Crop X,Y,W,H    0,0,176,96
Destination picture:
        Resolution      176x96
        Crop X,Y,W,H    0,0,176,96
Frame rate      30.00
Bit rate(Kbps)  1000
Target usage    balanced
Memory type     system
Media SDK impl          hw
Media SDK version       1.17

Processing started
Frame number: 101
Processing finished

I have got your system configuration details, will try to get a system with same configuration and try. Will update as soon as I have some results. Until then if you can send us a tracer logs, it will help. Media SDK tracer is part of media client package, you can found it under tools directory. 

Along with that, current samples were never fully tested on SKL platform, so there might be gaps present(not necessarily the one we are discussing above) which are fixed in the coming sample release(will happen in few coming weeks). I appreciate your patience. 

Thanks,
Surbhi

0 Kudos
AaronL
Beginner
461 Views

Hi Surbhi,

I executed the command-line that you supplied above and it failed in the way I've already described.  However, I noticed one significant difference in the output:

C:\Users\AaronL\Documents\Intel Media Samples 6.0.0.68\_bin\x64>sample_encode.exe h264 -i "c:\Users\AaronL\Documents\Intel Media Samples 6.0.0.68\_bin\content\test_stream_176x96.yuv" -o out -w 176 -h 96 -b 1000 -f 30 -hw
Encoding Sample Version 6.0.0.68

Input file format       YUV420
Output video            AVC
Source picture:
        Resolution      176x96
        Crop X,Y,W,H    0,0,176,96
Destination picture:
        Resolution      176x96
        Crop X,Y,W,H    0,0,176,96
Frame rate      30.00
Bit rate(Kbps)  1000
Target usage    balanced
Memory type     system
Media SDK impl          hw
Media SDK version       1.16

On my system, it shows the Media SDK version as "1.16".  On your's it shows "1.17".  This makes me think that perhaps we don't have the same version of the driver installs on our systems.

Before providing tracing info, here is some relevant information from my system regarding versions of files and installer packages:

Under Control Panel->Programs->Programs and Features:

  • Intel(R) Graphics Driver:
    • ​Size:  74.2 MB
    • Version:  10.18.15.4279 (yes, I know the prerequisites say to install 15.40.7.4279, which is what I did, but this is how the version number shows up under Programs and Features)

Under Device Manager->Display adapters->Intel(R) HD Graphics 530 (driver tab):

  • Driver Date:  8/24/2015
  • Driver Version:  10.18.15.4279

In File Explorer, under C:\Program Files\Intel\Media SDK:

  • libmfxhw32.dll / libmfxhw64.dll
    • File version:  6.15.7.7
    • Product version:  6.0.1540.405
  • mfxplugin32_hw.dll / mfxplugin64_hw.dll
    • File version:  1.15.7.7
    • Product version:  1.16.6.105

Does that match with what you have on your system?  I would guess not based on the 1.16 vs 1.17 discrepancy.

I should also add that it fails the same way on a completely different Skylake system that has a different motherboard and a different processor (i7-6700K).  This other system has the same prerequisites installed.

Thanks,

Aaron Levinson

0 Kudos
Surbhi_M_Intel
Employee
461 Views

Hi Aaron, 

Another update for this issue -
I discussed this with the experts and seem like quite a few things are broken om the 4279 driver version specially system memory issue. There are aware of this issue and the fix is available on the next driver, but the next driver version is not publicly available(hoping would be available in couple of weeks). So I would suggest to hold on any testing with system memory till then. 

Thanks,
Surbhi

0 Kudos
Surbhi_M_Intel
Employee
461 Views

Hi Aaron, 

I noticed today morning that there is a new driver release i.e 15,40-4300 (link to download - https://downloadcenter.intel.com/product/88345). Can you please update the driver version and check the system memory behavior you reported before. 

Thanks,
Surbhi
 

 

0 Kudos
AaronL
Beginner
461 Views

I can confirm that encoding and decoding using system memory work for H264 and HEVC with the latest driver (154010.4300).

Surbhi:  It would be helpful if you could update the "How to run Media SDK samples on Skylake" post with all the updated information.  The HEVC HW decoding section in your post has never been correct, since the specified command-line won't use the HW HEVC decoder without additional, unspecified modifications to the code, and anyway, its easier to specify the GUID for the HW HEVC decoder on the command-line.  Plus, it would be helpful to mention the new driver version, since that works better overall for H.264 and HEVC.

0 Kudos
Surbhi_M_Intel
Employee
461 Views

Thanks for confirming your results, I have updated all this information in the article, have also mentioned hevc decode plugin guid. Reason it wasn't included before we were seeing some difference in behavior on different SKUs with including plugin id. This should be resolved in future sample release. 

Thanks for updating again and providing the valuable feedback. I am closing this issue, as you come across more issue please open a new thread. 

-Surbhi
 

0 Kudos
Reply