Skip to content

metal : build metallib + fix embed path#6015

Merged
ggerganov merged 4 commits into
masterfrom
gg/metal-embed
Mar 14, 2024
Merged

metal : build metallib + fix embed path#6015
ggerganov merged 4 commits into
masterfrom
gg/metal-embed

Conversation

@ggerganov

Copy link
Copy Markdown
Member

fix #5977

This should improve the build process following the changes in #5940:

  • CMake now always builds default.metallib
  • Fix LLAMA_METAL_EMBED_LIBRARY (Makefile + CMake) to work with the new ggml-common.h

@giladgd

giladgd commented Mar 12, 2024

Copy link
Copy Markdown
Contributor

This PR seems to have solved the issue on my end.
I suggest deleting ggml-metal.air, ggml-common.h and ggml-metal.metal from the output directory after building default.metallib since it seems that those files aren't necessary at runtime now.

@giladgd

giladgd commented Mar 12, 2024

Copy link
Copy Markdown
Contributor

Compiling with LLAMA_METAL_EMBED_LIBRARY now relies on default.metallib to exist at runtime

@ggerganov

Copy link
Copy Markdown
Member Author

I believe I fixed it - would appreciate another test if you have the opportunity

@giladgd

giladgd commented Mar 12, 2024

Copy link
Copy Markdown
Contributor

I've tested your recent commit and now compiling with LLAMA_METAL_EMBED_LIBRARY fails at runtime with the original error:

ggml_metal_init: error: Error Domain=MTLLibraryErrorDomain Code=3 "program_source:3:10: fatal error: 'ggml-common.h' file not found
#include "ggml-common.h"
         ^~~~~~~~~~~~~~~
" UserInfo={NSLocalizedDescription=program_source:3:10: fatal error: 'ggml-common.h' file not found
#include "ggml-common.h"
         ^~~~~~~~~~~~~~~
}
llama_new_context_with_model: failed to initialize Metal backend

@ggerganov
ggerganov merged commit 381da2d into master Mar 14, 2024
NeoZhangJianyu pushed a commit to NeoZhangJianyu/llama.cpp that referenced this pull request Mar 15, 2024
* metal : build metallib + fix embed path

ggml-ci

* metal : fix embed build + update library load logic

ggml-ci

* metal : fix embeded library build

ggml-ci

* ci : fix iOS builds to use embedded library
Seunghhon pushed a commit to Seunghhon/llama.cpp that referenced this pull request Apr 26, 2026
* metal : build metallib + fix embed path

ggml-ci

* metal : fix embed build + update library load logic

ggml-ci

* metal : fix embeded library build

ggml-ci

* ci : fix iOS builds to use embedded library
phuongncn pushed a commit to phuongncn/llama.cpp-gx10-dgx-sparks-deepseekv4 that referenced this pull request Apr 28, 2026
* metal : build metallib + fix embed path

ggml-ci

* metal : fix embed build + update library load logic

ggml-ci

* metal : fix embeded library build

ggml-ci

* ci : fix iOS builds to use embedded library
ljubomirj pushed a commit to ljubomirj/llama.cpp that referenced this pull request May 6, 2026
* metal : build metallib + fix embed path

ggml-ci

* metal : fix embed build + update library load logic

ggml-ci

* metal : fix embeded library build

ggml-ci

* ci : fix iOS builds to use embedded library
my-other-github-account pushed a commit to my-other-github-account/llama.cpp that referenced this pull request May 15, 2026
* metal : build metallib + fix embed path

ggml-ci

* metal : fix embed build + update library load logic

ggml-ci

* metal : fix embeded library build

ggml-ci

* ci : fix iOS builds to use embedded library
my-other-github-account pushed a commit to my-other-github-account/llama.cpp that referenced this pull request May 15, 2026
* metal : build metallib + fix embed path

ggml-ci

* metal : fix embed build + update library load logic

ggml-ci

* metal : fix embeded library build

ggml-ci

* ci : fix iOS builds to use embedded library
AlexiAlp pushed a commit to minghaop/llama.cpp that referenced this pull request Jun 2, 2026
* metal : build metallib + fix embed path

ggml-ci

* metal : fix embed build + update library load logic

ggml-ci

* metal : fix embeded library build

ggml-ci

* ci : fix iOS builds to use embedded library
AlexiAlp pushed a commit to minghaop/llama.cpp that referenced this pull request Jun 2, 2026
* metal : build metallib + fix embed path

ggml-ci

* metal : fix embed build + update library load logic

ggml-ci

* metal : fix embeded library build

ggml-ci

* ci : fix iOS builds to use embedded library
fukuro-kun pushed a commit to fukuro-kun/fukuro-llama-cpp-turboquant that referenced this pull request Jul 5, 2026
* metal : build metallib + fix embed path

ggml-ci

* metal : fix embed build + update library load logic

ggml-ci

* metal : fix embeded library build

ggml-ci

* ci : fix iOS builds to use embedded library
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

'ggml-common.h' file not found when running as shared library and using metal

2 participants