Metal developer tools
Create, debug, and profile your Metal apps with a powerful and extensive set of tools, including the Metal debugger in Xcode and Metal system trace in Instruments.
Create, debug, and profile your Metal apps with a powerful and extensive set of tools, including the Metal debugger in Xcode and Metal system trace in Instruments.
Xcode comes with a comprehensive suite of advanced tools for debugging your Metal app. With the Metal debugger, you can inspect your entire rendering pipeline and all of the resources that are used. Debug and fix visual artifacts in Metal pipelines ranging from mesh shading, to ray tracing and MetalFX Upscaling.
The dependencies viewer provides a graphics representation of the structure of your Metal workload and allows you to view the relationships between resources and the passes which access them.
The Metal debugger includes a comprehensive report of your Metal memory usage to help you optimize and reduce the memory footprint of your Metal app.
You can inspect many resources that your Metal app uses, including objects like buffers and textures, and ray tracing acceleration structures.
The shader debugger helps you debug issues in your shader code by jumping to any point and inspecting variable values during shader execution. Edit the shader code and reload your changes to verify the fix.
Metal has a powerful built-in set of runtime diagnostic tools to help validate that your Metal app is running correctly. Xcode shows you where errors are — right inside your source code — which can help you catch bugs before they appear.
Metal can check whether you’re using the API correctly. For example, if you accidentally set the wrong flag on a texture, Metal will let you know.
Metal can also protect your shaders from doing anything incorrectly, such as accessing a buffer out of bounds. If there’s a problem in your shader code Xcode, shows you where — right inside your shader source code.
Xcode is bundled with an advanced set of tools to help your Metal app achieve consistently smooth rendering and incredible performance on Apple hardware.
You can monitor key graphics statistics directly in your Metal app with the Metal performance HUD, making it easy to spot performance problems and find the best scope to capture in Xcode or Instruments.
The Metal system trace template in Instruments provides a visual timeline of the parallel work on the CPU, GPU, and the memory usage of your Metal app.
The performance timeline in Xcode displays the various passes and stages running simultaneously, along with hardware counters. You can discover over-serialization by observing non-overlapping GPU work.
Performance heat maps in Xcode make it easy to discover expensive pixels or compute threads by visualizing a comprehensive set of performance metrics. You can then select a SIMD group to view its entire execution history, including function calls, loop iterations and active threads.
The Metal debugger visualizes shader function cost, and shows inline statistics within your shader source, making optimizing your code a breeze. You can even edit and reload your shaders to compare performance.
The comprehensive suite of Metal developer tools are fully compatible with the Metal shader converter. After preparing your project to include debug information when compiling, you can receive runtime validation errors from Metal. The Metal debugger also supports debugging and profiling your converted shaders.
The Metal Performance Shader Graph viewer in Xcode helps you visualize your multidimensional compute graphs. You can even select a device to inspect how your network is executed on Apple Silicon, and discover which operations are run on the GPU or the Neural Engine.
You can select a device to visualize the GPU operations that can be stitched together during compilation. Because these operations are fused into a single optimized Metal shader, internally, they have no memory overhead, which dramatically improves performance.
The viewer makes it easy to spot and investigate unexpected weights in your pre-trained networks – whether you’re multiplying by zero, or have a convolution layer that’s slowly duplicating it’s input.
Download Xcode to start using the full suite of Metal developer tools. Validate Metal API and shader usage, debug and profile your Metal app with the Metal debugger, and analyze system performance with Metal system trace in Instruments.
Download the collection of Windows-hosted tools, headers and libraries that enable developers to build their Metal shader programs/assets for deployment on iOS, macOS, and tvOS.