---
title: Replaying a GPU trace file
framework: xcode
role: article
role_heading: Article
path: xcode/replaying-a-gpu-trace-file
---

# Replaying a GPU trace file

Debug and profile your app’s performance using a GPU trace file in the Metal debugger.

## Overview

Overview Replaying a GPU trace file allows you to debug and profile previously captured GPU commands using the Metal debugger. For more information, see Capturing a Metal workload in Xcode or Capturing a Metal workload programmatically. To replay a GPU trace file, open it in Xcode. Before clicking Replay, you can configure which device to use (if there’s more than one available), as well as configure whether to run with profiling.

Configure replay If you have multiple devices, you need to select a device before you can replay the GPU trace file. Xcode automatically selects the most compatible device, but you can select a different device using the Device popover. warning: GPU trace files are only compatible with devices of the same type, the same GPU, and the same operating system. Otherwise, performance may vary. For example, if you capture a Metal workload on a Mac with an AMD GPU, replaying the exported GPU trace file on a Mac with the Apple M1 chip may not work or behave the same. You can optionally enable the Profile GPU Trace option to have Xcode automatically profile after replaying. Profiling has an initial performance impact on the Metal debugger, so only enable this option when debugging your app’s performance. You can always profile later as needed.

## See Also

### Essentials

- [Capturing a Metal workload in Xcode](xcode/capturing-a-metal-workload-in-xcode.md)
- [Capturing a Metal workload programmatically](xcode/capturing-a-metal-workload-programmatically.md)
- [Investigating visual artifacts](xcode/investigating-visual-artifacts.md)
- [Optimizing GPU performance](xcode/optimizing-gpu-performance.md)
- [Debugging with interactive command-line tools](xcode/debugging-with-interactive-command-line-tools.md)
- [Investigating GPU issues with AI agents](xcode/investigating-gpu-issues-with-ai-agents.md)
