• Intel® Graphics Performance Analyzers 2019 R4
  • 12/20/2019
  • Public Content

Creating Custom Plugin for Graphics Frame Analyzer

You can integrate your own plugin into the Graphics Frame Analyzer Plugin Interface.
A recommended workflow for creating a plugin for Graphics Frame Analyzer is as follows:
  1. Write a __init__.py script containing  and methods.
  2. Write additional scripts, if needed.
  3. Copy the plugin folder to %USERPROFILE%\Documents\GPA\python_plugins.
A plugin requires a separate folder, as each plugin is considered a separate Python module.
Folder name must be PEP-8 compatible and is used for plugin invocation from the
Type Filter Expression
field in the Graphics Frame Analyzer.
desc() method
The method is used to obtain the following meta information about a plugin:
  • name
    : plugin name shown in the Graphics Frame Analyzer Plugin Interface. If the name is not defined, a directory name can be used.
  • description
    : plugin description.
  • apis
    : supported APIs.
The following values are available:
  • DirectX
  • DirectX 11
  • DirectX 12
  • OpenGL
  • Vulkan
If no value is defined, all the available values apply.
  • plugin_api_version
    : plugin API version. The available values are
  • applicabilities
    : Graphics Frame Analyzer pane(s) where the plugin is used.
The following values are available:
  • Apilog
  • Resources
If no value is defined, all the available values apply.
An example of the desc() method:
def desc(): return { "name" : "My sample plugin", "description" : "Sample plugin is written for educational purpose", "apis" : ["DirectX"], "plugin_api_version" : "1.1", "applicabilities" : ["Apilog"] }
run() method
The method returns items which are found on the defined criteria. The method uses the
method or the
method of the utils.common module distributed with the Graphics Frame Analyzer.
An example of the run() method:
def run(): api_log = plugin_api.get_api_log_accessor() calls = [x for x in api_log.get_full() if x.get_description()['name'] == 'ClearRenderTargetView'] return [common.node_to_result(x, 'info', 'This is a clear call!') for x in calls]
If a call is not defined, the detected call is marked, but no informational message appears.
You can use the following types of marks:
  • informational
  • warning
  • erroneous
The run() method supports arguments that are passed from the Graphics Frame Analyzer. Each argument can be decorated with function decorators in compliance with PEP-3107. Argument descriptions are shown in the Graphics Frame Analyzer.
def run(name: "Draw call name" = 'ClearRenderTargetView'): api_log = plugin_api.get_api_log_accessor() calls = [x for x in api_log.get_full() if x.get_description()['name'] == name] return [common.node_to_result(x, 'info') for x in calls]
To access different methods of a custom plugin API, import plugin_api into the plugin that you created, and then get accessors for the required data.
plugin_api is located at <GPA installation directory>/python_plugins/plugin_api.
The available accessors are the following:
  • get_api_log_accessor()
    - processes the API Log: gets calls, arguments, bindings, etc.
  • get_resources_accessor()
    - processes resources: gets resource descriptions, views, shaders, etc.
  • get_metrics_accessor()
    - processes metrics: gets metric values, metric descriptions, etc.
An example of an accessor:
import plugin_api def run(): metrics_accessor = plugin_api.get_metrics_accessor() descs = metrics_accessor.get_metrics_descriptions() # some code

See also

Product and Performance Information


Intel's compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors. These optimizations include SSE2, SSE3, and SSSE3 instruction sets and other optimizations. Intel does not guarantee the availability, functionality, or effectiveness of any optimization on microprocessors not manufactured by Intel. Microprocessor-dependent optimizations in this product are intended for use with Intel microprocessors. Certain optimizations not specific to Intel microarchitecture are reserved for Intel microprocessors. Please refer to the applicable product User and Reference Guides for more information regarding the specific instruction sets covered by this notice.

Notice revision #20110804