intel / intel-vaapi-driver

VA-API user mode driver for Intel GEN Graphics family
https://01.org/linuxmedia
Other
308 stars 127 forks source link

GPU hang in decoding hevc video by using ffmpeg #264

Open hsyrja opened 7 years ago

hsyrja commented 7 years ago

GPU hang occurred when hw accelerated decoding is issued by ffmpeg and video codec is Hevc encoded.

ffmpeg command (decode only) ffmpeg -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format vaapi -I hang.vid -f null -

Tested in Skylake as wel Kabyake i7.

Here is the input video for reproduce the hang. hang.zip

Behaviour is random hang won't happen every time when it's happen it is always in ffmpeg start.

I don't know if this is intel-vaapi-driver issue or FFmpeg issue so I will file bug to both projects.

xhaihao commented 7 years ago
  1. I saw lots of error messages when using a tool to parse hang.vid
  2. I can't reproduce this issue with gstreamer-vaapi, it seems ffmpeg and gstreamer handle the element errors in different way so they pass different picture parameters and slice parameters to the driver. You may enable VA tracer by setting LIBVA_TRACE in your environment then check the tracer log.

e.g. in gstreamer

[48642.979908][ctx 0x02000000] pcm_sample_bit_depth_luma_minus1 = 0 [48642.979909][ctx 0x02000000] pcm_sample_bit_depth_chroma_minus1 = 0 ... [48642.979952][ctx 0x02000000] slice_parsing_fields = 15246

however in FFmpeg

[48794.782034][ctx 0x02000000] pcm_sample_bit_depth_luma_minus1 = 255 [48794.782034][ctx 0x02000000] pcm_sample_bit_depth_chroma_minus1 = 255 ... [48794.782054][ctx 0x02000000] slice_parsing_fields = 910

According to the tracer log, I think this is a FFmpeg specific issue.

  1. driver(HW) provides error handling, but it can't cover all of errors.
fhvwy commented 7 years ago

See notes on https://trac.ffmpeg.org/ticket/6642. Maybe something is going wrong around the broken link handling for the initial part of the stream? (The non-failure with gstreamer seems to come from throwing away everything up to the first IDR frame.)

hsyrja commented 7 years ago

This is how I’ve seen it behaving, always when the stream starts, when the source is live (could start any point of the stream) with a good luck it may start successfully and then it works fine as long as you want.

On 19 Sep 2017, at 15:50, Mark Thompson notifications@github.com wrote:

See notes on https://trac.ffmpeg.org/ticket/6642 https://trac.ffmpeg.org/ticket/6642. Maybe something is going wrong around the broken link handling for the initial part of the stream? (The non-failure with gstreamer seems to come from throwing away everything up to the first IDR frame.)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/01org/intel-vaapi-driver/issues/264#issuecomment-330528776, or mute the thread https://github.com/notifications/unsubscribe-auth/AGKiWwXQhI1rdPUbyVXqeRt9HDaE00e8ks5sj7ijgaJpZM4PPoU-.