Can't disable CMAKE ARG on Apple: GGML_METAL=OFF

Offen Anfängerfreundlich
#2,050 0 Kommentare 1 Reaktion 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Anfängerfreundlichkeit
65/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Veraltet
Tech-Stack
c, cmake, cpp, python
Bereich
build-system

Rechercherichtung

Der Issue verweist auf Zeile 95 in der Hauptdatei CMakeLists.txt. Untersuche diese Zeile und die umgebende Logik, um zu verstehen, wie GGML_METAL auf Apple-Plattformen erzwungen wird. Ziel ist es, die CMake-Logik so zu ändern, dass ein vom Benutzer bereitgestelltes GGML_METAL=OFF-Flag berücksichtigt wird, während das Standardverhalten erhalten bleibt. Teste die Änderung, indem du mit den bereitgestellten CMAKE_ARGS baust, um sicherzustellen, dass Vulkan funktioniert und Metal deaktiviert ist.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

Expected Behavior

I can disable GGML_METAL and enable GGML_VULKAN.

Current Behavior

Due to this line in the CMAKE config I cannot set GGML_METAL=OFF as it is forced.

Environment and Context

I'm trying to build GGML_VULKAN=ON with Metal off as I want to use MoltenVK on my Intel MBP with an AMD GPU. I have already successfully don't this directly with llama.cpp.

I am having to resort to cloning the repo and patching the lines by hand, which is not ideal.

  • Physical (or virtual) hardware you are using, e.g. for Linux:

2019 Intel MBP

  • Operating System, e.g. for Linux:

MacOS 15.5

  • SDK version, e.g. for Linux:
Python 3.11.9

GNU Make 3.81

Apple clang version 16.0.0 (clang-1600.0.26.4)
Target: x86_64-apple-darwin24.5.0
Thread model: posix

Steps to Reproduce

CMAKE_ARGS="-DGGML_METAL=OFF -DGGML_VULKAN=ON \
-DVulkan_INCLUDE_DIR=/Users/brenden/VulkanSDK/1.4.309.0/macOS/include \
-DVulkan_LIBRARY=/Users/brenden/VulkanSDK/1.4.309.0/macOS/lib/libMoltenVK.dylib \
-DOpenMP_ROOT=$(brew --prefix)/opt/libomp \
-DVulkan_GLSLC_EXECUTABLE=$(brew --prefix)/opt/shaderc/bin/glslc \
-DVulkan_GLSLANG_VALIDATOR_EXECUTABLE=$(brew --prefix)/opt/glslang/bin/glslangValidator \
-DOpenMP_C_FLAGS=-fopenmp=lomp \
-DOpenMP_CXX_FLAGS=-fopenmp=lomp \
-DOpenMP_C_LIB_NAMES=libomp \
-DOpenMP_CXX_LIB_NAMES=libomp \
-DOpenMP_libomp_LIBRARY=$(brew --prefix)/opt/libomp/lib/libomp.dylib \
-DOpenMP_CXX_FLAGS=\"-Xpreprocessor -fopenmp $(brew --prefix)/opt/libomp/lib/libomp.dylib -I$(brew --prefix)/opt/libomp/include\" \
-DOpenMP_CXX_LIB_NAMES=libomp \
-DOpenMP_C_FLAGS=\"-Xpreprocessor -fopenmp $(brew --prefix)/opt/libomp/lib/libomp.dylib -I$(brew --prefix)/opt/libomp/include\"" FORCE_CMAKE=1 pip install --no-binary=llama-cpp-python --no-cache-dir -v llama-cpp-python

(NOTE: These args are derived from what I used to compile a MoltenVK/Vulkan build of llama.cpp using a version of llama.cpp that is from June 2025.

GGML Metal backend runs when you run the server.

Vorherrschende Sprache
Python
Sterne
10.6k
Forks
1.5k
Ø Merge
23 Min.
Gemergte PRs (30 T.)
1

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus abetlen/llama-cpp-python

Alle Issues in abetlen/llama-cpp-python

Ähnliche Issues

Weitere Issues zu Python

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.