Skip to content

Withdrawn - #170

Closed
syphah wants to merge 1 commit into
Andyyyy64:mainfrom
syphah:fix/macos-metal-working-set
Closed

Withdrawn#170
syphah wants to merge 1 commit into
Andyyyy64:mainfrom
syphah:fix/macos-metal-working-set

Conversation

@syphah

@syphah syphah commented Aug 29, 2026

Copy link
Copy Markdown

Withdrawn by the author.

iogpu.wired_limit_mb is 0 on every unmodified Mac, so
_detect_iogpu_wired_limit_bytes() returns None and the whole of physical
memory ends up reported as GPU-addressable. #153 fixed the case where the
user had explicitly raised the limit; the default path was still wrong.

recommendedMaxWorkingSetSize is the budget macOS actually enforces, and
it is not exposed through sysctl or system_profiler — the Metal API is
the only way to read it. Read it through ctypes against the system Metal
and objc libraries, so this adds no dependency, and apply it only when no
explicit wired limit is set (an explicitly raised limit stays a
deliberate user choice).

Measured on a 16 GB M4 (MacBook Air, macOS 26):

  before:  Apple M4 — 16.0 GB shared (budget 15.2 GB)
  after:   Apple M4 — 11.8 GB shared (budget 11.2 GB)
  Metal:   12713115648 bytes = 11.84 GiB
  llama.cpp agrees: ggml_metal_log_allocated_size (3927.89 / 12124.17)

The inflated budget is not cosmetic: it put two models at the top of the
recommendations that cannot load at all on this machine (14.4 GB and
14.0 GB against an 11.84 GiB ceiling). Both disappear after the fix, and
the top pick becomes one that actually runs.

Completes #152.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@syphah syphah changed the title fix(macOS): use Metal's recommendedMaxWorkingSetSize as the GPU budget Withdrawn Aug 29, 2026
@syphah syphah closed this Aug 29, 2026
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.

1 participant