Skip to content

Conversation

@ckastner
Copy link
Collaborator

@ckastner ckastner commented Aug 5, 2025

@slaren, it appears that #15074 yesterday was incomplete. I overlooked that the ggml CMake package generated requires all backends from configure-time to be installed (eg when building llama.cpp), or otherwise errors out.

This doesn't really make sense in contexts where GGML_BACKEND_DL=ON is most useful. For example, a user with a GPU will probably install the HIP or the CUDA backend (if shipped as separate packages) but unlikely both.

This PR removes this requirement. But is this OK? Can it negatively affect a build result if not all backends are present?

I also wonder though whether it should include a check for t least one CPU backend.

Side note: this PR also includes a small fix for a misplacement of $GGML_BACKEND_DIR yesterday, it was in the wrong find_package. This was very weird. I didn't do this manually, I transferred a change from an older branch using patch(1) where this was correct. Maybe some heuristic failed.

@github-actions github-actions bot added the ggml changes relating to the ggml tensor library for machine learning label Aug 5, 2025
@ckastner
Copy link
Collaborator Author

ckastner commented Aug 5, 2025

Eh, more succinctly:

  • In Debian, we have a standalone ggml
  • Our llama.cpp and whisper.cpp builds depend on libggml-dev, with the cmake package
  • When trying to build llama.cpp, the cmake package errors out if not all backends libggml was configured/built with are installed

Any available libraries are found and loaded dynamically at runtime.
@ckastner ckastner force-pushed the backend-dl-optional branch from c364253 to cd497c1 Compare August 6, 2025 19:47
@ckastner ckastner changed the title cmake: Don't require all backends installed with GGML_BACKEND_DL=ON ggml: Skip backend library linking code when GGML_BACKEND_DL=ON Aug 6, 2025
@ckastner ckastner merged commit 9a96389 into ggml-org:master Aug 7, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ggml changes relating to the ggml tensor library for machine learning

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants