Giter Site home page Giter Site logo

gpuopen-tools / gpu_performance_api Goto Github PK

View Code? Open in Web Editor NEW
245.0 49.0 46.0 72.39 MB

GPU Performance API for AMD GPUs

License: MIT License

Shell 0.01% C++ 95.46% C 2.49% C# 0.97% Python 0.29% HLSL 0.01% Batchfile 0.01% GLSL 0.02% CMake 0.75% Java 0.01%
gpu-performance-counters d3d12 d3d11 vulkan opengl opencl sdk

gpu_performance_api's Introduction

GPU Performance API


The GPU Performance API (GPUPerfAPI, or GPA) is a powerful library which provides 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 GPU Profiler as well as several third-party tools.

Table of Contents

Downloads

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

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, and OpenCL™.
  • 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.15 (12/06/2023)

  • Updated minimum CMake version to 3.10 from 3.05.
  • Updated equation for MemUnitBusyCycles.
  • Updated description of LocalVidMemBytes.
  • Renamed *.inc files to .hpp files.
  • Reduced size of static buffer when logging messages to avoid compiler warning.
  • Fixed an issue on some variant hardware that would prevent enabling certain hardware counters when kGpaOpenContextExposeHardwareCountersBit was specified to GpaOpenContext() by always generating asic-specific counters.

System Requirements

  • An AMD Radeon GPU or APU based on Graphics IP version 8 and newer.
  • Windows: Radeon Software Adrenalin 2020 Edition 20.11.2 or later (Driver Packaging Version 20.45 or later).
  • Linux: Radeon Software for Linux Revision 20.45 or later.
  • 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, 10, or 11.
  • 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 pre_build.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. This version allows you to access the raw hardware counters by simply specifying a flag when calling GpaOpenContext.

New Pipeline-Based Counters

It was discovered that the improvements introduced in Vega, RDNA, and RDNA2 architectures were not being properly accounted for in GPUPerfAPI v3.9, and caused a lot of known issues to be called out in that release. In certain cases, the driver and hardware are able to make optimizations by combining two shader stages together, which prevented GPUPerfAPI from identifying which instructions where executed for which shader type. As a result of these changes, GPUPerfAPI is no longer able to expose instruction counters for each API-level shader, specifically Vertex Shaders, Hull Shaders, Domain Shaders, and Geometry Shaders. Pixel Shaders and Compute Shaders remain unchanged. We are now exposing these instruction counters based on the type of shader pipeline being used. In pipelines that do not use tessellation, the instruction counts for both the Vertex and Geometry Shaders (if used) will be combined in the VertexGeometry group (ie: counters with the "VsGs" prefix). In pipelines that use tessellation, the instruction counts for both the Vertex and Hull Shaders will be combined in the PreTessellation group (ie: counters with the "PreTessellation" or "PreTess" prefix), and instruction counts for the Domain and Geometry Shaders (if used) will be combined in the PostTessellation group (ie: counters with the "PostTessellation" or "PostTess" prefix). The table below may help to better understand the new mapping between the API-level shaders (across the top), and which prefixes to look for in the GPUPerfAPI counters.

Pipeline Vertex Hull Domain Geometry Pixel Compute
VS-PS VsGs PS
VS-GS-PS VsGs VsGs PS
VS-HS-DS-PS PreTess PreTess PostTess PostTess PS
VS-HS-DS-GS-PS PreTess PreTess PostTess PostTess PS
CS CS

Known Issues

Counter Validity on Specific Hardware

There are some counters that are returning unexpected results on specific hardware with certain APIs.

  • AMD Radeon RX 6700M, DX11: CSLDSBankConflict and CSLDSBankConflictCycles may consistently report as much as 30x higher than expected.
  • AMD Radeon RX 480, DX12: CulledPrims and PSPixelsOut may inconsistently report higher than expected.
  • VsGsVerticesIn is incorrectly reporting zero when using Vulkan on Linux for some hardware.

Counter Validation Errors in D3D12ColorCube Sample App

Due to the extensive counter validation now being done in the D3D12ColorCube sample application, and some expected variation in nondeterministic counters across a wide range of systems, the sample app may report errors on some systems. Likewise, some counters are marked as known issues and we are investigating the underlying causes of the inconsistent results.

OpenCL Performance Counter Accuracy For Radeon 6000 Series GPUs

The following performance counter values may not be accurate for OpenCL applications running on Radeon 6000 Series GPUs:

  • Wavefronts, VALUInsts, SALUInsts, SALUBusy, VALUUtilization: These values should be representative of performance, but may not be 100% accurate.

OpenGL FetchSize Counter on Radeon RX 6000 Series GPUs

FetchSize counter will show an error when enabled on Radeon RX 6000 Series GPUs using OpenGL.

Ubuntu 20.04 LTS Vulkan ICD Issue

On Ubuntu 20.04 LTS, Vulkan ICD may not be set to use AMD Vulkan ICD. In this case, it needs to be explicitly set to use AMD Vulkan ICD before using the GPA. It can be done by setting the VK_ICD_FILENAMES environment variable to /etc/vulkan/icd.d/amd_icd64.json.

Adjusting Linux Clock Mode

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: sudo chmod ugo+w /sys/class/drm/card0/device/power_dpm_force_performance_level

  • Note that changing the permissions on a system file like this could circumvent security.
  • On multi-GPU systems you may have to replace "card0" with the appropriate card number.
  • You may have to reboot the system for the change to take effect.
  • 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.

Profiling Bundles

Profiling bundles in DirectX12 and Vulkan is not working properly. It is recommended to remove those GPA Samples from your application, or move the calls out of the bundle for profiling.

