This project measures how iogpu.wired_limit_mb behaves on Apple silicon Macs. The Ruby scripts run repeatable Metal workloads, sample memory pressure and system state, and produce reports that make limit changes easier to evaluate on a specific machine.
The setting changes the ceiling for memory the GPU may wire. It does not reserve memory or create a GPU workload. A value of 0 uses the macOS default policy and should be included as the baseline in every sweep.
Requirements and example sweep
The scripts require Apple silicon macOS, Ruby 3.x, administrator access, and a repeatable Metal workload that starts a fresh process for each value.
ruby gpu_limit_report_local.rb --limits-mb 0,12288,13312 --duration 120 --interval 1 --warmup 8 --workload-command '/path/to/llama-cli -m /path/to/model.gguf -p "benchmark prompt" -n 512' --report-prefix 16gb-test
The example values are illustrative for one 16 GiB machine, not recommendations for another Mac.
Reports and recommendation criteria
Each sweep writes raw and summary CSV, JSON, and Markdown reports. The analyzer recommends only the highest tested value with no additional swapouts, less than 64 MB swap growth, less than 256 MB compressed-memory growth, at least 20% available memory, and a successful workload. Missing metrics, a failed workload, or pressure at every value produces no recommendation. These thresholds are heuristics; responsiveness and performance still require evaluation.
The script verifies every sysctl write, restores the original value by default, and writes partial reports after interruptions or failures when samples are available.
Status and limitations
Results are hardware- and macOS-specific; they do not establish a universal recommended limit. Changing a privileged system setting can destabilize workloads, so tests should be repeatable, monitored and confined to a machine that can be recovered.
Related reading
- Apple Silicon GPU memory limits and wired RAM
- How a game crash left 8 GB wired in the Apple GPU stack