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.

[SOLVED] Getting permanently MFX_WRN_DEVICE_BUSY while encoding H.264

Lee_g_
Beginner
462 Views

Hi, i'm working on a encoding software using ffmpeg with Media SDK R3 on CentOS 7. encoding H.264 with ffmpeg using qsv is working quite well,

but sometimes i got MFX_WRN_DEVICE_BUSY permanently and it doesn't work until process is restarted.

Here's the detail information.

---------

Hardware : Intel(R) Xeon(R) CPU E3-1245 v3

OS : CentOS 7 3.10.0-123.el7.x86_64

Installed software : SDK2015ProductionEvaluation16.4

                 - install_sdk_UMD_CentOS.sh : installed

                 - build_kernel_rpm_CentOS.sh : not installed ( looks like custom kernel, which i can just pass for using Quick Sync )

and following URL contains a couple of codes that coordinates with Media SDK.

https://github.com/shenhailuanma/qsv-ffmpeg-codec/blob/master/ffmpeg2.2/libavcodec/qsvenc.c

---------


Here's the scenario that cause MFX_WRN_DEVICE_BUSY permantly.

---------

step 1. initialize with vaInitialize, right after getting a handler by vaGetDisplayDRM from hardware that is located "/dev/dri/card0"

step 2. initialize & run H.264 encoder.

step 3. call vaTerminate and close the fd when quit process.

step 4. repeat 1.

---------

This is just simple process that repeat initializing with vaInitialize and closing with vaTerminate.

but sometimes it is just stopped. (currently there is no multiple process, just running one process.)

 

I tested in another environment, but it's working well over 48 hours and it doesn't stop.

---------

step 1. initialize with vaInitialize, right after getting a handler by vaGetDisplayDRM from hardware that is located "/dev/dri/card0"

step 2. initialize & run H.264 encoder.

step 3. call vaTerminate and close the fd when quit process.

step 4. sleep 10 secs, and repeat step 1.

---------

In my test, i conclude that calling vaTerminate needs some time to quit completely, which still don't understand why. because of another test.

here's another test and the clue that vaTerminate afftects other processes.

---------

step 1. initialize with vaInitialize, right after getting a handler by vaGetDisplayDRM from hardware that is located "/dev/dri/card0"

step 2. initialize & run H.264 encoder.

step 3. right after step 2, initialize "another process" with vaInitialize, right after getting a handler by vaGetDisplayDRM from hardware that is located "/dev/dri/card0"

step 4. quit the first process that is started at step 1.

step 5. second process is just stopped right after step 4 and paused in MFX_WRN_DEVICE_BUSY status permantly.

---------

I think it should work well in multiple processes, but it doesn't and still confuse. what should i do?

any information would be very appreciated.

 

 

Best regards

0 Kudos
4 Replies
Surbhi_M_Intel
Employee
462 Views

Hi Lee,

Thanks for sending the detailed explanation of the issue. Like you have pointed this issue arises when you are doing multi process or doesn't give your function enough time to close properly. It is highly recommended to install the kernel-mode driver changes. It is possible to see such issues, if the necessary kernel patches are not applied. 
Is it possible for you to reproduce this issue with one of our existing sample or tutorials? You can look into sample_multi_transcode where multiple transcode process can be done. This will help us to debug the issue.  If not, then please send a reproducer with the instructions how to run it. 

Thanks,
-Surbhi

0 Kudos
Lee_g_
Beginner
462 Views

--

0 Kudos
Lee_g_
Beginner
462 Views

solved. after installing custom kernel, it works without any errors over couple of hours.

0 Kudos
Surbhi_M_Intel
Employee
462 Views

Great that you got it working!

-Surbhi

0 Kudos
Reply