Requirements
- macOS 13.0 (Ventura) or later
- Apple Silicon (M1/M2/M3/M4) or AMD GPU on an Intel Mac
- Xcode Command Line Tools
Build
On macOS, Metal is detected automatically and
DGGML_METAL=ON may already be the default in upstream build configurations. Check your CMakeCache.txt to confirm.Initialization
Checking GPU family support
Metal devices are organised into feature families. You can query whether the device supports a specific family before using features that depend on it:Abort callback
Register a callback to cancel a Metal compute pass early:GPU capture
To capture a Metal compute pass with Xcode Instruments, call this before executing the graph you want to capture:Using Metal with the scheduler
Metal works withggml_backend_sched_t the same way any other backend does. Add a CPU backend as a fallback for operations not yet implemented in Metal:
