cicerolneto / GPA

GPU Performance API for AMD GPUs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GPU Performance API


Overview

The GPU Performance API (GPUPerfAPI, or GPA) is a powerful library, providing access to GPU Performance Counters. It can help analyze the performance and execution characteristics of applications using a Radeon™ GPU. This library is used by Radeon Compute Profiler and CodeXL as well as several third-party tools.

Downloads

Prebuilt binaries can be downloaded from the Releases page: https://github.com/GPUOpen-Tools/GPA/releases

Table of Contents

Major Features

  • Provides a standard API for accessing GPU Performance counters for both graphics and compute workloads across multiple GPU APIs.
  • Supports Vulkan™, DirectX™ 12, DirectX 11, OpenGL, OpenCL™, and ROCm/HSA.
  • Supports all current Radeon graphics cards and APUs based on Graphics IP version 8 and newer.
  • Supports both Windows and Linux.
  • Provides derived "public" counters based on raw hardware counters.
  • Provides access to some raw hardware counters. See Raw Hardware Counters for more information.

What's New

  • Version 3.4 (7/10/19)
    • Add support for additional GPUs and APUs, including Radeon 5700 Series GPUs.
    • Add support for setting stable GPU clocks for DirectX11, OpenGL and OpenCL.
    • Add an OpenGL sample application that uses GPUPerfAPI.
    • Add basic counter validation to sample applications.
    • Add support for enabling individual hardware counters that make up derived counters.
    • Add two new GFX9 GlobalMemory Counters for graphics: LocalVidMemBytes and PcieBytes.
    • Reformat source code using clang-format.
    • Update counter documentation to contain per-hardware-generation tables.
    • Bugs Fixed:
      • Fixed error handling in GPA_GetEnabledIndex, GPA_EnableCounterByName and GPA_DisbleCounterByName.
      • Fixed an issue with Vulkan timing counters (GPUOpen-Tools#40).
      • Fixed an issue with SALUBusy counters.
      • Fixed an issue with HiZQuadsCulledCount and HiZQuadsSurvivingCount counters on GFX8 GPUs.
      • Fixed an issue with MemUnitBusy and MemUnitStalled counters on GFX8 GPUs.
      • Fixed an issue with VSVALUBusyCycles counter on GFX9 GPUs.

System Requirements

  • An AMD Radeon GPU or APU based on Graphics IP version 8 and newer.
  • Windows: Radeon Software Adrenaline 2019 Edition 19.7.3 or later (Driver Packaging Version 19.30 or later).
  • Linux: Radeon Software for Linux Revision 19.20 or later (19.30 required for AMD Radeon 5700 Series GPUs).
  • HSA/ROCm version requires ROCm 2.0 or newer.
    • For use with ROCm, please make sure that the optional ROCm package "rocprofiler-dev" is installed.
      • Ubuntu: sudo apt install rocprofiler-dev
      • CentOS: sudo yum install rocprofiler-dev
  • Radeon GPUs or APUs based on Graphics IP version 6 and 7 are no longer supported by GPUPerfAPI. Please use an older version (3.3) with older hardware.
  • Windows 7, 8.1, and 10.
  • Ubuntu (16.04 and later) and CentOS/RHEL (7 and later) distributions.

Cloning the Repository

To clone the GPA repository, execute the following git command

After cloning the repository, please run the following python script to retrieve the required dependencies and generate the build files (see BUILD.md for more information):

  • python PreBuild.py

Source Code Directory Layout

Documentation

The documentation for GPUPerfAPI can be found in each GitHub release. In the release .zip file or .tgz file, there will be a "docs" directory. Simply open the index.html file in a web browser to view the documentation.

The documentation is hosted publicly at: http://gpuperfapi.readthedocs.io/en/latest/

Raw Hardware Counters

This release exposes both "Derived" counters and "Raw Hardware" counters. Derived counters are counters that are computed using a set of raw hardware counters. While querying raw hardware counters was possible in earlier GPUPerfAPI releases, the current release makes it much simpler. In previous releases, you had to build GPUPerfAPI with special build flags in order to produce an "Internal" version that exposed the raw hardware counters. Current versions allow you to access the raw hardware counters in a default build, by simply specifying a new flag when calling GPA_OpenContext. The current CMake build system still allows you to produce an "Internal" build of GPUPerfAPI that also exposes the raw hardware counters, but that is a deprecated build and it is likely to be removed in a future release.

Known Issues

  • Adjusting the GPU clock mode on Linux is accomplished by writing to

    /sys/class/drm/card<N>/device/power_dpm_force_performance_level

    where <N> is the index of the card in question. By default this file is only modifiable by root, so the application being profiled would have to be run as root in order for it to modify the clock mode. It is possible to modify the permissions for the file instead so that it can be written by unprivileged users. The following command will achieve this. Note, however, that changing the permissions on a system file like this could circumvent security. Also, on multi-GPU systems, you may have to replace "card0" with the appropriate card number. Permissions on this file may be reset when rebooting the system:
    • sudo chmod ugo+w /sys/class/drm/card0/device/power_dpm_force_performance_level
  • The following performance counter values may not be accurate for DirectX 11 applications running on a Radeon 5700 Series GPU. This is expected to be addressed in a future driver release:
    • VALUInstCount, SALUInstCount, VALUBusy, SALUBusy for all shader stages: These values should be representative of performance, but may not be 100% accurate.
    • Most of the ComputeShader counters (all except the MemUnit and WriteUnit counters): These values should be representative of performance, but may not be 100% accurate.
  • The following performance counter values may not be accurate for OpenGL applications running on a Radeon 5700 Series GPU. This is expected to be addressed in a future driver release:
    • VALUInstCount, SALUInstCount, VALUBusy, SALUBusy for all shader stages: These values should be representative of performance, but may not be 100% accurate.
    • Most of the ComputeShader counters (all except the MemUnit and WriteUnit counters): These values should be representative of performance, but may not be 100% accurate.
  • On Linux, setting the GPU clock mode is not working correctly for Radeon 5700 Series GPUs, potentially leading to some inconsistencies in counter values from one run to the next. This is expected to be addressed in a future driver release.

About

GPU Performance API for AMD GPUs

License:MIT License


Languages

Language:C++ 99.1%Language:C# 0.3%Language:C 0.3%Language:CMake 0.2%Language:Python 0.1%Language:GLSL 0.0%Language:Shell 0.0%Language:HLSL 0.0%Language:Batchfile 0.0%