intel / intel-vaapi-driver

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

HW VP9 encode GPU HANG on i915/RKL - Resetting vcs0 for preemption time out - GPU HANG: ecode 12:4:28ffff7d, in ffmpeg #539

Open ajgnet opened 2 years ago

ajgnet commented 2 years ago

Unable to HW encode VP9 on Rocket Lake i7-11700K. Tried various kernels, applications, intel-vaapi-driver versions.

ffmpeg -vaapi_device /dev/dri/renderD128 -hwaccel vaapi -hwaccel_output_format vaapi -I "input.mp4" -c:v vp9_vaapi output.mp4
[vp9_vaapi @ 0x5568da8db800] Failed to map output buffers: 24 (internal encoding error).=1.32x
[vp9_vaapi @ 0x5568da8db800] Output failed: -5.
Video encoding failed
[aac @ 0x5568da925340] Qavg: 155.537
[aac @ 0x5568da925340] 2 frames left in the queue on closing
Conversion failed!

Encoding fails ~50% of the time with a GPU hang.

[ 3806.462671] i915 0000:00:02.0: [drm] Resetting vcs0 for preemption time out
[ 3806.462689] i915 0000:00:02.0: [drm] ffmpeg[1377] context reset due to GPU hang
[ 3806.463476] i915 0000:00:02.0: [drm] GPU HANG: ecode 12:4:28ffff7d, in ffmpeg [1377]

HEVC encoding works as expected

ffmpeg -vaapi_device /dev/dri/renderD128 -hwaccel vaapi -hwaccel_output_format vaapi -I "input.mp4" -c:v hevc_vaapi output.mp4

System info:

root@ajgsys012:~# uname -a
Linux ajgsys012 5.14.5-xanmod1-edge #0~git20210916.cfd723d SMP PREEMPT Thu Sep 16 21:16:08 UTC 2021 x86_64 GNU/Linux

root@ajgsys012:~# dpkg -l | grep ffmpeg
ii  ffmpeg                               7:4.4-5                                         amd64        Tools for transcoding, streaming and playing of multimedia files

root@ajgsys012:~# dpkg -l | grep libva
ii  libva-drm2:amd64                     2.12.0-2                                        amd64        Video Acceleration (VA) API for Linux -- DRM runtime
ii  libva-wayland2:amd64                 2.12.0-2                                        amd64        Video Acceleration (VA) API for Linux -- Wayland runtime
ii  libva-x11-2:amd64                    2.12.0-2                                        amd64        Video Acceleration (VA) API for Linux -- X11 runtime
ii  libva2:amd64                         2.12.0-2                                        amd64        Video Acceleration (VA) API for Linux -- runtime

root@ajgsys012:~# dpkg -l | grep intel-media
ii  intel-media-va-driver-non-free:amd64 21.3.3+ds1-1                                    amd64        VAAPI driver for the Intel GEN8+ Graphics family
ajgnet commented 2 years ago

Just a quick update to the above bug, this appears to only occur with videos longer than 10 seconds in length when converting to VP9 only. Perhaps it is a memory bug of some kind. Happy to provide any more details as requested that may be helpful.

dalcombright commented 2 years ago

Just a quick update to the above bug, this appears to only occur with videos longer than 10 seconds in length when converting to VP9 only. Perhaps it is a memory bug of some kind. Happy to provide any more details as requested that may be helpful.

any luck? I am seeing the same thing using unmanic on unraid. Nothing will convert.

ajgnet commented 2 years ago

any luck? I am seeing the same thing using unmanic on unraid. Nothing will convert.

Sadly no. We dropped the processor and went with Alder Lake where everything works as expected.

edwarddavidbaker commented 2 years ago

I'm not sure which Linux distribution you are using, but you will want to discuss Rocket Lake at https://github.com/intel/media-driver . Also for VP9 encode it might be important to double check loading microcontroller firmware GuC and HuC.