ollama - ✅(Solved) Fix Error: failed to initialize MLX: libmlxc.dylib not found [1 pull requests, 3 comments, 4 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
ollama/ollama#15533Fetched 2026-04-15 06:20:28
View on GitHub
Comments
3
Participants
4
Timeline
15
Reactions
6
Assignees
Timeline (top)
subscribed ×6commented ×3unsubscribed ×2assigned ×1

Error Message

$ curl http://localhost:11434/api/generate -d '{ "model": "x/z-image-turbo", "prompt": "a sunset over mountains", "width": 512, "height": 512, "steps": 4, "seed": 42, "stream": false }' {"error":"mlx runner failed: Error: failed to initialize MLX: libmlxc.dylib not found (exit: exit status 1)"}

PR fix notes

PR #15588: mlx: fix imagegen lookup

Description (problem / solution / changelog)

Fixes #15533 - imagegen had fallen out of sync with the new layout for multiple mlx libraries on Metal.

Changed files

  • x/imagegen/server.go (modified, +48/-30)

Code Example

$ curl http://localhost:11434/api/generate -d '{
  "model": "x/z-image-turbo",
  "prompt": "a sunset over mountains",
  "width": 512,
  "height": 512,
  "steps": 4,
  "seed": 42,
  "stream": false
}'
{"error":"mlx runner failed: Error: failed to initialize MLX: libmlxc.dylib not found (exit: exit status 1)"}

---

time=2026-04-13T09:40:30.596+05:00 level=INFO source=sched.go:484 msg="system memory" total="48.0 GiB" free="31.0 GiB" free_swap="0 B"
time=2026-04-13T09:40:30.596+05:00 level=INFO source=sched.go:491 msg="gpu memory" id=0 library=Metal available="35.5 GiB" free="36.0 GiB" minimum="512.0 MiB" overhead="0 B"
time=2026-04-13T09:40:30.599+05:00 level=INFO source=server.go:171 msg="starting mlx runner subprocess" model=x/z-image-turbo:latest port=58548
time=2026-04-13T09:40:30.600+05:00 level=INFO source=sched.go:561 msg="loaded runners" count=1
time=2026-04-13T09:40:30.612+05:00 level=WARN source=server.go:164 msg=mlx-runner msg="time=2026-04-13T09:40:30.612+05:00 level=INFO msg=\"starting mlx runner\" model=x/z-image-turbo:latest port=58548 mode=imagegen"
time=2026-04-13T09:40:30.612+05:00 level=WARN source=server.go:164 msg=mlx-runner msg="time=2026-04-13T09:40:30.612+05:00 level=ERROR msg=\"unable to initialize MLX\" error=\"failed to initialize MLX: libmlxc.dylib not found\""
time=2026-04-13T09:40:30.612+05:00 level=WARN source=server.go:164 msg=mlx-runner msg="Error: failed to initialize MLX: libmlxc.dylib not found"
time=2026-04-13T09:40:30.612+05:00 level=ERROR source=sched.go:567 msg="error loading llama server" error="mlx runner failed: Error: failed to initialize MLX: libmlxc.dylib not found (exit: exit status 1)"
time=2026-04-13T09:40:30.613+05:00 level=INFO source=server.go:363 msg="stopping mlx runner subprocess" pid=40146
[GIN] 2026/04/13 - 09:40:30 | 500 |   97.157125ms |       127.0.0.1 | POST     "/api/generate"
RAW_BUFFERClick to expand / collapse

What is the issue?

$ curl http://localhost:11434/api/generate -d '{
  "model": "x/z-image-turbo",
  "prompt": "a sunset over mountains",
  "width": 512,
  "height": 512,
  "steps": 4,
  "seed": 42,
  "stream": false
}'
{"error":"mlx runner failed: Error: failed to initialize MLX: libmlxc.dylib not found (exit: exit status 1)"}

Relevant log output

time=2026-04-13T09:40:30.596+05:00 level=INFO source=sched.go:484 msg="system memory" total="48.0 GiB" free="31.0 GiB" free_swap="0 B"
time=2026-04-13T09:40:30.596+05:00 level=INFO source=sched.go:491 msg="gpu memory" id=0 library=Metal available="35.5 GiB" free="36.0 GiB" minimum="512.0 MiB" overhead="0 B"
time=2026-04-13T09:40:30.599+05:00 level=INFO source=server.go:171 msg="starting mlx runner subprocess" model=x/z-image-turbo:latest port=58548
time=2026-04-13T09:40:30.600+05:00 level=INFO source=sched.go:561 msg="loaded runners" count=1
time=2026-04-13T09:40:30.612+05:00 level=WARN source=server.go:164 msg=mlx-runner msg="time=2026-04-13T09:40:30.612+05:00 level=INFO msg=\"starting mlx runner\" model=x/z-image-turbo:latest port=58548 mode=imagegen"
time=2026-04-13T09:40:30.612+05:00 level=WARN source=server.go:164 msg=mlx-runner msg="time=2026-04-13T09:40:30.612+05:00 level=ERROR msg=\"unable to initialize MLX\" error=\"failed to initialize MLX: libmlxc.dylib not found\""
time=2026-04-13T09:40:30.612+05:00 level=WARN source=server.go:164 msg=mlx-runner msg="Error: failed to initialize MLX: libmlxc.dylib not found"
time=2026-04-13T09:40:30.612+05:00 level=ERROR source=sched.go:567 msg="error loading llama server" error="mlx runner failed: Error: failed to initialize MLX: libmlxc.dylib not found (exit: exit status 1)"
time=2026-04-13T09:40:30.613+05:00 level=INFO source=server.go:363 msg="stopping mlx runner subprocess" pid=40146
[GIN] 2026/04/13 - 09:40:30 | 500 |   97.157125ms |       127.0.0.1 | POST     "/api/generate"

OS

macOS

GPU

Apple

CPU

Apple

Ollama version

0.20.6

extent analysis

TL;DR

The most likely fix is to ensure the libmlxc.dylib library is installed and accessible on the system.

Guidance

  • Verify that the libmlxc.dylib library is present in the system's library path.
  • Check if there are any compatibility issues between the library and the current macOS version.
  • Consider reinstalling or updating the MLX dependencies to ensure the library is correctly installed.
  • If using a custom or modified version of the MLX runner, ensure it is correctly configured to find the libmlxc.dylib library.

Example

No code snippet is provided as the issue seems to be related to a missing library rather than a code error.

Notes

The issue may be specific to the macOS environment or the Apple GPU/CPU configuration. Further investigation into the system's library paths and MLX dependencies may be necessary to resolve the issue.

Recommendation

Apply workaround: Ensure the libmlxc.dylib library is installed and accessible, as this seems to be the primary cause of the error. If the issue persists, consider seeking further assistance or checking for updates to the MLX runner or dependencies.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING