diff --git a/.devops/nix/package.nix b/.devops/nix/package.nix index f93b25b24..2d64a6808 100644 --- a/.devops/nix/package.nix +++ b/.devops/nix/package.nix @@ -156,6 +156,8 @@ effectiveStdenv.mkDerivation ( postPatch = '' substituteInPlace ./ggml-metal.m \ --replace '[bundle pathForResource:@"ggml-metal" ofType:@"metal"];' "@\"$out/bin/ggml-metal.metal\";" + substituteInPlace ./ggml-metal.m \ + --replace '[bundle pathForResource:@"default" ofType:@"metallib"];' "@\"$out/bin/default.metallib\";" # TODO: Package up each Python script or service appropriately. # If we were to migrate to buildPythonPackage and prepare the `pyproject.toml`, diff --git a/CMakeLists.txt b/CMakeLists.txt index b25cfd2fc..d101d3a58 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1260,6 +1260,12 @@ if (LLAMA_METAL) GROUP_READ WORLD_READ DESTINATION ${CMAKE_INSTALL_BINDIR}) + if (NOT LLAMA_METAL_EMBED_LIBRARY) + install( + FILES ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/default.metallib + DESTINATION ${CMAKE_INSTALL_BINDIR} + ) + endif() endif() #