ggerganov / llama.cpp

LLM inference in C/C++
MIT License
66.96k stars 9.62k forks source link

nix build fails on apple silicon #7009

Closed pusherofbrooms closed 6 months ago

pusherofbrooms commented 6 months ago

On an M1 macbook running 14.4.1 using nix (Nix) 2.18.2.

At commit a68a1e7ed060ee5af2d638585d19e3510ddbf16c , nix build . fails to build. The previous commit (the flash attention commit) 9c67c2773d4b706cf71d70ecf4aa180b62501960 builds fine.

The error from nix log which seems pertinent follows:

[6/153] Building C object CMakeFiles/ggml.dir/ggml-backend.c.o
[7/153] Building C object CMakeFiles/ggml.dir/ggml-metal.m.o
FAILED: CMakeFiles/ggml.dir/ggml-metal.m.o
/nix/store/v4p0piwwk3a9gwrhvxa8b04ljd1arviz-clang-wrapper-16.0.6/bin/clang -DACCELERATE_LAPACK_ILP64 -DACCE>
/tmp/nix-build-llama-cpp-metalkit-0.0.0.drv-0/source/ggml-metal.m:309:20: warning: variable 'bundle' set bu>
        NSBundle * bundle = nil;
                   ^
/tmp/nix-build-llama-cpp-metalkit-0.0.0.drv-0/source/ggml-metal.m:2806:26: error: use of undeclared identif>
                    case MTLCommandBufferErrorStackOverflow:
                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                         MTLCommandBufferErrorBlacklisted
/nix/store/wbs6y330c33m4aicw6r8jlhpcy80n4yq-apple-framework-Metal-11.0.0/Library/Frameworks/Metal.framework>
    MTLCommandBufferErrorBlacklisted = 4,
    ^
/tmp/nix-build-llama-cpp-metalkit-0.0.0.drv-0/source/ggml-metal.m:2809:26: error: use of undeclared identif>
                    case MTLCommandBufferErrorAccessRevoked:
                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                         MTLCommandBufferErrorDeviceRemoved
/nix/store/wbs6y330c33m4aicw6r8jlhpcy80n4yq-apple-framework-Metal-11.0.0/Library/Frameworks/Metal.framework>
    MTLCommandBufferErrorDeviceRemoved API_AVAILABLE(macos(10.13)) API_UNAVAILABLE(ios) = 11,
    ^
/tmp/nix-build-llama-cpp-metalkit-0.0.0.drv-0/source/ggml-metal.m:2809:26: error: duplicate case value 'MTL>
                    case MTLCommandBufferErrorAccessRevoked:
                         ^
/tmp/nix-build-llama-cpp-metalkit-0.0.0.drv-0/source/ggml-metal.m:2803:26: note: previous case defined here
                    case MTLCommandBufferErrorDeviceRemoved:
                         ^
1 warning and 3 errors generated.
[8/153] Building CXX object common/CMakeFiles/common.dir/console.cpp.o
pusherofbrooms commented 6 months ago

Confirmed builds fine with latest commit f364eb6fb5d46118a76fa045f487318de4c24961