Style and Format Change

The source code of this product is being reformatted to follow the Google C++ Style Guide https://google.github.io/styleguide/cppguide.html. In the interim you may encounter a mix of both an older C++ coding style, as well as the newer Google C++ Style. Please refer to the .clang-format file in the root directory of the product for additional style information.

gpu_performance_api's People

Contributors

amitprakash07 avatar cal3d avatar chesik-amd avatar eelliott-amd avatar jcortell68 avatar jdrouan-goog avatar luochenhuan avatar plohrmannamd avatar roobre avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gpu_performance_api's Issues

GPA is not library friendly

GPA usage of CMake is very awkward making it difficult to simply include GPA into an existing large project by setting variables and then calling add_subdirectory. Currently doing so causes the build process to produce binary paths that can't be found.

GPA_OpenContext for ROCm/hip application

I am a researcher at Univerity of Lisbon (Portugal) and I want to use GPA to profile ROCm/hip applications. I see that there's no example of how to this for ROCm.
Can you give me a hint on how should I fill the context to pass to GPA_OpenContext() or a general example of the use of the tool to profile a ROCm kernel?

As for now, my codes looks like this:
GPA_ROCm_Context gpaContext;
gpaContext.m_pAgent = ????
gpaContext.m_pQueue = ????
GPA_Status status = g_pFuncTable->GPA_OpenContext(&gpaContext, GPA_OPENCONTEXT_ENABLE_HARDWARE_COUNTERS_BIT, &contextId);

As an attachment, I send my example code and a makefile
Makefile.txt
vectoradd_hip.cpp.txt

Thank you

Where is DeviceInfo.h?

... and other source files for ../../Src/DeviceInfo/?

root@rig-AMD:/opt/GPA/Build/Linux# bash ./build.sh 
Build GPUPerfAPI, 64-bit...
Failed to build GPUPerfAPI, 64 bit

root@rig-AMD:/opt/GPA/Build/Linux# tail GPUPerfAPI_Build.log 
In file included from ../GPUPerfAPI-Common/IGPAContext.h:12:0,
             from ../GPUPerfAPI-Common/GPAContext.h:17,
             from ../GPUPerfAPI-Common/GPAPass.h:18,
             from ../GPUPerfAPI-Common/IGPACommandList.h:13,
             from ../GPUPerfAPI-Common/GPUPerfAPI.cpp:25:
../GPUPerfAPI-Common/GPAHWInfo.h:12:24: fatal error: DeviceInfo.h: No such file or directory
compilation terminated.
../../Build/Linux/CommonTargets.mk:56: recipe for target '../../Output/obj/release/x64/GPUPerfAPI      /GPUPerfAPI.o' failed
make: *** [../../Output/obj/release/x64/GPUPerfAPI/GPUPerfAPI.o] Error 1

make: Leaving directory '/opt/GPA/Src/GPUPerfAPI'

Resetting sessions possible?

Is it possible to reset a session or is it by design that this is not possible? Looking through the code, the state of a session does not ever return to GPA_SESSION_STATE_NOT_STARTED once it leaves it.

This implies that a session object cannot be reused and requires create/delete for every sample. Just looking to verify the behavior.

GPA seems to be incompatible with Vulkan 1.1.73.0

I downloaded GPA for Windows and proceeded with installation guided by manual. After UpdateCommon.py script finished the building stage was failed for GPUPerfAPIVK due to struct redefinition.
The error is:

1>VkGPAImplementor.cpp
1>c:\users\igazizov\downloads\gpa\common\src\amdvkext\vk_amd_shader_core_properties.h(45): error C2011: 'VkPhysicalDeviceShaderCorePropertiesAMD': 'struct' type redefinition
1>c:\vulkansdk\1.1.73.0\include\vulkan\vulkan_core.h(7416): note: see declaration of 'VkPhysicalDeviceShaderCorePropertiesAMD'
1>c:\users\igazizov\downloads\gpa\gpa-master\src\gpuperfapivk\vkgpaimplementor.cpp(56): error C2079: 'shaderCorePropertiesAMD' uses undefined struct 'VkPhysicalDeviceShaderCorePropertiesAMD'

As it turned out, VkPhysicalDeviceShaderCorePropertiesAMD structure in vk_amd_shader_core_properties.h is the same as in vulkan_core.h. That is why the error is present.

I commented out the structure in vk_amd_shader_core_properties.h and managed to build the project. The issue might be in the difference between new and old versions of Vulkan API. I am submitting the issue just to confirm this assumption.

Thank you in advance,
Ilias

example of opencl

Hi,
Is there any example to show how to use this tool with a OpenCL application?

Best,
Trinayan

Fresh pull, Common updated, build failed: could not open include files

I hate to be "that guy" but I would have thought following the readme would result in an operational build.

Build output:

1>------ Build started: Project: GPUPerfAPIDX, Configuration: Debug x64 ------
2>------ Skipped Build: Project: Documentation, Configuration: Debug Win32 ------
2>Project not selected to build for this solution configuration
3>------ Build started: Project: GPUPerfAPICounterGenerator, Configuration: Debug x64 ------
1> DXUtils.cpp
3> GPACounterGeneratorBase.cpp
1>c:\users\god\workspace\ext\gpa-master\src\gpuperfapidx\dxUtils.h(13): fatal error C1083: Cannot open include file: 'GPUPerfAPITypes.h': No such file or directory
3>c:\users\god\workspace\ext\gpa-master\src\gpuperfapicountergenerator\GPAInternalCounter.h(11): fatal error C1083: Cannot open include file: 'GPUPerfAPITypes.h': No such file or directory
3> GPACounterGeneratorCommon.cpp
3>c:\users\god\workspace\ext\gpa-master\src\gpuperfapicountergenerator\GPACounterGeneratorCommon.h(13): fatal error C1083: Cannot open include file: 'GPUPerfAPITypes.h': No such file or directory
3> GPACounterGeneratorDX11.cpp
3>c:\users\god\workspace\ext\gpa-master\src\gpuperfapicountergenerator\GPAInternalCounter.h(11): fatal error C1083: Cannot open include file: 'GPUPerfAPITypes.h': No such file or directory
3> GPACounterGeneratorDX11Base.cpp
3>c:\users\god\workspace\ext\gpa-master\src\gpuperfapicountergenerator\GPAInternalCounter.h(11): fatal error C1083: Cannot open include file: 'GPUPerfAPITypes.h': No such file or directory
3> GPACounterGeneratorDX11NonAMD.cpp
3>c:\users\god\workspace\ext\gpa-master\src\gpuperfapicountergenerator\GPAInternalCounter.h(11): fatal error C1083: Cannot open include file: 'GPUPerfAPITypes.h': No such file or directory
3> GPACounterGeneratorDX12.cpp
3>c:\users\god\workspace\ext\gpa-master\src\gpuperfapicountergenerator\GPAInternalCounter.h(11): fatal error C1083: Cannot open include file: 'GPUPerfAPITypes.h': No such file or directory
3> GPACounterGeneratorGL.cpp
3>c:\users\god\workspace\ext\gpa-master\src\gpuperfapicountergenerator\GPAInternalCounter.h(11): fatal error C1083: Cannot open include file: 'GPUPerfAPITypes.h': No such file or directory
3> GPACounterGeneratorHSA.cpp
3>c:\users\god\workspace\ext\gpa-master\src\gpuperfapicountergenerator\GPAInternalCounter.h(11): fatal error C1083: Cannot open include file: 'GPUPerfAPITypes.h': No such file or directory
3> GPACounterGeneratorSchedulerManager.cpp
3>c:\users\god\workspace\ext\gpa-master\src\gpuperfapicountergenerator\GPACounterGeneratorSchedulerManager.h(16): fatal error C1083: Cannot open include file: 'GPUPerfAPITypes.h': No such file or directory
3> GPACounterSchedulerBase.cpp
3>c:\users\god\workspace\ext\gpa-master\src\gpuperfapicountergenerator\GPAICounterAccessor.h(13): fatal error C1083: Cannot open include file: 'GPUPerfAPITypes.h': No such file or directory
3> GPACounterSchedulerCL.cpp
3>c:\users\god\workspace\ext\gpa-master\src\gpuperfapicountergenerator\GPAICounterAccessor.h(13): fatal error C1083: Cannot open include file: 'GPUPerfAPITypes.h': No such file or directory
3> GPACounterSchedulerDX11.cpp
3>c:\users\god\workspace\ext\gpa-master\src\gpuperfapicountergenerator\GPAInternalCounter.h(11): fatal error C1083: Cannot open include file: 'GPUPerfAPITypes.h': No such file or directory
3> GPACounterSchedulerDX12.cpp
3>c:\users\god\workspace\ext\gpa-master\src\gpuperfapicountergenerator\GPAICounterAccessor.h(13): fatal error C1083: Cannot open include file: 'GPUPerfAPITypes.h': No such file or directory
3> GPACounterSchedulerGL.cpp
3>c:\users\god\workspace\ext\gpa-master\src\gpuperfapicountergenerator\GPAICounterAccessor.h(13): fatal error C1083: Cannot open include file: 'GPUPerfAPITypes.h': No such file or directory
3> GPACounterSchedulerHSA.cpp
3>c:\users\god\workspace\ext\gpa-master\src\gpuperfapicountergenerator\GPAICounterAccessor.h(13): fatal error C1083: Cannot open include file: 'GPUPerfAPITypes.h': No such file or directory
3> GPAInternalCountersFiji.cpp
3>c:\users\god\workspace\ext\gpa-master\src\gpuperfapicountergenerator\GPAInternalCounter.h(11): fatal error C1083: Cannot open include file: 'GPUPerfAPITypes.h': No such file or directory
3> GPAInternalCountersGfx6.cpp
3>c:\users\god\workspace\ext\gpa-master\src\gpuperfapicountergenerator\GPAInternalCounter.h(11): fatal error C1083: Cannot open include file: 'GPUPerfAPITypes.h': No such file or directory
3> GPAPublicCounters.cpp
3>c:\users\god\workspace\ext\gpa-master\src\gpuperfapicountergenerator\GPAPublicCounters.h(12): fatal error C1083: Cannot open include file: 'GPUPerfAPIOS.h': No such file or directory
3> GPASplitCountersConsolidatedDX12.cpp
3>c:\users\god\workspace\ext\gpa-master\src\gpuperfapicountergenerator\GPAPublicCounters.h(12): fatal error C1083: Cannot open include file: 'GPUPerfAPIOS.h': No such file or directory
3> GPASwCounterManager.cpp
3>c:\users\god\workspace\ext\gpa-master\src\gpuperfapicountergenerator\GPAInternalCounter.h(11): fatal error C1083: Cannot open include file: 'GPUPerfAPITypes.h': No such file or directory
3> Generating Code...
3> Compiling...
3> InternalCountersCLGfx6.cpp
3>c:\users\god\workspace\ext\gpa-master\src\gpuperfapicountergenerator\GPAInternalCounter.h(11): fatal error C1083: Cannot open include file: 'GPUPerfAPITypes.h': No such file or directory
3> InternalCountersCLGfx7.cpp
3>c:\users\god\workspace\ext\gpa-master\src\gpuperfapicountergenerator\GPAInternalCounter.h(11): fatal error C1083: Cannot open include file: 'GPUPerfAPITypes.h': No such file or directory
3> InternalCountersCLGfx8.cpp
3>c:\users\god\workspace\ext\gpa-master\src\gpuperfapicountergenerator\GPAInternalCounter.h(11): fatal error C1083: Cannot open include file: 'GPUPerfAPITypes.h': No such file or directory
3> InternalCountersDX11Gfx6.cpp
3>c:\users\god\workspace\ext\gpa-master\src\gpuperfapicountergenerator\GPAInternalCounter.h(11): fatal error C1083: Cannot open include file: 'GPUPerfAPITypes.h': No such file or directory
3> InternalCountersDX11Gfx7.cpp
3>c:\users\god\workspace\ext\gpa-master\src\gpuperfapicountergenerator\GPAInternalCounter.h(11): fatal error C1083: Cannot open include file: 'GPUPerfAPITypes.h': No such file or directory
3> InternalCountersDX11Gfx8.cpp
3>c:\users\god\workspace\ext\gpa-master\src\gpuperfapicountergenerator\GPAInternalCounter.h(11): fatal error C1083: Cannot open include file: 'GPUPerfAPITypes.h': No such file or directory
3> InternalCountersGLGfx6.cpp
3>c:\users\god\workspace\ext\gpa-master\src\gpuperfapicountergenerator\GPAInternalCounter.h(11): fatal error C1083: Cannot open include file: 'GPUPerfAPITypes.h': No such file or directory
3> InternalCountersGLGfx7.cpp
3>c:\users\god\workspace\ext\gpa-master\src\gpuperfapicountergenerator\GPAInternalCounter.h(11): fatal error C1083: Cannot open include file: 'GPUPerfAPITypes.h': No such file or directory
3> InternalCountersGLGfx8.cpp
3>c:\users\god\workspace\ext\gpa-master\src\gpuperfapicountergenerator\GPAInternalCounter.h(11): fatal error C1083: Cannot open include file: 'GPUPerfAPITypes.h': No such file or directory
3> InternalCountersHSAGfx7.cpp
3>c:\users\god\workspace\ext\gpa-master\src\gpuperfapicountergenerator\GPAInternalCounter.h(11): fatal error C1083: Cannot open include file: 'GPUPerfAPITypes.h': No such file or directory
3> InternalCountersHSAGfx8.cpp
3>c:\users\god\workspace\ext\gpa-master\src\gpuperfapicountergenerator\GPAInternalCounter.h(11): fatal error C1083: Cannot open include file: 'GPUPerfAPITypes.h': No such file or directory
3> PublicCounterDefsCLGfx6.cpp
3>c:\users\god\workspace\ext\gpa-master\src\gpuperfapicountergenerator\GPAPublicCounters.h(12): fatal error C1083: Cannot open include file: 'GPUPerfAPIOS.h': No such file or directory
3> PublicCounterDefsCLGfx7.cpp
3>c:\users\god\workspace\ext\gpa-master\src\gpuperfapicountergenerator\GPAPublicCounters.h(12): fatal error C1083: Cannot open include file: 'GPUPerfAPIOS.h': No such file or directory
3> PublicCounterDefsCLGfx8.cpp
3>c:\users\god\workspace\ext\gpa-master\src\gpuperfapicountergenerator\GPAPublicCounters.h(12): fatal error C1083: Cannot open include file: 'GPUPerfAPIOS.h': No such file or directory
3> GPACounterGeneratorCL.cpp
3>c:\users\god\workspace\ext\gpa-master\src\gpuperfapicountergenerator\GPAInternalCounter.h(11): fatal error C1083: Cannot open include file: 'GPUPerfAPITypes.h': No such file or directory
3> GPACounterGenerator.cpp
3>c:\users\god\workspace\ext\gpa-master\src\gpuperfapicountergenerator\GPAICounterAccessor.h(13): fatal error C1083: Cannot open include file: 'GPUPerfAPITypes.h': No such file or directory
3> PublicCounterDefsDX11Gfx6.cpp
3>c:\users\god\workspace\ext\gpa-master\src\gpuperfapicountergenerator\GPAPublicCounters.h(12): fatal error C1083: Cannot open include file: 'GPUPerfAPIOS.h': No such file or directory
3> PublicCounterDefsDX11Gfx7.cpp
3>c:\users\god\workspace\ext\gpa-master\src\gpuperfapicountergenerator\GPAPublicCounters.h(12): fatal error C1083: Cannot open include file: 'GPUPerfAPIOS.h': No such file or directory
3> PublicCounterDefsDX11Gfx8.cpp
3>c:\users\god\workspace\ext\gpa-master\src\gpuperfapicountergenerator\GPAPublicCounters.h(12): fatal error C1083: Cannot open include file: 'GPUPerfAPIOS.h': No such file or directory
3> PublicCounterDefsGLGfx6.cpp
3>c:\users\god\workspace\ext\gpa-master\src\gpuperfapicountergenerator\GPAPublicCounters.h(12): fatal error C1083: Cannot open include file: 'GPUPerfAPIOS.h': No such file or directory
3> Generating Code...
3> Compiling...
3> PublicCounterDefsGLGfx7.cpp
3>c:\users\god\workspace\ext\gpa-master\src\gpuperfapicountergenerator\GPAPublicCounters.h(12): fatal error C1083: Cannot open include file: 'GPUPerfAPIOS.h': No such file or directory
3> PublicCounterDefsGLGfx8.cpp
3>c:\users\god\workspace\ext\gpa-master\src\gpuperfapicountergenerator\GPAPublicCounters.h(12): fatal error C1083: Cannot open include file: 'GPUPerfAPIOS.h': No such file or directory
3> PublicCounterDefsHSAGfx7.cpp
3>c:\users\god\workspace\ext\gpa-master\src\gpuperfapicountergenerator\GPAPublicCounters.h(12): fatal error C1083: Cannot open include file: 'GPUPerfAPIOS.h': No such file or directory
3> PublicCounterDefsHSAGfx8.cpp
3>c:\users\god\workspace\ext\gpa-master\src\gpuperfapicountergenerator\GPAPublicCounters.h(12): fatal error C1083: Cannot open include file: 'GPUPerfAPIOS.h': No such file or directory
3> Generating Code...
4>------ Build started: Project: GPUPerfAPICounters, Configuration: Debug x64 ------
5>------ Build started: Project: GPUPerfAPIGL, Configuration: Debug x64 ------
6>------ Build started: Project: GPUPerfAPIGLES, Configuration: Debug x64 ------
7>------ Build started: Project: GPUPerfAPICL, Configuration: Debug x64 ------
5> GLPerfMonitorCache.cpp
4> GPUPerfAPICounters.cpp
4>c:\users\god\workspace\ext\gpa-master\src\gpuperfapicountergenerator\GPAICounterAccessor.h(13): fatal error C1083: Cannot open include file: 'GPUPerfAPITypes.h': No such file or directory
8>------ Build started: Project: GPUPerfAPIUnitTests, Configuration: Debug x64 ------
6> GLPerfMonitorCache.cpp
7> CLPerfCounterAMDExtension.cpp
7>c:\users\god\workspace\ext\gpa-master\src\gpuperfapicl\CLRTModuleLoader.h(12): fatal error C1083: Cannot open include file: 'APIRTModuleLoader.h': No such file or directory
7> CLPerfCounterBlock.cpp
8>LINK : fatal error LNK1104: cannot open file 'C:\Users\god\Workspace\Ext\GPA-master\Output\Debug\bin\GPUPerfAPICounterGenerator-x64-d.lib'
9>------ Build started: Project: GPUPerfAPIDX12, Configuration: Debug x64 ------
5>....\Src\GPUPerfAPIGL\GLPerfMonitorCache.cpp(10): fatal error C1083: Cannot open include file: 'Logging.h': No such file or directory
5> GPUPerfAPIGL.cpp
7>c:\users\god\workspace\ext\gpa-master\src\gpuperfapicl\CLRTModuleLoader.h(12): fatal error C1083: Cannot open include file: 'APIRTModuleLoader.h': No such file or directory
7> GPUPerfAPICL.cpp
5>c:\users\god\workspace\ext\gpa-master\src\gpuperfapigl../GPUPerfAPICounterGenerator/GPACounterGenerator.h(14): fatal error C1083: Cannot open include file: 'GPUPerfAPITypes.h': No such file or directory
5> Generating Code...
7>c:\users\god\workspace\ext\gpa-master\src\gpuperfapicl../GPUPerfAPICounterGenerator/GPACounterGenerator.h(14): fatal error C1083: Cannot open include file: 'GPUPerfAPITypes.h': No such file or directory
7> Generating Code...
6>....\Src\GPUPerfAPIGL\GLPerfMonitorCache.cpp(10): fatal error C1083: Cannot open include file: 'Logging.h': No such file or directory
9> DX12CommandListSwQueries.cpp
6> GPUPerfAPIGL.cpp
9>....\Src\GPUPerfAPIDX12\DX12CommandListSwQueries.cpp(8): fatal error C1083: Cannot open include file: 'Logging.h': No such file or directory
6>c:\users\god\workspace\ext\gpa-master\src\gpuperfapigl../GPUPerfAPICounterGenerator/GPACounterGenerator.h(14): fatal error C1083: Cannot open include file: 'GPUPerfAPITypes.h': No such file or directory
9> DX12CommandListSWQueryGroup.cpp
6> Generating Code...
9>c:\users\god\workspace\ext\gpa-master\src\gpuperfapidx12\DX12CommandListSWQueryGroup.h(11): fatal error C1083: Cannot open include file: 'GPUPerfAPITypes.h': No such file or directory
9> DX12CounterDataRequestProxy.cpp
9>c:\users\god\workspace\ext\gpa-master\src\gpuperfapidx12\DX12DataRequest.h(11): fatal error C1083: Cannot open include file: 'GPADataRequest.h': No such file or directory
9> DX12DataRequest.cpp
9>c:\users\god\workspace\ext\gpa-master\src\gpuperfapidx12\DX12DataRequest.h(11): fatal error C1083: Cannot open include file: 'GPADataRequest.h': No such file or directory
9> DX12SoftwareCounterDataRequest.cpp
9>c:\users\god\workspace\ext\gpa-master\src\gpuperfapidx12\DX12DataRequest.h(11): fatal error C1083: Cannot open include file: 'GPADataRequest.h': No such file or directory
9> DX12Utils.cpp
9>c:\users\god\workspace\ext\gpa-master\src\gpuperfapidx12\DX12Utils.h(13): fatal error C1083: Cannot open include file: 'GPUPerfAPITypes.h': No such file or directory
9> GPAContextStateDX12.cpp
9>c:\users\god\workspace\ext\gpa-master\src\gpuperfapidx12\GPAContextStateDX12.h(17): fatal error C1083: Cannot open include file: 'GPAContextState.h': No such file or directory
9> GPUPerfAPIDX12.cpp
9>....\Src\GPUPerfAPIDX12\GPUPerfAPIDX12.cpp(11): fatal error C1083: Cannot open include file: 'GPUPerfAPIImp.h': No such file or directory
9> Generating Code...
========== Build: 0 succeeded, 8 failed, 2 up-to-date, 1 skipped ==========

Radeon Pro WX 5100 not supported?

Hello,
I got several error messages when using renderdoc + gpa.

OpenGL driver version is too old. Plesase update your driver.
Unable to obtain asic infomation.
Unable to get hardware information from the API.
Device not supported.
Open context for counters failed. GPA Error: Hardware Not Supported.

System Info:
Ubuntu-20.04.3
renderdoc-v1.17
amdgpu-install_21.40.2.40502-1_all.deb
mesa-21.3.0-devel
Radeon Pro WX 5100 device id is 0x67c7, revision id is 0x00.

build error on Ubuntu 18.04.03 LTS

I ran the following:

python PreBuild.py 
cd CMakeBuild/x64/debug
make

I get build errors including:

[ 73%] Linking CXX shared library ../../../../../Output/release/libGPUPerfAPIGL.so
[ 73%] Built target GPUPerfAPIGL
Scanning dependencies of target GPUPerfAPIVK
[ 73%] Building CXX object Src/GPUPerfAPIVk/CMakeFiles/GPUPerfAPIVK.dir/VkCommandListSwQueries.cpp.o
In file included from /home/pemgithub/pemCode/GPUOpen/GPA/Src/GPUPerfAPIVk/VkIncludes.h:19:0,
                 from /home/pemgithub/pemCode/GPUOpen/GPA/Src/GPUPerfAPIVk/VkSoftwareCountersResults.h:11,
                 from /home/pemgithub/pemCode/GPUOpen/GPA/Src/GPUPerfAPIVk/VkCommandListSWQueryGroup.h:12,
                 from /home/pemgithub/pemCode/GPUOpen/GPA/Src/GPUPerfAPIVk/VkCommandListSwQueries.h:13,
                 from /home/pemgithub/pemCode/GPUOpen/GPA/Src/GPUPerfAPIVk/VkCommandListSwQueries.cpp:9:
/home/pemgithub/pemCode/GPUOpen/GPA/../Common/Src/AmdVkExt/vk_amd_shader_core_properties2.h:59:16: error: redefinition of ‘struct VkPhysicalDeviceShaderCoreProperties2AMD’
 typedef struct VkPhysicalDeviceShaderCoreProperties2AMD {
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/vulkan/vulkan.h:21:0,
                 from /home/pemgithub/pemCode/GPUOpen/GPA/Src/GPUPerfAPIVk/VkIncludes.h:11,
                 from /home/pemgithub/pemCode/GPUOpen/GPA/Src/GPUPerfAPIVk/VkSoftwareCountersResults.h:11,
                 from /home/pemgithub/pemCode/GPUOpen/GPA/Src/GPUPerfAPIVk/VkCommandListSWQueryGroup.h:12,
                 from /home/pemgithub/pemCode/GPUOpen/GPA/Src/GPUPerfAPIVk/VkCommandListSwQueries.h:13,
                 from /home/pemgithub/pemCode/GPUOpen/GPA/Src/GPUPerfAPIVk/VkCommandListSwQueries.cpp:9:
/usr/include/vulkan/vulkan_core.h:9569:16: note: previous definition of ‘struct VkPhysicalDeviceShaderCoreProperties2AMD’
 typedef struct VkPhysicalDeviceShaderCoreProperties2AMD {
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/pemgithub/pemCode/GPUOpen/GPA/Src/GPUPerfAPIVk/VkIncludes.h:19:0,
                 from /home/pemgithub/pemCode/GPUOpen/GPA/Src/GPUPerfAPIVk/VkSoftwareCountersResults.h:11,
                 from /home/pemgithub/pemCode/GPUOpen/GPA/Src/GPUPerfAPIVk/VkCommandListSWQueryGroup.h:12,
                 from /home/pemgithub/pemCode/GPUOpen/GPA/Src/GPUPerfAPIVk/VkCommandListSwQueries.h:13,
                 from /home/pemgithub/pemCode/GPUOpen/GPA/Src/GPUPerfAPIVk/VkCommandListSwQueries.cpp:9:
/home/pemgithub/pemCode/GPUOpen/GPA/../Common/Src/AmdVkExt/vk_amd_shader_core_properties2.h:64:3: error: conflicting declaration ‘typedef int VkPhysicalDeviceShaderCoreProperties2AMD’
 } VkPhysicalDeviceShaderCoreProperties2AMD;
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/vulkan/vulkan.h:21:0,
                 from /home/pemgithub/pemCode/GPUOpen/GPA/Src/GPUPerfAPIVk/VkIncludes.h:11,
                 from /home/pemgithub/pemCode/GPUOpen/GPA/Src/GPUPerfAPIVk/VkSoftwareCountersResults.h:11,
                 from /home/pemgithub/pemCode/GPUOpen/GPA/Src/GPUPerfAPIVk/VkCommandListSWQueryGroup.h:12,
                 from /home/pemgithub/pemCode/GPUOpen/GPA/Src/GPUPerfAPIVk/VkCommandListSwQueries.h:13,
                 from /home/pemgithub/pemCode/GPUOpen/GPA/Src/GPUPerfAPIVk/VkCommandListSwQueries.cpp:9:
/usr/include/vulkan/vulkan_core.h:9574:3: note: previous declaration as ‘typedef struct VkPhysicalDeviceShaderCoreProperties2AMD VkPhysicalDeviceShaderCoreProperties2AMD’
 } VkPhysicalDeviceShaderCoreProperties2AMD;
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Src/GPUPerfAPIVk/CMakeFiles/GPUPerfAPIVK.dir/build.make:62: recipe for target 'Src/GPUPerfAPIVk/CMakeFiles/GPUPerfAPIVK.dir/VkCommandListSwQueries.cpp.o' failed
make[2]: *** [Src/GPUPerfAPIVk/CMakeFiles/GPUPerfAPIVK.dir/VkCommandListSwQueries.cpp.o] Error 1
CMakeFiles/Makefile2:420: recipe for target 'Src/GPUPerfAPIVk/CMakeFiles/GPUPerfAPIVK.dir/all' failed
make[1]: *** [Src/GPUPerfAPIVk/CMakeFiles/GPUPerfAPIVK.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

Southern Islands support

Hello,

Thanks for the work you have done here, GPA is a really nice library. I see that you have added Volcanic Islands support in a recent release, and I was wondering if Southern Islands support for Vulkan is somewhere near in the roadmap.

I certainly know it's a kind of old architecture, but some GPUs using it (like E8860) are being actively used in the embedded/realtime world, so we would really appreciate support for them.

Thanks in advance for your time

Counter nanoseconds do not correspond to Vulkan pipeline statistics

The documentation and the code both state "nanoseconds" for various derived counters. This doesn't seem to be correct when compared to Vulkan's pipeline statistics. A sample profiling primitive assembly shows the following with GPA:
GPUTime = 2489.508102
ExecutionDuration = 2489.076102
ExecutionStart = 6431344343.079865
ExecutionEnd = 6431349323.608068

The exact same command buffer shows:
GPU Time = 3.411704 (ms)
GPU Start Time = 8822159.163976 (ms)
GPU End Time = 8822162.575679 (ms)
This is worked out by multiplying the timestamp query with the device's timestampPeriod and then converting nanoseconds to milliseconds.

Using start/end time as hint, the time unit that makes the most sense for GPA's values is possibly microseconds.

Am I somehow misinterpreting this?

When is the correct time to call GpaCopySecondarySamples in Vulkan?

The document only states that for secondary command buffer we need to call this, but didn't state when is the correct time to call this. Should I call it after the vkCmdExecuteCommands for primary command buffer or vkEndCommandBuffer or any other places? Is there an example for this?

build.sh(s) are not executable

On Linux, build.sh files should be set executable, otherwise must "bash build.sh", which is OK but not what the documentation says.

Runtime crash when HSA_TOOLS_LIB is set outside of GPA.

I'm using GPA in conjunction with some code that is also attempting to wrap the HSA runtime, and setting the HSA_TOOLS_LIB variable in the environment seems to disturb the initialization phase of GPA.

In SetHSAToolsLibEnvVar, the hsa-runtime-tools64 library will be overwritten with the current contents of HSA_TOOLS_LIB if the environment variable is set. This will lead to HSA skipping the OnLoad function for this library and most likely result in a segfault later when one of the tools lib functions is called. For me this was hsa_ext_tools_set_callback_functions a few levels down into GPA_OpenContext.

I'm fixing this on my end currently by including the hsa tools lib in my variable string, but this should probably be checked in the set tools lib function.

ABI Incompatible Use of Bool

Hi,

I noticed that within GPUPerfAPITypes.h the following code appears:

#ifndef __cplusplus typedef gpa_uint8 bool; #endif

I am concerned that this will introduce a differently sized type between C and C++, and will therefore introduce ABI issues into the shared library. In my opinion, the bool type should not be used anywhere that ABI must be maintained, so it would be best if this was fixed to be an integer type only.

Build failure

When I execute build.sh It succeeds up to a point and then fails as seen below. What can be done to resolve this issue?
"
Build GPUPerfAPI-Common, 64-bit...
Build GPUPerfAPI-Common, 32-bit...
Build DeviceInfo, 64-bit...
Build DeviceInfo, 32-bit...
Build GPUPerfAPICounterGenerator, 64-bit...
Failed to build GPUPerfAPICounterGenerator, 64 bit "

Multiple Sesions at the same time

Hi, I want to profile two parallel pipelines and I have created two Sessions linked to each pipeline but the results I am getting are quite surprising. Is it possible that the sessions are interfering with each other?

thank you!

Documentation Issue

On page 31 of the PDF documentation, GPA_GetCounterDescription has a GPA_Type argument, but the header specifies the argument should be a const char**.

Vulkan support

Are there plans for Vulkan support with hardware-based counters or should we just use Radeon GPU-Profiler for traces and hw counters on Vulkan and/or DX12?

Navi Vertex Shader counters read 0

After integrating GPA into a custom OpenGL based engine, it appears that on Navi (specifically a 5700XT Anniversary Edition), the VSVALUInstCount, VSSALUInstCount and associated Busy and BusyCycles counters always read 0. After doing some digging, it appears that the GS0 set of hardware counters might contain these and related values, which I'm assuming is due to how Navi cards support mesh shaders.
Thus, my question is, is this assumption correct? Is this a bug in GPA regarding mapping hardware counter names to the human readable counter names?
I realize that these values being inaccurate is a known issue, however a reading of 0 is clearly not representative of performance.

This is NOT awesome

I wish I had all the errors but this just a few. So far I have only had two successful builds. None of the install scripts work and this is primarily the results. So after hours of trying I've accomplished exactly nothing. With cmake that doesn't surprise since it's giant dumpster fire to begin with but this is insane. I don't write this so I count on those that do to get it right. This sucks. Oh year, this is the reult of having to replace the one that was downloaded to one I pulled from here today and this was my results.

CMake Error at CMakeLists.txt:9 (include):
include called with wrong number of arguments. include() only takes one
file.

CMake Error at CMakeLists.txt:37 (include):
include called with wrong number of arguments. include() only takes one
file.

CMake Error at CMakeLists.txt:9 (include):
include could not find requested file:

/common.cmake                                                                                                                                                                                                                        

CMake Error at CMakeLists.txt:37 (include):
include could not find requested file:

/Common.cmake                                                                                                                                                                                                                        

CMake Error at CMakeLists.txt:57 (REMOVE_TARGET_FROM_BUILD):
Unknown CMake command "REMOVE_TARGET_FROM_BUILD".

CMake Error at counter_generator_common.cmake:9 (include):
include could not find requested file:

/common.cmake                                                                                                                                                                                                                        

Call Stack (most recent call first):
CMakeLists.txt:6 (include)

CMake Error at counter_generator_common.cmake:10 (include):
include called with wrong number of arguments. include() only takes one
file.
Call Stack (most recent call first):
CMakeLists.txt:6 (include)

CMake Error at counter_generator_common.cmake:11 (include):
include called with wrong number of arguments. include() only takes one
file.
Call Stack (most recent call first):
CMakeLists.txt:6 (include)

CMake Error at counter_generator_common.cmake:12 (include):
include called with wrong number of arguments. include() only takes one
file.
Call Stack (most recent call first):
CMakeLists.txt:6 (include)

CMake Error at counter_generator_common.cmake:13 (include):
include called with wrong number of arguments. include() only takes one
file.
Call Stack (most recent call first):
CMakeLists.txt:6 (include)

Does GPUPerfAPI supports Ryzen 6000 series for all RDNA2 perf. counters and Ryzen 5 4600H for all vega perf. counters?

Hello.

I am trying to profile graphic workloads with AMD tools in Lap top. The GPU metrics I am mostly intersted in is L1/L2/L3 cache hit/miss count.

I want to double check that which GPU performance counter is provided in Ryzen 6000 series and Ryzen 5 4600H through GPUPerfAPI.

  1. GPUPerfAPI document says L1/L2 CacheHit/Miss Count is provided in GCN2 and vega architecutre. Does it still hold for integrated GPU like Radeon 660M in Ryzen 6000 series and Ryzen 5 4600H with Radeon™ Vega Graphics?

  2. Lastly if there are other APUs which provide L1/L2/L3 cache hit/miss count, it would be really helpful.

Thank you very much.

VS2015 SLN and Projects Fail to Open due to Incorrect Property Path

This is incorrect, and causes all the projects to fail to load:
GPA-master\GPUPerfAPI\Build\VS2015\GPA-Common.props(5,9): The imported project "GPA-master\Common\Src\Vsprops\Global-Common.props" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk.

The file is actually in:
"GPA-master\GPUPerfAPI\Build\VS2015\GPA-Common.props"

Actually, it looks like most of the *.props referenced are missing instead of just incorrect paths.

Questions about functionality

您好,我想知道您的项目中是否有关于AMD的GPU超频相关的操作
Hello, I want to know if there are any operations related to AMD GPU overclocking in your project

或者说?设置显存,核心的频率,风扇的转速,功耗,显存电压等相关操作
Or? Set the video memory, core frequency, fan speed, power consumption, video memory voltage and other related operations

抱歉我都英语并不是很好,我是使用翻译工具来进行翻译的
Sorry, my English is not very good. I use translation tools to translate

Documentation Typo

On page 38 of the documentation, under the subtitle "Get the Number of Passes Required for the Currently Enabled Set of Counters" appears "GPA_GetNumCounters". I believe that this should be "GPA_GetPassCount".

SplitCounters() susceptible to hangs (inifinite loop)

The various SplitCounters() method implementation have a loop that is susceptible to hangs given bad GPU data. E.g., for the GPU I was adding, there was a goof in the auto generated files that left a counter group with a max-counters of zero. When I ran the color cube app, it hung in GpaSplitCountersConsolidated::SplitSingleCounter() because CanCounterBeAdded() always returns false in that case, and so it just keeps trying to add it to the next pass, which will go on for billions of iterations.

while (done_allocating_counter == false)
{
 ....
}

The hang was time consuming to debug. I think we can probably pick some reasonable maximum pass count which is impractical in the real world, and error out (with a log statement) if the looping exceeds that.

I've seen this problematic pattern in at least one other method: GpaContextCounterMediator::ScheduleCounters()
There may be more.

Fixing frequency for GPU

Hi,
I'm trying to use GPA library, but I believe that the values of GPU performance counters strongly depend on the current GPU frequency. Is there any software way to force GPU to work on certain frequency? Global WattMan (which comes with AMD drivers for graphics cards) provides the opportunity to fix the frequency on the selected level, but I'd like to do it automatically in my application. Also, is there a counter, which shows GPU frequency?

macOS Version?

Hi,

Would it be possible to compile and use this API on macOS?

Thanks and regards,
Thierry

Sub-workload counter granularity

Hi, first of all thanks for publishing this library!

Looking trough the API I'm wondering if there is the possibility to sample workloads on a smaller granularity? If I understand it correctlt, it's currently only possible to get samples per draw/dispatch call for example but not possible to get information about the individual wavefronts in a similiar fashion and granularity as the Radeon GPU profiler (wavefront occupancy)?

Cheers

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.