[FFmpeg-devel] [PATCH] qsv: Update ffmpeg qsv_errors to recognize GPU hang

Xiang, Haihao haihao.xiang at intel.com
Mon Jul 25 04:21:41 EEST 2022


On Fri, 2022-07-22 at 11:06 -0700, Dmitry Rogozhkin wrote:
> GPU hang is one of the most typical errors on Intel GPUs in
> case something goes wrong. It's important to recognize it
> explicitly for easier bugs triage. Also, this error code
> can be used to trigger GPU recovery path in self-written
> applications.
> 
> Signed-off-by: Hon Wai Chow <hon.wai.chow at intel.com>
> Signed-off-by: Dmitry Rogozhkin <dmitry.v.rogozhkin at intel.com>
> ---
>  libavcodec/qsv.c     | 1 +
>  libavfilter/qsvvpp.c | 1 +
>  2 files changed, 2 insertions(+)
> 
> diff --git a/libavcodec/qsv.c b/libavcodec/qsv.c
> index 385b43b..55bcb6e 100644
> --- a/libavcodec/qsv.c
> +++ b/libavcodec/qsv.c
> @@ -125,6 +125,7 @@ static const struct {
>      { MFX_ERR_INVALID_VIDEO_PARAM,      AVERROR(EINVAL), "invalid video
> parameters"             },
>      { MFX_ERR_UNDEFINED_BEHAVIOR,       AVERROR_BUG,     "undefined
> behavior"                   },
>      { MFX_ERR_DEVICE_FAILED,            AVERROR(EIO),    "device
> failed"                        },
> +    { MFX_ERR_GPU_HANG,                 AVERROR(EIO),    "GPU
> Hang"                             },
>      { MFX_ERR_INCOMPATIBLE_AUDIO_PARAM, AVERROR(EINVAL), "incompatible audio
> parameters"        },
>      { MFX_ERR_INVALID_AUDIO_PARAM,      AVERROR(EINVAL), "invalid audio
> parameters"             },
>  
> diff --git a/libavfilter/qsvvpp.c b/libavfilter/qsvvpp.c
> index 954f882..7504906 100644
> --- a/libavfilter/qsvvpp.c
> +++ b/libavfilter/qsvvpp.c
> @@ -100,6 +100,7 @@ static const struct {
>      { MFX_ERR_INVALID_VIDEO_PARAM,      AVERROR(EINVAL), "invalid video
> parameters"             },
>      { MFX_ERR_UNDEFINED_BEHAVIOR,       AVERROR_BUG,     "undefined
> behavior"                   },
>      { MFX_ERR_DEVICE_FAILED,            AVERROR(EIO),    "device
> failed"                        },
> +    { MFX_ERR_GPU_HANG,                 AVERROR(EIO),    "GPU
> Hang"                             },
>      { MFX_ERR_INCOMPATIBLE_AUDIO_PARAM, AVERROR(EINVAL), "incompatible audio
> parameters"        },
>      { MFX_ERR_INVALID_AUDIO_PARAM,      AVERROR(EINVAL), "invalid audio
> parameters"             },
>  

Could you add other missing qsv video errors or warnings too ?

Thanks
Haihao




More information about the ffmpeg-devel mailing list