diff mbox series

[FFmpeg-devel] qsv: Update ffmpeg qsv_errors to recognize GPU hang and other statuses

Message ID 1659021568-5787-1-git-send-email-dmitry.v.rogozhkin@intel.com
State Accepted
Commit e0691eab2290952e1b63a8e0ac97940d65f3ca67
Headers show
Series [FFmpeg-devel] qsv: Update ffmpeg qsv_errors to recognize GPU hang and other statuses | expand

Commit Message

Dmitry Rogozhkin July 28, 2022, 3:19 p.m. UTC
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.

There were 2 other statuses which MediaSDK can ppotentially return,
MFX_ERR_NONE_PARTIAL_OUTPUT and MFX_ERR_REALLOC_SURFACE. Adding
them as well.

v2: move MFX_ERR_NONE_PARTIAL_OUTPUT next to MFX_WRN_* (Haihao)

Signed-off-by: Hon Wai Chow <hon.wai.chow@intel.com>
Signed-off-by: Dmitry Rogozhkin <dmitry.v.rogozhkin@intel.com>
---
 libavcodec/qsv.c     | 6 ++++++
 libavfilter/qsvvpp.c | 6 ++++++
 2 files changed, 12 insertions(+)

Comments

Xiang, Haihao July 29, 2022, 5:03 a.m. UTC | #1
On Thu, 2022-07-28 at 08:19 -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.
> 
> There were 2 other statuses which MediaSDK can ppotentially return,
> MFX_ERR_NONE_PARTIAL_OUTPUT and MFX_ERR_REALLOC_SURFACE. Adding
> them as well.
> 
> v2: move MFX_ERR_NONE_PARTIAL_OUTPUT next to MFX_WRN_* (Haihao)
> 
> Signed-off-by: Hon Wai Chow <hon.wai.chow@intel.com>
> Signed-off-by: Dmitry Rogozhkin <dmitry.v.rogozhkin@intel.com>
> ---
>  libavcodec/qsv.c     | 6 ++++++
>  libavfilter/qsvvpp.c | 6 ++++++
>  2 files changed, 12 insertions(+)
> 
> diff --git a/libavcodec/qsv.c b/libavcodec/qsv.c
> index 385b43b..d660920 100644
> --- a/libavcodec/qsv.c
> +++ b/libavcodec/qsv.c
> @@ -125,6 +125,8 @@ 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_REALLOC_SURFACE,          AVERROR_UNKNOWN, "need bigger surface
> for output"       },
>      { MFX_ERR_INCOMPATIBLE_AUDIO_PARAM, AVERROR(EINVAL), "incompatible audio
> parameters"        },
>      { MFX_ERR_INVALID_AUDIO_PARAM,      AVERROR(EINVAL), "invalid audio
> parameters"             },
>  
> @@ -137,6 +139,10 @@ static const struct {
>      { MFX_WRN_OUT_OF_RANGE,             0,               "value out of
> range"                   },
>      { MFX_WRN_FILTER_SKIPPED,           0,               "filter
> skipped"                       },
>      { MFX_WRN_INCOMPATIBLE_AUDIO_PARAM, 0,               "incompatible audio
> parameters"        },
> +
> +#if QSV_VERSION_ATLEAST(1, 31)
> +    { MFX_ERR_NONE_PARTIAL_OUTPUT,      0,               "partial
> output"                       },
> +#endif
>  };
>  
>  /**
> diff --git a/libavfilter/qsvvpp.c b/libavfilter/qsvvpp.c
> index 954f882..16d6163 100644
> --- a/libavfilter/qsvvpp.c
> +++ b/libavfilter/qsvvpp.c
> @@ -100,6 +100,8 @@ 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_REALLOC_SURFACE,          AVERROR_UNKNOWN, "need bigger surface
> for output"       },
>      { MFX_ERR_INCOMPATIBLE_AUDIO_PARAM, AVERROR(EINVAL), "incompatible audio
> parameters"        },
>      { MFX_ERR_INVALID_AUDIO_PARAM,      AVERROR(EINVAL), "invalid audio
> parameters"             },
>  
> @@ -112,6 +114,10 @@ static const struct {
>      { MFX_WRN_OUT_OF_RANGE,             0,               "value out of
> range"                   },
>      { MFX_WRN_FILTER_SKIPPED,           0,               "filter
> skipped"                       },
>      { MFX_WRN_INCOMPATIBLE_AUDIO_PARAM, 0,               "incompatible audio
> parameters"        },
> +
> +#if QSV_VERSION_ATLEAST(1, 31)
> +    { MFX_ERR_NONE_PARTIAL_OUTPUT,      0,               "partial
> output"                       },
> +#endif
>  };
>  
>  static int qsv_map_error(mfxStatus mfx_err, const char **desc)

Applied, thx

-Haihao
diff mbox series

Patch

diff --git a/libavcodec/qsv.c b/libavcodec/qsv.c
index 385b43b..d660920 100644
--- a/libavcodec/qsv.c
+++ b/libavcodec/qsv.c
@@ -125,6 +125,8 @@  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_REALLOC_SURFACE,          AVERROR_UNKNOWN, "need bigger surface for output"       },
     { MFX_ERR_INCOMPATIBLE_AUDIO_PARAM, AVERROR(EINVAL), "incompatible audio parameters"        },
     { MFX_ERR_INVALID_AUDIO_PARAM,      AVERROR(EINVAL), "invalid audio parameters"             },
 
@@ -137,6 +139,10 @@  static const struct {
     { MFX_WRN_OUT_OF_RANGE,             0,               "value out of range"                   },
     { MFX_WRN_FILTER_SKIPPED,           0,               "filter skipped"                       },
     { MFX_WRN_INCOMPATIBLE_AUDIO_PARAM, 0,               "incompatible audio parameters"        },
+
+#if QSV_VERSION_ATLEAST(1, 31)
+    { MFX_ERR_NONE_PARTIAL_OUTPUT,      0,               "partial output"                       },
+#endif
 };
 
 /**
diff --git a/libavfilter/qsvvpp.c b/libavfilter/qsvvpp.c
index 954f882..16d6163 100644
--- a/libavfilter/qsvvpp.c
+++ b/libavfilter/qsvvpp.c
@@ -100,6 +100,8 @@  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_REALLOC_SURFACE,          AVERROR_UNKNOWN, "need bigger surface for output"       },
     { MFX_ERR_INCOMPATIBLE_AUDIO_PARAM, AVERROR(EINVAL), "incompatible audio parameters"        },
     { MFX_ERR_INVALID_AUDIO_PARAM,      AVERROR(EINVAL), "invalid audio parameters"             },
 
@@ -112,6 +114,10 @@  static const struct {
     { MFX_WRN_OUT_OF_RANGE,             0,               "value out of range"                   },
     { MFX_WRN_FILTER_SKIPPED,           0,               "filter skipped"                       },
     { MFX_WRN_INCOMPATIBLE_AUDIO_PARAM, 0,               "incompatible audio parameters"        },
+
+#if QSV_VERSION_ATLEAST(1, 31)
+    { MFX_ERR_NONE_PARTIAL_OUTPUT,      0,               "partial output"                       },
+#endif
 };
 
 static int qsv_map_error(mfxStatus mfx_err, const char **desc)