fix: skip ggml_backend_load_all when use_gpu=0 in whisper filter#207
Closed
dymoo wants to merge 1 commit intoseydx:mainfrom
Closed
fix: skip ggml_backend_load_all when use_gpu=0 in whisper filter#207dymoo wants to merge 1 commit intoseydx:mainfrom
dymoo wants to merge 1 commit intoseydx:mainfrom
Conversation
Update jellyfin-ffmpeg submodule to include the fix in af_whisper.c that skips ggml_backend_load_all() when use_gpu=0, preventing segfaults on CPU-only containers where Vulkan/OpenCL initialization crashes.
Owner
|
Already merged upstream in seydx/jellyfin-ffmpeg and submodule updated. Closing. |
Owner
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The FFmpeg whisper filter (
af_whisper.cin the jellyfin-ffmpeg submodule) unconditionally callsggml_backend_load_all()during initialization, which triggers Vulkan and OpenCL backend registration. On CPU-only systems (e.g. Docker containers without GPU hardware or ICD drivers), this causes a segfault when:ggml_backend_vk_reg()→ggml_vk_instance_init()→vk::createInstance()/vk::enumeratePhysicalDevices()crashesThis means
WhisperTranscriber.create({ useGpu: false })still crashes on CPU-only containers, becauseggml_backend_load_all()runs before theuse_gpuparameter is consulted by whisper.cpp.Fix
Update the jellyfin-ffmpeg submodule to include seydx/jellyfin-ffmpeg#1, which conditions
ggml_backend_load_all()onuse_gpu:use_gpu=0: Skipggml_backend_load_all(). Only the CPU backend is needed (always available viaGGML_USE_CPU). No GPU device enumeration occurs.use_gpu=1: Load all backends as before (preserving existing behavior).Why this works
ggml_backend_registry(inggml-backend-reg.cpp) uses C++11 function-local static initialization, making it lazy — it's only constructed on first call toget_reg(). Sinceggml_backend_load_all()is the caller, skipping it means:ggml_backend_vk_reg()never gets calledThe CPU backend is independently available via static linking and doesn't need
ggml_backend_load_all().Impact
use_gpu=0use_gpu=1(default)Testing
WhisperTranscriber.create({ useGpu: false })no longer crashesuse_gpu=0