diff mbox series

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

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

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Dmitry Rogozhkin July 25, 2022, 3:27 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.

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

Comments

Xiang, Haihao July 28, 2022, 6:24 a.m. UTC | #1
On Mon, 2022-07-25 at 08:27 -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.
> 
> Signed-off-by: Hon Wai Chow <hon.wai.chow@intel.com>
> Signed-off-by: Dmitry Rogozhkin <dmitry.v.rogozhkin@intel.com>
> ---
>  libavcodec/qsv.c     | 5 +++++
>  libavfilter/qsvvpp.c | 5 +++++
>  2 files changed, 10 insertions(+)
> 
> diff --git a/libavcodec/qsv.c b/libavcodec/qsv.c
> index 385b43b..70918b1 100644
> --- a/libavcodec/qsv.c
> +++ b/libavcodec/qsv.c
> @@ -105,6 +105,9 @@ static const struct {
>      const char *desc;
>  } qsv_errors[] = {
>      {
> MFX_ERR_NONE,                     0,               "success"                  
>             },
> +#if QSV_VERSION_ATLEAST(1, 31)
> +    { MFX_ERR_NONE_PARTIAL_OUTPUT,      0,               "partial 

MFX_ERR_NONE_PARTIAL_OUTPUT is 12 which is actually a warning defined in theSDK, could you move this to the end of warnings in this arrary ? 


> output"                       },
> +#endif
>      { MFX_ERR_UNKNOWN,                  AVERROR_UNKNOWN, "unknown
> error"                        },
>      { MFX_ERR_NULL_PTR,                 AVERROR(EINVAL), "NULL
> pointer"                         },
>      { MFX_ERR_UNSUPPORTED,              AVERROR(ENOSYS),
> "unsupported"                          },
> @@ -125,6 +128,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"             },
>  
> diff --git a/libavfilter/qsvvpp.c b/libavfilter/qsvvpp.c
> index 954f882..2f0613f 100644
> --- a/libavfilter/qsvvpp.c
> +++ b/libavfilter/qsvvpp.c
> @@ -80,6 +80,9 @@ static const struct {
>      const char *desc;
>  } qsv_errors[] = {
>      {
> MFX_ERR_NONE,                     0,               "success"                  
>             },
> +#if QSV_VERSION_ATLEAST(1, 31)
> +    { MFX_ERR_NONE_PARTIAL_OUTPUT,      0,               "partial 

Same as above.

Thanks
Haihao


> output"                       },
> +#endif
>      { MFX_ERR_UNKNOWN,                  AVERROR_UNKNOWN, "unknown
> error"                        },
>      { MFX_ERR_NULL_PTR,                 AVERROR(EINVAL), "NULL
> pointer"                         },
>      { MFX_ERR_UNSUPPORTED,              AVERROR(ENOSYS),
> "unsupported"                          },
> @@ -100,6 +103,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"             },
>
diff mbox series

Patch

diff --git a/libavcodec/qsv.c b/libavcodec/qsv.c
index 385b43b..70918b1 100644
--- a/libavcodec/qsv.c
+++ b/libavcodec/qsv.c
@@ -105,6 +105,9 @@  static const struct {
     const char *desc;
 } qsv_errors[] = {
     { MFX_ERR_NONE,                     0,               "success"                              },
+#if QSV_VERSION_ATLEAST(1, 31)
+    { MFX_ERR_NONE_PARTIAL_OUTPUT,      0,               "partial output"                       },
+#endif
     { MFX_ERR_UNKNOWN,                  AVERROR_UNKNOWN, "unknown error"                        },
     { MFX_ERR_NULL_PTR,                 AVERROR(EINVAL), "NULL pointer"                         },
     { MFX_ERR_UNSUPPORTED,              AVERROR(ENOSYS), "unsupported"                          },
@@ -125,6 +128,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"             },
 
diff --git a/libavfilter/qsvvpp.c b/libavfilter/qsvvpp.c
index 954f882..2f0613f 100644
--- a/libavfilter/qsvvpp.c
+++ b/libavfilter/qsvvpp.c
@@ -80,6 +80,9 @@  static const struct {
     const char *desc;
 } qsv_errors[] = {
     { MFX_ERR_NONE,                     0,               "success"                              },
+#if QSV_VERSION_ATLEAST(1, 31)
+    { MFX_ERR_NONE_PARTIAL_OUTPUT,      0,               "partial output"                       },
+#endif
     { MFX_ERR_UNKNOWN,                  AVERROR_UNKNOWN, "unknown error"                        },
     { MFX_ERR_NULL_PTR,                 AVERROR(EINVAL), "NULL pointer"                         },
     { MFX_ERR_UNSUPPORTED,              AVERROR(ENOSYS), "unsupported"                          },
@@ -100,6 +103,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"             },