Profiling: Finding Regions of Interest with Intel® GPA Framework

Use the Intel® Graphics Performance Analyzers' cli - Intel®  GPA Framework -  to find regions of interest in your rendering applications.

author-image

作者

Smart Profiling With Intel® GPA Framework

Application optimization requires smart profiling. You don't need to profile every frame, but you do need to find the key areas that will help you optimize your application to increase frame rate or frame time consistency.

Use the command-line interface of Intel® Graphics Performance Analyzers (Intel® GPA) to find ranges of frames that do not meet your performance criteria in order to help you identify which parts of your application you should analyze.

Identify Ranges With Particular Criteria

Find sequences of frames that fit particular criteria, such as frame time exceeding 70ms.

gpa-stream-analyzer.exe Usage

Using gpa-stream-analyzer in conjunction with python functionality can help you delineate ranges of data anomalies, aiding in  optimization.

# Use the gpa-stream-analyzer utility to displays capture-time performance as a labeled csv data table.
# Usage: gpa-stream-analyzer.exe [options] <stream>
$ gpa-stream-analyzer <stream> > out.csv

# The related helper scripts require python 3.7+, as well as a standard install of the numpy, pandas, and matplotlib modules.

# To smooth the frame duration data, use moving-average.py:
# Usage: moving-average.py [-h] [-i INPUT] [-p PERIOD] select 
$ python moving-average.py -i out.csv -p 30 cpu_frame_ms > my-moving-average.csv

# Optionally, chart the data to visualize the results as an image (svg) using chart.py
# Usage: chart.py [-h] [--average] [--format FORMAT] [--limit LIMIT] [--name NAME] [--scurve] [--series SERIES] [--series2 SERIES2] [--title TITLE] [--vsync] [--width WIDTH] input
$ python chart.py my-moving-average.csv --series cpu_frame_ms --series2 cpu_frame_ms_moving_average_30

# To classify the resulting data according to a user specified (frame ms) threshold, use partition.py:
# Usage: partition.py [-h] [-i INPUT] select threshold 
$ python partition.py -i my-moving-average.csv cpu_frame_ms_moving_average_30 70 > my-partitions.csv

# To display a table of start/count of frame(s) which exceed the threshold, use summarize.py:
# Usage: summarize.py [-h] [-i INPUT] select mask 
$ python summarize.py -i my-partitions.csv cpu_frame_ms_moving_average_30 cpu_frame_ms_moving_average_30_gt_70

 

image of regions found where frame time exceeds 70ms

Summary

Once you have identified a range of frames of interest, the gpa-subcapture-recorder can be used to generate a new stream containing only the frames you care about. For more information on sub-capture, see Intel® GPA Framework: Deferred Capture and Sub-capture Replace Keyframing.

The chart shows that gpa-stream-analyzer and its helper functions located two partitions, that is, two places that delineate sections that contain frames that take less than vs. greater than 70ms to process. We see that there is a range of 40 frames that exceed 70ms, starting at frame 353.

Back to Deferred Capture and Subcapture...