Commit 11a096e9 authored by Tim Quelch's avatar Tim Quelch
Browse files

whisper-cpp: Ensure that backend dir is set

If this field is not set, then the backend search path consists of the
executable directory, and the current working directory. This works fine
for executables that are bundled with whisper-cpp, but fails for
anything that links against the library, e.g. ffmpeg.

If there are no backends available other than CPU, this causes a crash.

Implementation of the search path behaviour is here https://github.com/ggml-org/whisper.cpp/blob/d9b7613b34a343848af572cc14467fc5e82fc788/ggml/src/ggml-backend-reg.cpp#L522-L531
parent 53005e41
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -125,6 +125,7 @@ effectiveStdenv.mkDerivation (finalAttrs: {
  ++ optionals (effectiveStdenv.hostPlatform.isx86 && !effectiveStdenv.hostPlatform.isStatic) [
    (cmakeBool "GGML_BACKEND_DL" true)
    (cmakeBool "GGML_CPU_ALL_VARIANTS" true)
    (cmakeFeature "GGML_BACKEND_DIR" "${placeholder "out"}/lib")
  ]
  ++ optionals cudaSupport [
    (cmakeFeature "CMAKE_CUDA_ARCHITECTURES" cudaPackages.flags.cmakeCudaArchitecturesString)