ggerganov / llama.cpp

LLM inference in C/C++
MIT License
68.73k stars 9.87k forks source link

Compile bug: No longer builds on APPLE GPUs. cmake requires CUDA. #10647

Open nisten opened 12 hours ago

nisten commented 12 hours ago

Git commit

40c6d79fb52f995f47507fedfeaae2ac05d9b35c

Operating systems

Mac

GGML backends

Metal

Problem description & steps to reproduce

Builds just completely broke, no documentation on how to build on apple. cmake does not work.

Screenshot 2024-12-03 at 9 46 57 PM

did git pull on regular folder i've been using for a year, make -j worked fine there,

created a new folder to test out new ui. It just can't build. And there's no READ instructions on what command to copy paste to build on mac. tried with -DGGML_CCACHE=OFF ON and without.. it keeps asking for nvidia dependency.

First Bad Commit

No response

Relevant log output

-- CMAKE_SYSTEM_PROCESSOR: arm64
-- Accelerate framework found
-- Could NOT find OpenMP_C (missing: OpenMP_C_FLAGS OpenMP_C_LIB_NAMES) 
-- Could NOT find OpenMP_CXX (missing: OpenMP_CXX_FLAGS OpenMP_CXX_LIB_NAMES) 
-- Could NOT find OpenMP (missing: OpenMP_C_FOUND OpenMP_CXX_FOUND) 
CMake Warning at ggml/src/ggml-cpu/CMakeLists.txt:44 (message):
  OpenMP not found

-- Using llamafile
-- ARM detected
-- ARM feature DOTPROD enabled
-- ARM feature MATMUL_INT8 enabled
-- Using runtime weight conversion of Q4_0 to Q4_0_x_x to enable optimized GEMM/GEMV kernels
-- Including CPU backend
-- BLAS found, Libraries: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk/System/Library/Frameworks/Accelerate.framework
-- BLAS found, Includes: 
-- Including BLAS backend
-- Could not find nvcc, please set CUDAToolkit_ROOT.
CMake Error at ggml/src/ggml-cuda/CMakeLists.txt:151 (message):
  CUDA Toolkit not found

-- Configuring incomplete, errors occurred!
make: Makefile: No such file or directory
make: *** No rule to make target `Makefile'.  Stop.
$ cmake -B build                                              (master) [~/h/llama.cpp]
  cmake --build build --config Release^C
$ make -j                                                     (master) [~/h/llama.cpp]
Makefile:2: *** The Makefile build is deprecated. Use the CMake build instead. For more details, see https://github.com/ggerganov/llama.cpp/blob/master/docs/build.md.  Stop.
$                                                                         (master) [~/h/llama.cpp]
slaren commented 12 hours ago

You probably enabled CUDA at some point, and now it is enabled in the cache. Delete the build directory and start from scratch to reset the options.