mpv-player/mpv

Video artifacting + MPV crashes itself and GPU driver when seeking

JohhanSam opened this issue · 9 comments

mpv Information

mpv 0.39.0 Copyright © 2000-2024 mpv/MPlayer/mplayer2 projects
built on Sep 28 2024 01:31:20
libplacebo version: v7.349.0 (v7.349.0-13-ga018ab0-dirty)
FFmpeg version: N-117212-g01c47dd23
FFmpeg library versions:
libavcodec      61.20.100
libavdevice     61.4.100
libavfilter     10.5.100
libavformat     61.8.100
libavutil       59.40.100
libswresample   5.4.100
libswscale      8.4.100

Other Information

- Windows version: 11 23H2
- GPU model, driver and version: Vega 8 - adrenalin 23.11.1
- Source of mpv: shinchiro
- Latest known working version: x
- Issue started after the following happened: x

Reproduction Steps

Play the video with hwdec enabled:

  • Video will start full of artifacts, fixes itself after keyframe/scene change
  • When doing multiple seeks it crashes the MPV and GPU driver

Something important to note is that it only happens with files that came from the same source as the one in sample files. Other videos work no problem.

Expected Behavior

Disable hwdec if not working properly to not crash

Actual Behavior

Artifacts
Seeking crashes MPV and GPU driver

Log File

logforhwdec.txt

Sample Files

https://drive.google.com/file/d/1tJ-3c-WdNyIcddAgL4fZ2lcUymQdVtza/view?usp=sharing

I carefully read all instruction and confirm that I did the following:

  • I tested with the latest mpv version to validate that the issue is not already fixed.
  • I provided all required information including system and mpv version.
  • I produced the log file with the exact same set of files, parameters, and conditions used in "Reproduction Steps", with the addition of --log-file=output.txt.
  • I produced the log file while the behaviors described in "Actual Behavior" were actively observed.
  • I attached the full, untruncated log file.
  • I attached the backtrace in the case of a crash.
llyyr commented

[ 10.607][e][vo/gpu/d3d11] Failed to create SRV: The GPU device instance has been suspended. Use GetDeviceRemovedReason to determine the appropriate action. (0x887a0005)

Does it also happen with vo=gpu-next?

[ 10.607][e][vo/gpu/d3d11] Failed to create SRV: The GPU device instance has been suspended. Use GetDeviceRemovedReason to determine the appropriate action. (0x887a0005)

Does it also happen with vo=gpu-next?
log-next.txt

It does. Log for gpu-next: log-next.txt

llyyr commented

[ 28.251][e][vo/gpu-next/libplacebo] Device lost!

[ 28.251][e][vo/gpu-next/libplacebo] ID3D11Device_CreateShaderResourceView(p->dev, tex_p->res, &srvdesc, &tex_p->srv): The GPU will not respond to more commands, most likely because of an invalid command passed by the calling application. (DXGI_ERROR_DEVICE_HUNG, 0x887a0006) (../../../../../src_packages/libplacebo/src/d3d11/gpu_tex.c:73)

Most likely an issue with the driver, report to amd.

Does --hwdec=auto-copy also crashes? It's likely your hardware decoder / driver is crashing during decoding of this file, we cannot really do much about it. The d3d11va decoder is pretty much stable in ffmpeg, so I doubt there is any issue there. Also try finding newer GPU driver adrenalin 23.11.1 is last year, unless you meant 24... in which case did it work with previous drivers? Vega 8 is pretty old, so probably not well tested anymore.

Does --hwdec=auto-copy also crashes? It's likely your hardware decoder / driver is crashing during decoding of this file, we cannot really do much about it. The d3d11va decoder is pretty much stable in ffmpeg, so I doubt there is any issue there. Also try finding newer GPU driver adrenalin 23.11.1 is last year, unless you meant 24... in which case did it work with previous drivers? Vega 8 is pretty old, so probably not well tested anymore.

I did try copy-back, same result sadly. As for the drivers, currently testing every version top to bottom. (still no working one sadly)
Reported to AMD using the newest one.

Vulkan works normally, will test OpenGL bit later.

Actually I can also reproduce the artifacting issue.

Jules-A commented

On my 6700XT I have issue with that file even without using HWDec... No artifacts but it has issues seeking, causing the video to keep repeating the same frames instead over and over instead of going to the correct position and the MPV OSD gets stuck and doesn't move. It also causes ~60% CPU usage on my 5700X which is pretty crazy. It also can't seek to 0.

Media info reports this: Frame rate : 1 151.189 FPS What on earth???

Media info reports this: Frame rate : 1 151.189 FPS What on earth???

The clip was made with just ffmpegs copy and -ss -t, now that you mentioned it, I did a few tests, and when cutting different times, it always produces different framerate value for the source I'm using, always around 2x+ in FPS value reported by mediainfo. Started uploading the full source file, will take a bit. (50mins)

Also just in case gonna mention that all the issues ive mentioned happen on both the clip and full source.

Full source here: source