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.

MFX_WRN_DEVICE_BSY getting RunVPPframeAsync

Rishab_G_2
Beginner
891 Views

Hello All,

I am developing a transcode application with Decode->two VPP -> Encode. Since we are not allowed to create VPP session in the same MFXVideo session( as per the Media SDK manual), so I have created a join session for the 2nd VPP unit. I have modified the example of simple_transcode_opaque_async_vpp_resize to suit my application.

While running this application first VPP calls is returning  MFX_WRN_DEVICE_BSY.

I have found that surface index returning with warning changing as I change AsyncDepth . As I give AsyncDepth = 4 , 3 the ,message returned for Index= 5,4 respectively.

Please anybody if anybody have idea about how to handle joinsession in Media SDK ?

Regards

Rishab 

0 Kudos
8 Replies
Sravanthi_K_Intel
891 Views

"While running this application first VPP calls is returning  MFX_WRN_DEVICE_BSY" - When you see the device busy warning, the suggestion is to call the sleep function for the device to free up again. Are you saying that your device never comes out of this state?

" surface index returning with warning changing as I change AsyncDepth . As I give AsyncDepth = 4 , 3 the ,message returned for Index= 5,4 respectively" -- When AsyncDepth=N, you can have atmost N asynchronous operations running. If you want to have another callback, you have to perform a Sync operation to free up resources. Does your code have this check as well?

You can see that the tutorial performs these checks in its while() loop. Make sure your new session has these checks in place as well. Having said that, it is difficult to investigate this issue without code. Since you are modifying the tutorial, it would be helpful to provide the code modifications to the tutorial.

0 Kudos
Rishab_G_2
Beginner
891 Views

Hello Sravanthi,

Thanks for the reply . 

I am not getting that issue when I configure the child session on Software (i.e one VPP unit on software ) .

But the error comes when I schedule all the 4 units ( Decode , 2 VPP( deinterlacer +denoiser) , Encode ) on Hardware I am facing the above issue. I am using opaque surface so the control of memory allocation is in the hand of Media SDK. I am using 1920x1080 interlace MPEG2 @60 fps transcoding it to 1920x1080 progressive H264 @60 fps. 

I am doubting Video Memory is not able to allocate some  resources required at run time when everything is in HARDWARE.

Do you think this could be reason for  MFX_WRN_DEVICE_BSY being returned ?

If not , what could be the possible reason ?

I want to specify I am using Gigabyte Pro Haswell device for this application .

Regards

Rishab

 

0 Kudos
Sravanthi_K_Intel
891 Views

Hello Rishab - 

In the configuration you are describing above, if you allowed enough time for the device to free-up, the application should progress as expected. Without looking at your code, it is difficult for me to pin point where/why the issue is coming up. 

Since you are observing this behavior after modifying the simple_transcode_opaque_async_vpp_resize application, it would be good if you can share the code with us so that we can take a look at it. 

Meantime, some clarifications:

1. " 2 VPP( deinterlacer +denoiser) " - Are you using two VPP sessions, one for deinterlacing and another for denoising?  If so - you can have one VPP session apply more than one filter using the mfxExtBuffer structure.

2. Regarding denoiser - Before applying our denoiser algorithm, I would encourage you to test the denoising filter on a simple progressive input to check if the amount of denoising our filters provide suits your needs. 

 

0 Kudos
Rishab_G_2
Beginner
891 Views

Hello Sravanthi,

Thanks for the reply and really appreciate for your inputs.

I moved to Linux gigabyte Pro was able to get the system work properly completely in Hardware. Though Windows it stills doesn't work completely Hardware though if I make on unit as software it works. 

Could you suggest any precautions to take?

1. " 2 VPP( deinterlacer +denoiser) " - Are you using two VPP sessions, one for deinterlacing and another for denoising?  If so - you can have one VPP session apply more than one filter using the mfxExtBuffer structure.

We want to control the order in which these filters can be applied that is the reason  we are creating two sessions. If by having one session is there any way to control the order in which these filters are applied, please do suggest.

2. Regarding denoiser - Before applying our denoiser algorithm, I would encourage you to test the denoising filter on a simple progressive input to check if the amount of denoising our filters provide suits your needs. 

Yeah , we did that test before and have come out with  a small range of values where the denoiser works the best.

There is small query I am using Opaque Surfaces in the transcode system which configures the in/out memory as Video Memory if the module is available on Hardware. But if I change that memory to System Memory I saw mostly 2.5X but sometimes even 3X depreciation in performance.I expected the drop in speed but more than 2X is a bit large. Could you suggest the reason for the drastic drop ? Is there any way to compensate for this drop in speed?

Regards

Rishab

0 Kudos
Sravanthi_K_Intel
891 Views

Hello Rishab,

Glad you got the application working with Linux gigabyt pro. Regarding your question on system memory -  is this application running on Linux or Windows. I ask since you mention you are using the SW impl on the Windows system, while HW on Linux. Can you please clarify?

0 Kudos
Rishab_G_2
Beginner
891 Views

Hello Sravanthi ,

As I able to get the system all running with all the components on Hardware so these question is regarding Linux set up only. The Linux set up have all the components as Hardware only.

Regards

Rishab

 

0 Kudos
Sravanthi_K_Intel
891 Views

Using system memory is expected to give low performance, but 2.5X is a large drop. You can test this by running simple_transcode and simple_transcode_opaque_async - the difference in fps is around 30% or so.

"in/out memory as Video Memory if the module is available on Hardware. But if I change that memory to System Memory" - So, instead of using opaque surfaces, you have modified the code to have a conditional statement such as : if(HW_IMPL), use System memory? If this is correct, then ALL your operations (Decode, VPP-deint/denoise, Encode) should be using the system memory instead of the video memory. If this is the case, the slowdown should be around the 30% ballpark. Whereas, if one operation uses video memory while the other uses system, this could really affect the performance, (for example, decode uses video memory while VPP uses system memory) since it results in multiple copies from video<-> system memory for each frame - in this case the slowdown could be drastic. Can you please let us know what each pipeline stage is using - video or system?

If you can send a reproducer code for the behavior you are seeing above, we can try to understand the behavior. Otherwise, we can only guess what could be going wrong based on our understanding of your problem description. 

0 Kudos
Rishab_G_2
Beginner
891 Views

Hello Sravanthi ,

Thanks Sravanthi your inputs have been really helpful.

I am witnessed the 33% drop in simple_transcode_opaque_async_vppresize example as you said .but I also see as I increase the VPP units the drop reach to 50 - 60 % .

With makes me inquisitive about the difference of behavior of Opaque Surfaces and Real surfaces and what are opaque surfaces advantages ?

I read that opaque surfaces can be converted to real surfaces using VPP unit but there is still ambiguity about how to go ahead with it.

Please could you give some inputs on these queries.

Regards

Rishab

 

0 Kudos
Reply