Skip to content

Commit

Permalink
llama-cpp-python: fix darwin build when Metal device has no name
Browse files Browse the repository at this point in the history
  • Loading branch information
booxter committed Jan 27, 2025
1 parent 71fa28e commit 2fe5f59
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions pkgs/development/python-modules/llama-cpp-python/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
gcc13Stdenv,
buildPythonPackage,
fetchFromGitHub,
fetchpatch2,

# nativeBuildInputs
cmake,
Expand Down Expand Up @@ -51,6 +52,17 @@ buildPythonPackage rec {
};
# src = /home/gaetan/llama-cpp-python;

patches = [
# fix segfault when running tests due to missing default Metal device
# posted at: https://github.com/ggerganov/llama.cpp/pull/11441
(fetchpatch2 {
url = "https://github.com/ggerganov/llama.cpp/pull/11441/commits/77860f97db85f1796f04809aaffcda622d0cfff2.patch?full_index=1";
stripLen = 1;
extraPrefix = "vendor/llama.cpp/";
hash = "sha256-bI/shVj1DB8DF2TrnEsdvQd23aHDlkGkvesdexH2dKc=";
})
];

dontUseCmakeConfigure = true;
SKBUILD_CMAKE_ARGS = lib.strings.concatStringsSep ";" (
lib.optionals cudaSupport [
Expand Down

0 comments on commit 2fe5f59

Please sign in to comment.