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.

Unlimited multi GPU support in transcoding

zsc_IM
Novice
996 Views

Hello,

we plan to build a server with 6/8/more GPUs. If we specify "qsv_device 4" in ffmpeg, an error will be reported:

Error creating a MFX session: -9.
Device creation failed: -1313558101.
Failed to set value '4' for option 'qsv_device': Unknown error occurred
Error parsing global options: Unknown error occurred

 

We think this is due not to ffmpeg but to intel. We've found a problem when I checked through oneVPL SDK, it might not support 5 GPUs or more, as it defines up to 4th device only.

https://spec.oneapi.io/onevpl/latest/API_ref/VPL_enums.html#mfximplhttps://spec.oneapi.io/onevpl/latest/API_ref/VPL_enums.html#mfximpl

 

enum {
MFX_IMPL_AUTO = 0x0000, /*!< Auto Selection/In or Not Supported/Out. */
MFX_IMPL_SOFTWARE = 0x0001, /*!< Pure software implementation. */
MFX_IMPL_HARDWARE = 0x0002, /*!< Hardware accelerated implementation (default device). */
MFX_IMPL_AUTO_ANY = 0x0003, /*!< Auto selection of any hardware/software implementation. */
MFX_IMPL_HARDWARE_ANY = 0x0004, /*!< Auto selection of any hardware implementation. */
MFX_IMPL_HARDWARE2 = 0x0005, /*!< Hardware accelerated implementation (2nd device). */
MFX_IMPL_HARDWARE3 = 0x0006, /*!< Hardware accelerated implementation (3rd device). */
MFX_IMPL_HARDWARE4 = 0x0007, /*!< Hardware accelerated implementation (4th device). */
MFX_IMPL_RUNTIME = 0x0008, /*!< This value cannot be used for session initialization. It may be returned by the MFXQueryIMPL
function to show that the session has been initialized in run-time mode. */
MFX_IMPL_VIA_ANY = 0x0100, /*!< Hardware acceleration can go through any supported OS infrastructure. This is the default value. The default value
is used by the legacy Intel(r) Media SDK if none of the MFX_IMPL_VIA_xxx flags are specified by the application. */
MFX_IMPL_VIA_D3D9 = 0x0200, /*!< Hardware acceleration goes through the Microsoft* Direct3D* 9 infrastructure. */
MFX_IMPL_VIA_D3D11 = 0x0300, /*!< Hardware acceleration goes through the Microsoft* Direct3D* 11 infrastructure. */
MFX_IMPL_VIA_VAAPI = 0x0400, /*!< Hardware acceleration goes through the Linux* VA-API infrastructure. */
MFX_IMPL_VIA_HDDLUNITE = 0x0500, /*!< Hardware acceleration goes through the HDDL* Unite*. */

MFX_IMPL_UNSUPPORTED = 0x0000 /*!< One of the MFXQueryIMPL returns. */
};

 

I would like to know what considerations led to the implementation of this limitation.Will you plan to add unlimited multi GPU support in transcoding in the future.

0 Kudos
1 Solution
AthiraM_Intel
Moderator
954 Views

Hi,


From the given information it looks like you are using 1.x API. We recommend you to use 2.x API for better usability. For the 2.x APIs it is recommended to use MFXEnumImplementations() and MFXSetConfigFilterProperty() to query adapter capabilities and select a suitable adapter from the available hardware adapters as MFXQueryAdapters()* are deprecated starting from API 2.9. You can see the hello-createsession code example that shows the usage of these APIS. One of the major advantages of using 2. x APIs is that VPL runtime can allocate the video memory surfaces itself instead of the application doing so ("Internal Memory Management") and can also create the DX/VAAPI device internally instead of the app doing so and then calling SetHandle. More information can be found on this page. Example code for selecting from among multiple GPUs is included in the guide here .


Hope this helps. If you have any further issue, please let us know.



Thanks


View solution in original post

0 Kudos
6 Replies
AthiraM_Intel
Moderator
972 Views

Hi,


Thank you for posting in Intel Communities.


Thanks for letting us know. We have informed the concerned team regarding this and will get back to you soon with an update.



Thanks


0 Kudos
AthiraM_Intel
Moderator
955 Views

Hi,


From the given information it looks like you are using 1.x API. We recommend you to use 2.x API for better usability. For the 2.x APIs it is recommended to use MFXEnumImplementations() and MFXSetConfigFilterProperty() to query adapter capabilities and select a suitable adapter from the available hardware adapters as MFXQueryAdapters()* are deprecated starting from API 2.9. You can see the hello-createsession code example that shows the usage of these APIS. One of the major advantages of using 2. x APIs is that VPL runtime can allocate the video memory surfaces itself instead of the application doing so ("Internal Memory Management") and can also create the DX/VAAPI device internally instead of the app doing so and then calling SetHandle. More information can be found on this page. Example code for selecting from among multiple GPUs is included in the guide here .


Hope this helps. If you have any further issue, please let us know.



Thanks


0 Kudos
zsc_IM
Novice
935 Views
Thank you for your reply!
 
We noticed that in the previous news, oneVPL can be enabled in ffmpeg by specifying --enable-libvpl at compile time. However, several public ffmpeg builds we found still cannot specify qsv_device >=4. Maybe we should compile ffmpeg ourselves, although we don't have the relevant technology at present.
 
Thank you for your technical support!
0 Kudos
AthiraM_Intel
Moderator
897 Views

Hi,


Thanks for accepting our solution.


Here are some documentations on how to build and run FFmpeg with VPL:

https://github.com/intel/media-delivery

Hardware/QuickSync – FFmpeg


Could you please let us know whether we can close this case?



Thanks


0 Kudos
zsc_IM
Novice
883 Views

Hi,

 

Of course you can close this case.

 

Thanks!

0 Kudos
AthiraM_Intel
Moderator
874 Views

Hi,


Thanks for the confirmation. If you need any additional information, please post a new question as this thread will no longer be monitored by Intel.




Thanks


0 Kudos
Reply