Skip to content

cmake : support build for iOS/tvOS - #3116

Merged
jhen0409 merged 3 commits into
ggml-org:masterfrom
jhen0409:cmake-ios-build
Sep 11, 2023
Merged

jhen0409 merged 3 commits into
ggml-org:masterfrom
jhen0409:cmake-ios-build

Conversation

@jhen0409

@jhen0409 jhen0409 commented Sep 11, 2023 •

Copy link
Copy Markdown
Member

Fix #3106.

Update the CMakeLists.txt and add CI steps to ensure to continue to work.

@alonfaraj

alonfaraj commented Sep 11, 2023 •

Copy link
Copy Markdown
Contributor

Great!
Maybe it worth to have a separate job for each build (iOS, tvOS) and not putting all together inside macOS-latest-cmake?
It would be easier to monitor if one of them fails and keep them independent.

@jhen0409

Copy link
Copy Markdown
Member Author

Great! Maybe it worth to have a separate job for each build (iOS, tvOS) and not putting all together inside macOS-latest-cmake? It would be easier to monitor if one of them fails and keep them independent.

Yeah it might be better and same as other builds, will change it before merge.

@jhen0409
jhen0409 merged commit 1b0d092 into ggml-org:master Sep 11, 2023
@jhen0409
jhen0409 deleted the cmake-ios-build branch September 11, 2023 11:49
@cyrilzakka

Copy link
Copy Markdown

Would it be possible to add VisionOS support as well?

@jhen0409

Copy link
Copy Markdown
Member Author

Would it be possible to add VisionOS support as well?

I've tried an iOS build on visionOS simulator before and it works well. Not yet to try with a visionOS project, but I think it should be easy by add the OS target.

@cyrilzakka

Copy link
Copy Markdown

Thanks! In case you also have a sample Swift/VisionOS project to look at, I'd love to take a look at it too! I tried using llm_farm which is based off of this project but it crashes on model load.

@jhen0409

Copy link
Copy Markdown
Member Author

Thanks! In case you also have a sample Swift/VisionOS project to look at, I'd love to take a look at it too! I tried using llm_farm which is based off of this project but it crashes on model load.

It was an internal iOS project with target visionOS + Designed for iPad. I can switch back to Xcode beta to give it try again in the next few days.

Also, if it's a Simulator, during to Metal limitations we can't use constant buffers more than 14, so remember to use ngl = 0.

@cyrilzakka

cyrilzakka commented Oct 2, 2023 •

Copy link
Copy Markdown

@jhen0409 Sorry to have to ask, but where do I set the ngl 0 flag in Swift? I see it as an option in the CI but not anywhere else (e.g. ggml-metal). Thanks for your patience!

@jhen0409

jhen0409 commented Oct 2, 2023

Copy link
Copy Markdown
Member Author

@jhen0409 Sorry to have to ask, but where do I set the ngl 0 flag in Swift? I see it as an option in the CI but not anywhere else (e.g. ggml-metal). Thanks for your patience!

To be clear, it's called n_gpu_layers in the parameters.

Seunghhon pushed a commit to Seunghhon/llama.cpp that referenced this pull request Apr 26, 2026
* cmake : support build for iOS/tvOS

* ci : add iOS/tvOS build into macOS-latest-cmake

* ci : split ios/tvos jobs
phuongncn pushed a commit to phuongncn/llama.cpp-gx10-dgx-sparks-deepseekv4 that referenced this pull request Apr 28, 2026
* cmake : support build for iOS/tvOS

* ci : add iOS/tvOS build into macOS-latest-cmake

* ci : split ios/tvos jobs
ljubomirj pushed a commit to ljubomirj/llama.cpp that referenced this pull request May 6, 2026
* cmake : support build for iOS/tvOS

* ci : add iOS/tvOS build into macOS-latest-cmake

* ci : split ios/tvos jobs
AlexiAlp pushed a commit to minghaop/llama.cpp that referenced this pull request Jun 2, 2026
* cmake : support build for iOS/tvOS

* ci : add iOS/tvOS build into macOS-latest-cmake

* ci : split ios/tvos jobs
AlexiAlp pushed a commit to minghaop/llama.cpp that referenced this pull request Jun 2, 2026
* cmake : support build for iOS/tvOS

* ci : add iOS/tvOS build into macOS-latest-cmake

* ci : split ios/tvos jobs
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.

Building for iPhone (iOS) error: xpc/xpc.h not found in IOSurfaceAPI when including <Metal/Metal.h> in ggml-metal.m

4 participants