Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
A GPU Capture records the Direct3D 12 API calls that your app makes, typically for a single frame. PIX replays those calls to show you API parameters, pipeline and resource state, resource contents, and timing for each piece of GPU work. Use GPU Captures to debug rendering issues and to analyze the performance of a frame.
To profile CPU and GPU work over a longer period, including work that overlaps across queues, use a Timing Capture instead.
You can also get much of the data in a GPU Capture with the PIX API, for example to automate analysis. To open a capture, call IPixFactory::OpenGpuCaptureDocument. The GPU Captures articles name the API methods that return the data in each view. They use the C++ names, and the C# and Python bindings use similar names.
Take a GPU Capture
To take a GPU Capture, launch or attach to your app from PIX with GPU Capture selected as the capture type, and then take a capture. For the full steps, see Take captures. To take a GPU Capture from your app's code, see Programmatic capture.
Tip
PIX can't always take a GPU Capture of an app that calls Direct3D 12 in invalid ways. If you have trouble taking GPU Captures, use the Direct3D 12 debug layer and GPU-based validation to find and fix invalid API calls.
Explore a capture
When you open a GPU Capture, PIX shows its default layout. Each tab of the layout groups views for a task:
| Tab | Use it to |
|---|---|
| Overview | Browse events, see the captured screenshot and file details, check Warnings, and view the Timeline. |
| Pipeline | Inspect pipeline state, resources, API objects, descriptor heaps, and shaders for the selected event. |
| Tools | Run Dr. PIX queries on the selected events. |
| Debug | Step through shader code with the shader debugger. |
| Mappings | Inspect reserved resource and heap mappings. |
You can rearrange views and add others to any tab. For more information, see Arrange views.
To get the captured screenshot and the file details programmatically, call IPixGpuCaptureDocument::GetCapturedScreenshot and GetFileInfo.
The Events view appears on most tabs and lists the API calls that the capture recorded. Use the drop-down at the top of the view to choose which queue's events to show. To filter the list, select Search, and then type text or a regular expression. By default, the list shows only events that do GPU work. To also show events that only set state, turn off !G (Exclude non-GPU work items) in the search bar. When you select an event, the other views update to show information about it.
To get the events programmatically, call IPixGpuCaptureDocument::GetQueues, and then IPixGpuCaptureQueueInfo::GetEvent for each event on a queue.
Many features need PIX to replay the capture first. To replay it, select Start Analysis. If your computer has more than one GPU, select the GPU to use for playback from the Select analysis adapter drop-down first.
To replay a capture programmatically, call IPixGpuCaptureDocument::GetAnalysis. On the IPixGpuCaptureAnalysis that it returns, call Connect, then GetAdapters to choose the GPU, and then StartAnalysis.
Analyze performance
- Collect timing data to see how long each event takes on the GPU.
- Collect hardware counters from AMD, Intel, and NVIDIA GPUs, and understand GPU occupancy.
- Analyze workloads with Dr. PIX to measure how changes such as smaller viewports affect performance.
Debug rendering
- Inspect pipeline state and resources for any event, including render targets and pixel history.
- Debug and edit shaders by stepping through HLSL, or by editing a shader and seeing the result immediately.
- Use automatic shader PDB resolution so that PIX can find your shader symbols.
- Find issues with Warnings by running PIX warnings analysis, the debug layer, or GPU-based validation on the capture.
- Create custom visualizers to view textures, meshes, and buffers in your own way.
- View tile mappings for reserved resources.
- Export a GPU capture to C++ to create a standalone replay project you can edit and reduce to a smaller reproduction.
Analyze specific features
- Analyze DirectX Raytracing workloads, including acceleration structures and shader tables.
Capture portability and multiple GPUs
- GPU Captures generally aren't portable across GPU hardware and driver versions. A capture usually plays back correctly on similar GPUs from the same hardware family, and some captures play back on GPUs from other manufacturers. However, even a driver update can break playback of older captures. PIX can guarantee playback only on the same GPU and driver that took the capture.
- PIX always plays back a GPU Capture on a single adapter, even if the app used more than one. If the app used only one adapter, PIX tries to select a matching adapter automatically.