about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJoseph Stahl <1269177+josephst@users.noreply.github.com>2024-03-26 13:48:11 -0400
committerJoseph Stahl <1269177+josephst@users.noreply.github.com>2024-03-26 14:01:29 -0400
commite1ef3aaaccb554da9c581d684e96071b2f8cea95 (patch)
treed147512d0af5b0ad24a5d14ef4e585c1a1c5e61b
parent7aa588cc962d5c2fb4cbcedd548f444621292cce (diff)
downloadnixlib-e1ef3aaaccb554da9c581d684e96071b2f8cea95.tar
nixlib-e1ef3aaaccb554da9c581d684e96071b2f8cea95.tar.gz
nixlib-e1ef3aaaccb554da9c581d684e96071b2f8cea95.tar.bz2
nixlib-e1ef3aaaccb554da9c581d684e96071b2f8cea95.tar.lz
nixlib-e1ef3aaaccb554da9c581d684e96071b2f8cea95.tar.xz
nixlib-e1ef3aaaccb554da9c581d684e96071b2f8cea95.tar.zst
nixlib-e1ef3aaaccb554da9c581d684e96071b2f8cea95.zip
llama-cpp: embed (don't pre-compile) metal shaders
port of https://github.com/ggerganov/llama.cpp/pull/6118, although compiling shaders with XCode disabled as it requires disabling sandbox (and only works on MacOS anyways)
-rw-r--r--pkgs/by-name/ll/llama-cpp/package.nix5
1 files changed, 4 insertions, 1 deletions
diff --git a/pkgs/by-name/ll/llama-cpp/package.nix b/pkgs/by-name/ll/llama-cpp/package.nix
index 928fbf6dfe27..ecd3167b9d93 100644
--- a/pkgs/by-name/ll/llama-cpp/package.nix
+++ b/pkgs/by-name/ll/llama-cpp/package.nix
@@ -131,7 +131,10 @@ effectiveStdenv.mkDerivation (finalAttrs: {
         # Should likely use `rocmPackages.clr.gpuTargets`.
         "-DAMDGPU_TARGETS=gfx803;gfx900;gfx906:xnack-;gfx908:xnack-;gfx90a:xnack+;gfx90a:xnack-;gfx940;gfx941;gfx942;gfx1010;gfx1012;gfx1030;gfx1100;gfx1101;gfx1102"
       ]
-      ++ optionals metalSupport [ (cmakeFeature "CMAKE_C_FLAGS" "-D__ARM_FEATURE_DOTPROD=1") ];
+      ++ optionals metalSupport [
+        (cmakeFeature "CMAKE_C_FLAGS" "-D__ARM_FEATURE_DOTPROD=1")
+        (cmakeBool "LLAMA_METAL_EMBED_LIBRARY" true)
+      ];
 
   # upstream plans on adding targets at the cmakelevel, remove those
   # additional steps after that