How intel/pti-gpu works
PTI for GPU is a profiling library and tool suite for Intel GPUs. A typical application uses PTI to enable tracing or metrics collection; runtime-specific collectors observe API calls and device activity, and PTI exposes collected records through its view and callback interfaces. The README also documents PC sampling, code annotation, binary/source correlation, and system-management tools. The graph emphasizes the SDK and unified tracer; relationships to some unsampled implementations are omitted or marked unverified rather than inferred from filenames.
Main entry points: view_handler.h View handler · pti_lib_handler.h Library handler · unitrace.cc Unified tracer · pti_view.h View records API
Components 25
Public interfaces
- PTI API
sdk/include/pti/pti.h - View records API
sdk/include/pti/pti_view.h - Callback API
sdk/include/pti/pti_callback.h - Metrics API
sdk/include/pti/pti_metrics.h - PC sampling API
sdk/include/pti/pti_pc_sampling.h
Tracing collection
- Library handler
sdk/src/pti_lib_handler.h - Level Zero collector
sdk/src/levelzero/ze_collector.h - SYCL collector
sdk/src/sycl/sycl_collector.h - ITT collector
sdk/src/itt/itt_collector.h - XPTI adapter
sdk/src/xpti_adapter.cc - Graph metadata
sdk/src/levelzero/ze_graph_storage.h
Metrics and sampling
- Metric state
sdk/src/metrics/metric_state_manager.cc - Metric collection
sdk/src/metrics/metrics_handler.h - PC sampling collector
sdk/src/pc_sampling/pti_pc_sampling_collector.cc - PC sample aggregation
sdk/src/pc_sampling/pti_pc_sampling_aggregator.cc
Record delivery
- View handler
sdk/src/view_handler.h - View buffers
sdk/src/view_buffer.h - Buffer consumer
sdk/src/consumer_thread.h
Profiling tools
- Unified tracer
tools/unitrace/src/unitrace.cc - Unified tracing
tools/unitrace/src/tracer.cc - OpenCL callbacks
tools/unitrace/src/opencl/cl_api_callbacks.h - Binary source mapping
utils/gpu_elf_parser/src/elf_parser.cpp - GPU information
tools/gpuinfo/main.cc - GPU monitoring
tools/sysmon/main.cc
Other components
- Profiling application
Connections 22
- Profiling application → PTI API: uses
README.md - Profiling application → Unified tracer: runs
README.md - Library handler → View records API: exposes
sdk/src/pti_lib_handler.h - Library handler → Metrics API: exposes
sdk/src/pti_lib_handler.h - Library handler → Callback API: exposes
sdk/src/pti_lib_handler.h - Library handler → PC sampling API: exposes
sdk/src/pti_lib_handler.h - View handler → View records API: formats records
sdk/src/view_handler.h - View handler → View buffers: refreshes buffers
sdk/src/view_handler.h - View handler → Buffer consumer: uses consumer
sdk/src/view_handler.h - View handler → Level Zero collector: dispatches to
sdk/src/view_handler.h - View handler → SYCL collector: dispatches to
sdk/src/view_handler.h - View handler → ITT collector: dispatches to
sdk/src/view_handler.h - Metric state → Metrics API: implements state
sdk/src/metrics/metric_state_manager.cc - Metric collection → Metrics API: implements collection
- PC sampling collector → PC sample aggregation: aggregates samples
- Level Zero collector → Graph metadata: reads graph metadata
sdk/src/levelzero/ze_graph_storage.h - Unified tracer → Unified tracing: starts tracing
- Unified tracing → OpenCL callbacks: uses callbacks
tools/unitrace/src/opencl/cl_api_callbacks.h - Unified tracer → Binary source mapping: correlates binaries
README.md - Profiling application → GPU information: runs
README.md - Profiling application → GPU monitoring: runs
README.md - Unified tracer → View records API: emits profiling data
README.md