using-gpucapture
Installation
SKILL.md
Using gpucapture — Metal GPU Trace Capture
Overview
gpucapture is a CLI tool for capturing Metal GPU traces from running processes or launched executables. It requires no source code changes — attach to a process by PID, choose what to capture (frames, command buffers, custom scopes), and produce a .gputrace file for analysis.
Step 1: Check availability
which gpucapture
gpucapture ships with macOS 27 and later. If not found, the user is on an older macOS version — suggest alternatives based on their situation:
- Can modify source code → Programmatic capture via
MTLCaptureManager: Capturing a Metal workload programmatically - Has Xcode available → Xcode's built-in GPU Frame Capture: Capturing a Metal workload in Xcode
If the user explicitly asks for programmatic capture or Xcode capture, honor their request — point them to the relevant Apple docs URL above and answer from your own knowledge. Do not override their choice with gpucapture.