Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH] qsv: Update ffmpeg qsv_errors to recognize GPU hang and other statuses
@ 2022-07-28 15:19 Dmitry Rogozhkin
  2022-07-29  5:03 ` Xiang, Haihao
  0 siblings, 1 reply; 4+ messages in thread
From: Dmitry Rogozhkin @ 2022-07-28 15:19 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Hon Wai Chow, Dmitry Rogozhkin

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)
-- 
1.8.3.1

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [FFmpeg-devel] [PATCH] qsv: Update ffmpeg qsv_errors to recognize GPU hang and other statuses
  2022-07-28 15:19 [FFmpeg-devel] [PATCH] qsv: Update ffmpeg qsv_errors to recognize GPU hang and other statuses Dmitry Rogozhkin
@ 2022-07-29  5:03 ` Xiang, Haihao
  0 siblings, 0 replies; 4+ messages in thread
From: Xiang, Haihao @ 2022-07-29  5:03 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Chow, Hon Wai, Rogozhkin, Dmitry V

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

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [FFmpeg-devel] [PATCH] qsv: Update ffmpeg qsv_errors to recognize GPU hang and other statuses
  2022-07-25 15:27 Dmitry Rogozhkin
@ 2022-07-28  6:24 ` Xiang, Haihao
  0 siblings, 0 replies; 4+ messages in thread
From: Xiang, Haihao @ 2022-07-28  6:24 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Chow, Hon Wai, Rogozhkin, Dmitry V

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"             },
>  
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [FFmpeg-devel] [PATCH] qsv: Update ffmpeg qsv_errors to recognize GPU hang and other statuses
@ 2022-07-25 15:27 Dmitry Rogozhkin
  2022-07-28  6:24 ` Xiang, Haihao
  0 siblings, 1 reply; 4+ messages in thread
From: Dmitry Rogozhkin @ 2022-07-25 15:27 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Hon Wai Chow, Dmitry Rogozhkin

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 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"             },
 
-- 
1.8.3.1

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-07-29  5:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-28 15:19 [FFmpeg-devel] [PATCH] qsv: Update ffmpeg qsv_errors to recognize GPU hang and other statuses Dmitry Rogozhkin
2022-07-29  5:03 ` Xiang, Haihao
  -- strict thread matches above, loose matches on Subject: below --
2022-07-25 15:27 Dmitry Rogozhkin
2022-07-28  6:24 ` Xiang, Haihao

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git