-
-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Vulkan Decoder crashes on Windows #239
Comments
Does this also happen with 720p? Note there is a bug in libplacebo that makes 1080p render incorrectly (padding at bottom) and 10bit (hdr) as full green (it's patched in Linux builds, but not Windows). |
I've tried Vulkan with H265 (HDR), H265, H264 at 720p and all crash. As mentioned on my PR for adding CUDA and QSV (#238), using I've tested with d3d11va and that appears to work fine at 1080p or 720p using H265 or H264 as well. |
Just to note, I've also gone back and tried vulkan on a Chiaki build based on the upstream 2.2.0 and it also crashes there. |
Seems like nvidia driver bug then. |
This might be the case. I spun up a debug build of chiaki4deck and reproduced the crash, seems to be a segmentation fault in avcodec-60.dll. Interestingly Vulkan GPU decoding does work when using ffmpeg 6.1 direclty or the latest mpv-git Windows build. |
Please post backtrace, with ffmpeg debug build. If it crashes in avcodec then it also may be ffmpeg bug. |
Maybe related to this https://trac.ffmpeg.org/ticket/9171 ... also vulkan decoding seems to work fine on my amd gpu using Windows so maybe specific to nvidia |
I had thought that might have been related, as a similar thing was previously reported for mpv when I was looking for segmentation faults on Windows with ffmpeg. Interestingly again, using filters in mpv doesn't cause a crash, however the filters don't actually work, so I imagine they may be handling the crash or filters in some fallback. However others have reported it working as intended on the latest NVIDIA drivers. Finally got a debug build of ffmpeg n6.1.1 that matches the build that is currently in MSYS2 (MINGW64) and built chiaki4deck with it. Settings are the same as my initial post. Once again I've tried various combinations of resolution, FPS and video codec and all crash when using the vulkan decoder. I've confirmed this debug build of mine actually works using d3d11va as well just in case that might have caused a problem. I've noticed this crash can take a couple code paths, but it always triggers when In all cases I've tested Here's a backtrace for 1080p, 60fps, H265:
|
There are no filters used in chiaki. The backtrace doesn't look right, anything above |
I did think myself that was a little weird, but I am very out of my depth with some of this stuff so I'm learning as I go here. I've managed to get what looks like a much more believable stacktrace:
|
This looks good now, thanks. |
I can't reproduce even if I force use of layered dpb. Can you please try this ffmpeg patch: diff --git a/libavutil/vulkan.c b/libavutil/vulkan.c
index bf8456b..2c9ff96 100644
--- a/libavutil/vulkan.c
+++ b/libavutil/vulkan.c
@@ -607,6 +607,9 @@ int ff_vk_exec_add_dep_frame(FFVulkanContext *s, FFVkExecContext *e, AVFrame *f,
uint32_t *queue_family_dst;
VkAccessFlagBits *access_dst;
+ if (!f || !f->hw_frames_ctx)
+ return 1;
+
AVHWFramesContext *hwfc = (AVHWFramesContext *)f->hw_frames_ctx->data;
AVVulkanFramesContext *vkfc = hwfc->hwctx;
AVVkFrame *vkf = (AVVkFrame *)f->data[0]; |
Applied that patch, recompiled and yup, seems to be working fine my testing so far. I'm not noticing any hitching, stuttering or any artifacting. And I can confirm it does seem to be using my GPU successfully too. |
Thanks, please open ffmpeg bug report with the backtrace. |
Just a heads up I made the ticket upstream a couple days ago: https://trac.ffmpeg.org/ticket/10847 |
Original patch for fixing nvidia vulkan decoding: streetpea/chiaki-ng#239 (comment) References ---------- [1] https://trac.ffmpeg.org/ticket/10847 [2] https://trac.ffmpeg.org/ticket/10970
Original patch for fixing nvidia vulkan decoding: streetpea/chiaki-ng#239 (comment) References ---------- [1] https://trac.ffmpeg.org/ticket/10847 [2] https://trac.ffmpeg.org/ticket/10970
Original patch for fixing nvidia vulkan decoding: streetpea/chiaki-ng#239 (comment) References ---------- [1] https://trac.ffmpeg.org/ticket/10847 [2] https://trac.ffmpeg.org/ticket/10970 [3] https://trac.ffmpeg.org/ticket/10876 [4] https://git.ffmpeg.org/gitweb/ffmpeg.git/commit/eb7d019b326b0c34e07f2369f31e8ba266fa666b
Original patch for fixing nvidia vulkan decoding: streetpea/chiaki-ng#239 (comment) References ---------- [1] https://trac.ffmpeg.org/ticket/10847 [2] https://trac.ffmpeg.org/ticket/10970
Describe the bug
When selecting
vulkan
as the decoder, the stream begins, however crashes shortly after starting.A brief flash of the stream starts, and my system hitches and freezes for a brief moment, no audio appears to play in this time before the crash.
I'm connecting to a standard PS5 using the following stream settings:
Debug Log
Please attach a log with verbose logging enabled.
chiaki_session_2024-01-31_19-35-21-223223.log
This log is trimmed a bit to remove the session handshake.
Seems to crash after the first libplacebo pass from what I can tell, however not entirely familiar with how libplacebo actually works.
To Reproduce
Set the decoder to
vulkan
on Windows 11.This may be specific to NVIDIA GPUs, however I'm unsure as I don't have access to a AMD or Intel dedicated GPU to test this.
Expected behavior
No crash, or the option to no select Vulkan on Windows if it does not work entirely on any dedicated GPU.
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: