Microsoft Speeds Up Mesa VA-API Video Acceleration For FFmpeg
A Microsoft engineer has landed an improvement to the Mesa Gallium3D Video Acceleration "VA" state tracker that can allow for faster video processing times and greater GPU utilization.
FFmpeg supports an "async_depth" option with the VA-API encoder to increase the maximum processing parallelism but depends upon the VA-API driver supporting the vaSyncBuffer function. Sil Vilerino of Microsoft has wired up the vaSyncBuffer support to Gallium3D's VA front-end. In turn supporting this vaSyncBuffer functionality can mean a nice speed-up for performance and better GPU utilization due to the increased parallelism.
While this merge request adds the support to Gallium3D VA, it also requires the individual drivers supporting the new capability (PIPE_VIDEO_CAP_ENC_SUPPORTS_ASYNC_OPERATION). With the Microsoft merge request, only their Direct3D 12 Mesa driver is supporting this cap. So no other drivers will benefit now until being updated to expose the support too. But when wired up, the results are looking good with this change:
It was just last week as well that Microsoft added HEVC encode/decode to their Mesa driver for use with VA-API. These latest Microsoft-led changes will be part of the Q4 release, Mesa 22.3.
FFmpeg supports an "async_depth" option with the VA-API encoder to increase the maximum processing parallelism but depends upon the VA-API driver supporting the vaSyncBuffer function. Sil Vilerino of Microsoft has wired up the vaSyncBuffer support to Gallium3D's VA front-end. In turn supporting this vaSyncBuffer functionality can mean a nice speed-up for performance and better GPU utilization due to the increased parallelism.
While this merge request adds the support to Gallium3D VA, it also requires the individual drivers supporting the new capability (PIPE_VIDEO_CAP_ENC_SUPPORTS_ASYNC_OPERATION). With the Microsoft merge request, only their Direct3D 12 Mesa driver is supporting this cap. So no other drivers will benefit now until being updated to expose the support too. But when wired up, the results are looking good with this change:
Quick testing on a couple video clips with the d3d12 driver show 66% more relative GPU utilization and 30% to 50% faster times when FFmpeg detects async support.
It was just last week as well that Microsoft added HEVC encode/decode to their Mesa driver for use with VA-API. These latest Microsoft-led changes will be part of the Q4 release, Mesa 22.3.
32 Comments