Skip to content

Commit 78a84ea

Browse files
committed
GPA 3.0 release
1 parent cb682d1 commit 78a84ea

File tree

728 files changed

+574722
-195120
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

728 files changed

+574722
-195120
lines changed

.gitignore

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -246,9 +246,6 @@ FakesAssemblies/
246246
**/*.Server/ModelManifest.xml
247247
_Pvt_Extensions
248248

249-
# Linux unit test output
250-
Build/Linux/GPUPerfAPIUnitTests*.xml
251-
Src/GPUPerfAPIUnitTests/GPUPerfAPIUnitTests
252-
Src/GPUPerfAPIUnitTests/GPUPerfAPIUnitTests32
253-
Src/GPUPerfAPIUnitTests/GPUPerfAPIUnitTests-Internal
254-
Src/GPUPerfAPIUnitTests/GPUPerfAPIUnitTests32-Internal
249+
# Documentation build files
250+
docs/build
251+

.reviewboardrc

Lines changed: 0 additions & 4 deletions
This file was deleted.

BUILD.md

Lines changed: 45 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,27 @@
55
* [Windows Build Information](#windows-build-information)
66
* [Linux Build Information](#linux-build-information)
77
* [PublicCounterCompiler Tool](#publiccountercompiler-tool)
8+
* [Building the Documentation](#building-the-documentation)
89

910
## Cloning/Updating Dependent Repositories
1011
GPUPerfAPI no longer uses git submodules to reference dependent repositories. Instead, you need to follow these instructions in
1112
order to clone/update any dependent repositories.
1213

1314
#### Prerequisites
14-
* This step requires that python be installed on the system. Python can be installed from https://www.python.org/
15+
* Python, which can be installed from https://www.python.org/
1516

1617
#### Instructions
1718
* Simply execute the [UpdateCommon.py](Scripts/UpdateCommon.py) python script located in the [Scripts](Scripts) directory:
1819
* `python Scripts/UpdateCommon.py`
19-
This script will clone any dependent repositories that are not present on the system. If any of the dependent repositories are already
20+
* This script will clone any dependent repositories that are not present on the system. If any of the dependent repositories are already
2021
present on the system, this script will instead do a "git pull" on those repositories to ensure that they are up to date. Please re-run
2122
this script everytime you pull new changes from GPA repository.
23+
* This script will also download and execute the Vulkan™ SDK installer.
24+
* On Windows, running the installer may require elevation. If you've previously installed the required Vulkan version, UpdateCommon will simply copy the files form the default installation location into the correct place into the GPUPerfAPI directory tree.
25+
* UpdateCommon is set up to install the version of the Vulkan SDK which was used during development. If you want to use a newer version of the SDK, the following files will need to be updated:
26+
* [UpdateCommonMap.py](Scripts/UpdateCommonMap.py)
27+
* Linux-specific: [Common.mk](GPA/Build/Linux/Common.mk)
28+
* Windows-specific: Common/Lib/Ext/Global-Vulkan.props
2229

2330
## Windows Build Information
2431

@@ -45,23 +52,27 @@ this script everytime you pull new changes from GPA repository.
4552

4653
## Linux Build Information
4754

55+
##### Prerequisites
56+
* Install the Mesa common development package: sudo apt-get install mesa-common-dev
57+
* For 32-bit builds, install the multilib packages: sudo apt-get install gcc-multilib g++-multilib
58+
4859
##### Build Instructions
4960
* cd into the Build\Linux directory
5061
* Execute `./build.sh`
5162
* By default this performs a from-scratch build of the release versions of GPUPerfAPI, both 32-bit and 64-bit binaries.
5263
* The following arguments can be passed to build.sh to alter the build:
5364
* `debug`: performs a debug build
54-
* `skip32buildbuild`: skips building the 32-bit binaries
65+
* `skip32bitbuild`: skips building the 32-bit binaries
5566
* `skipopengl`: skips building the OpenGL version of GPUPerfAPI
56-
* `skipopengles`: skips building the OpenGLES version of GPUPerfAPI
5767
* `skipopencl`: skips building the OpenCL version of GPUPerfAPI
5868
* `skiphsa`: skips building the ROCm/HSA version of GPUPerfAPI
69+
* `skipvulkan`: skips building the Vulkan version of GPUPerfAPI
5970
* `quick` or `incremental`: performs an incremental build (as opposed to a from-scratch build)
6071
* `buildinternal`: builds the internal versions of GPUPerfAPI
6172
* `hsadir`: overrides the location of the ROCm/HSA header files (by default they are expected to be in /opt/rocm/hsa)
6273
* `gtestlibdir`: overrides the location of the GoogleTest libraries (by default they are expected to be in Common/Lib/Ext/GoogleTest/1-7/lib/gcc5/x64. There is also a gcc4.x-compatible version in Common/Lib/Ext/GoogleTest/1-7/lib/x64 for use when building on a system with gcc 4.x)
6374
* `gtestlibdir32`: overrides the location of the 32-bit GoogleTest libraries (by default they are expected to be in Common/Lib/Ext/GoogleTest/1-7/lib/gcc5/x86. There is also a gcc4.x-compatible version in Common/Lib/Ext/GoogleTest/1-7/lib/x86 for use when building on a system with gcc 4.x)
64-
* After a successful build, the GPUPerfAPI binaries can be found in their respective source file directories. For instance, the binaries for the OpenGL version of GPUPerfAPI (libGPUPerfAPIGL.so) can be found in the Src/GPUPerfAPIGL subdirectory.
75+
* After a successful build, the GPUPerfAPI binaries can be found in Output/bin.
6576
* Example build command line (builds the debug versions of the binaries, skipping the HSA library):
6677
* ./build.sh debug skiphsa
6778
* In addition to using the build.sh build script to build all of GPUPerfAPI, you can also build a single API library by executing `make` in that library's directory. This is useful when making localized changes in a single version of GPUPerfAPI. When using `make`, the following default targets are supported:
@@ -75,13 +86,14 @@ this script everytime you pull new changes from GPA repository.
7586
* `DbgInternalx86`: makes the 32-bit debug Internal version
7687
* `Make` is supported in the following directories (those marked with (*) are required to be built before the others, as they produce static libraries used by the others):
7788
* DeviceInfo (*)
89+
* GPUPerfAPI (*)
7890
* GPUPerfAPI-Common (*)
7991
* GPUPerfAPICounterGenerator (*)
8092
* GPUPerfAPICounters
8193
* GPUPerfAPICL
8294
* GPUPerfAPIGL
83-
* GPUPerfAPIGLES
8495
* GPUPerfAPIHSA
96+
* GPUPerfAPIVk
8597
* When using `make` to build the ROCM/HSA version of GPUPerfAPI, by default the HSA headers are expected to be in /opt/rocm/hsa. You can override this by specifying "HSA_DIR=<dir>" on the make command line:
8698
* Example: make Dbg HSA_DIR=/home/user/hsa_dir
8799
* When building the internal version, each binary filename will also have a "-Internal" suffix (for example libGPUPerfAPIGL-Internal.so)
@@ -90,29 +102,51 @@ this script everytime you pull new changes from GPA repository.
90102

91103
The PublicCounterCompiler Tool is a utility, written in C#, that will generate C++ code to define the public (or derived) counters.
92104
It takes as input text files contained in the [PublicCounterCompilerInputFiles](Src/PublicCounterCompilerInputFiles) directory and
93-
outputs files in the [GPUPerfAPICounterGenerator](Src/GPUPerfAPICounterGenerator) and [GPUPerfAPIUnitTests](Src/GPUPerfAPIUnitTests) directories.
105+
outputs files in the [GPUPerfAPICounterGenerator](Src/GPUPerfAPICounterGenerator), [GPUPerfAPIUnitTests](Src/GPUPerfAPIUnitTests)
106+
and [docs](docs) directories.
94107

95108
There are three ways to execute the tool:
96109
* With no parameters - it opens the user interface with no fields prepopulated
97110
* With two parameters - it opens the user interface with the two main fields prepopulated. When you press the "Compile Public Counters" button it will load the correct input files and generate the output files in the correct location.
98-
* Param 1: API -- the API to compile counters for (ex: GL, CL, HSA, DX11, etc).
111+
* Param 1: API -- the API to compile counters for (ex: GL, CL, HSA, DX11, DX12, VK, etc).
99112
* Param 2: HW generation: the generation to compile counters for (ex: Gfx6, Gfx7, Gfx8, etc.)
100-
* With five parameters - the user interface does not open. It simply generates the c++ files using the specified input and output file locations
113+
* With six or seven parameters - the user interface does not open. It simply generates the c++ files using the specified input and output file locations
101114
* Param 1: Counter names file - text file containing hardware counter names and type (CounterNames[API][GEN].txt)
102115
* Param 2: Public counter definition file - text file defining how the public counters are calculated (PublicCounterDefinitions\*.txt)
103116
* Param 3: Output Dir - the directory to generate the output in (Ex: the path to the GPUPerfAPICounterGenerator directory)
104117
* Param 4: Test output Dir - the directory to generate the test output in (Ex: the path to the GPUPerfAPIUnitTests/counters directory)
105-
* Param 5: Active section label - the label to take the counter names from (ex: dx11gfx6)
118+
* Param 5: API - the API to take the counter names from (ex: DX12)
119+
* Param 6: GPU - the GPU to take the counter names from (ex: Gfx9)
120+
* Param 7: GPU ASIC - (optional) the subversion of GPU to take the counter names from
106121

107122
See the various PublicCounterDefinitions\*.txt files in the [PublicCounterCompilerInputFiles](Src/PublicCounterCompilerInputFiles) directory. These contain all the counter definitions.
108123
Each counter is given a name, a description, a type, an optional usage type, a list of hardware counters required and a formula applied to the values of the hardware counters to calculate the value of the counter.
109124

110125
Counter formulas are expressed in a Reverse Polish Notation and are made up the following elements:
111126
* numbers: these are zero-based counter indexes referring to individual counters within the list of hardware counters
127+
* hardware counters may also be referred to by name (e.g.: GPUTime_Bottom_To_Bottom) or templated name (e.g.: SPI*_SPI_PERF_CSG_BUSY) which will automatically refer to the correct number of instances
112128
* math operators: The supported operators are +, -, /, *
113129
* numeric literals: Numbers contained within parentheses are numeric literals (as opposed to counter indexes)
114-
* functions: The supported functions are: min, max, sum, and ifnotzero. "max and "sum" have variants that work on multiple items at once (i.e. sum16, sum63, etc.)
130+
* functions: The supported functions are: min, max, sum, ifnotzero, and vcomparemax4. "max and "sum" have variants that work on multiple items at once (i.e. sum16, sum64, etc.)
115131
* hardware params: The supported hardware params are "num_shader_engines". "num_simds", "su_clock_prim", "num_prim_pipes", and "TS_FREQ"
116132

117133
For more details, see the "EvaluateExpression" function in the [GPAPublicCounters.cpp](Src/GPUPerfAPICounterGenerator/GPAPublicCounters.cpp) file.
118134

135+
## Building the Documentation
136+
137+
##### Prerequisites
138+
* A working python installation is required
139+
* Install Sphinx:
140+
* `pip install Sphinx`
141+
* Install Sphinx Read The Docs theme:
142+
* `pip install sphinx-rtd-theme` (read the docs theme is not installed by default)
143+
* Install spelling checker (optional)
144+
* `pip install pyenchant`
145+
* `pip install sphinxcontrib-spelling`
146+
147+
##### Building
148+
* Once you have Sphinx installed, simply run the following command from the "docs" subdirectory:
149+
* `make html`
150+
* To run the spelling checker:
151+
* edit conf.py and uncomment the line adding in the `sphinxcontrib.spelling` extension
152+
* `make spelling`

Build/Linux/Common.mk

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,15 @@ CFLAGS = -std=c++11 $(OPTIMIZE) -fPIC -D_LINUX -Wno-write-strings $(PLATFORM_CFL
1313
# ADDLCFLAGS = -Wall -Wno-unknown-pragmas -Wno-strict-aliasing -Wno-non-virtual-dtor -Werror -msse
1414
PLATFORM_DIR = x64
1515
BUILD_DEF = -DAMDT_BUILD_SUFFIX=
16-
GLES_PLATFORM_DIR=Linx64
1716
MAKEFILENAME=makefile
18-
BASE_OBJDIR = obj
1917
DEBUG_RELEASE=release
2018
INTERNAL_PUBLIC =
21-
OBJ_DIR = $(BASE_OBJDIR)/$(DEBUG_RELEASE)$(INTERNAL_PUBLIC)/$(PLATFORM_DIR)
19+
OUTPUT_DIR = $(DEPTH)/Output
20+
OUTPUT_BIN_DIR = $(OUTPUT_DIR)/bin
21+
OUTPUT_LIB_DIR = $(OUTPUT_DIR)/lib
22+
OUTPUT_OBJ_DIR = $(OUTPUT_DIR)/obj
23+
OBJ_DIR = $(OUTPUT_OBJ_DIR)/$(DEBUG_RELEASE)$(INTERNAL_PUBLIC)/$(PLATFORM_DIR)/$(PROJECT_NAME)
24+
OUTPUT_DIRS_TO_CREATE = $(OBJ_DIR) $(OUTPUT_BIN_DIR) $(OUTPUT_LIB_DIR)
2225

2326
# Build defines
2427
BASE_DEFINES = -D_LINUX -DUSE_POINTER_SINGLETON
@@ -30,6 +33,7 @@ DEBUG_DEFINES = -DAMDT_DEBUG_SUFFIX=\"\"
3033
DEFINES = $(BASE_DEFINES) $(BUILD_DEFINES) $(PLATFORM_DEFINES) $(DEBUG_DEFINES) $(ADDL_DEFINES) $(ADDITIONAL_COMPILER_DEFINES_FROM_BUILD_SCRIPT)
3134

3235
GPASRC_DIR=$(DEPTH)/Src
36+
GPUPERFAPI_DIR=$(GPASRC_DIR)/GPUPerfAPI
3337
GPACG_DIR = $(GPASRC_DIR)/GPUPerfAPICounterGenerator
3438
GPACOMMON_DIR = $(GPASRC_DIR)/GPUPerfAPI-Common
3539
GPADEVICEINFO_DIR = $(GPASRC_DIR)/DeviceInfo
@@ -41,7 +45,6 @@ ATI_STREAM_SDK_DIR = $(COMMON_DIR)/Lib/AMD/APPSDK/3-0
4145
HSA_DIR = /opt/rocm/hsa
4246
DEVICEINFO_DIR = $(COMMON_SRC)/DeviceInfo
4347
DEVICEINFOINTERNAL_DIR = $(COMMON_SRC)/DeviceInfo-Internal
44-
GPUPERFAPIUTILS_DIR = $(COMMON_SRC)/GPUPerfAPIUtils
4548
ADL_DIR = $(COMMON_DIR)/Lib/AMD/ADL
4649
ADLUTIL_DIR = $(COMMON_DIR)/Src/ADLUtil
4750
AMDTMUTEX_DIR = $(COMMON_DIR)/Src/AMDTMutex
@@ -50,23 +53,24 @@ DYNAMICLIBRARYMODULE_DIR = $(COMMON_SRC)/DynamicLibraryModule
5053
COMMON_LIB_EXT=$(COMMON_DIR)/Lib/Ext
5154
GTEST_DIR = $(COMMON_LIB_EXT)/GoogleTest/1-7
5255
GL_DIR = $(COMMON_LIB_EXT)/OpenGL
53-
GLES_DIR = $(COMMON_LIB_EXT)/OpenGLES
54-
GLEW_DIR = $(COMMON_LIB_EXT)/glew/1.9.0
55-
GLES_LIB_DIR = -L$(GLES_DIR)/Lib/$(GLES_PLATFORM_DIR)
5656
GTEST_DIR = $(COMMON_LIB_EXT)/GoogleTest/1-7
5757
GTEST_LIBS = $(GTEST_DIR)/lib/gcc5/x64/libgtest.a
5858
GTEST_LIBS32 = $(GTEST_DIR)/lib/gcc5/x86/libgtest.a
59+
VK_SDK_DIR = $(COMMON_LIB_EXT)/Vulkan/VulkanSDK/1.0.49.0/x86_64
60+
VK_INCLUDE_DIR = $(VK_SDK_DIR)/include
61+
AMD_VK_EXT_DIR = $(COMMON_SRC)/AmdVkExt
5962

6063
# Lib paths
61-
COMMON_LIB_PATHS = -L$(GPACOMMON_DIR) -L$(GPACG_DIR)
62-
COMMON_DEVICEINFO_LIB = -Wl,--whole-archive $(GPADEVICEINFO_DIR)/libDeviceInfo$(TARGET_SUFFIX).a -Wl,--no-whole-archive
64+
COMMON_LIB_PATHS = -L$(OUTPUT_LIB_DIR)
65+
COMMON_DEVICEINFO_LIB = -Wl,--whole-archive $(OUTPUT_LIB_DIR)/libDeviceInfo$(TARGET_SUFFIX).a -Wl,--no-whole-archive
6366
COMMON_LIBS = -lGPUPerfAPI-Common$(TARGET_SUFFIX) -lGPUPerfAPICounterGenerator$(TARGET_SUFFIX)
67+
GPUPERFAPI_LIB = -Wl,--whole-archive -lGPUPerfAPI$(TARGET_SUFFIX) -Wl,--no-whole-archive
6468
STANDARD_LIBS = -ldl -lpthread
6569

6670
# Build target overrides
67-
X86_OVERRIDES = "PLATFORM_CFLAG = -m32 -msse2" "PLATFORM_LFLAG = -m32" "PLATFORM_DEFINES = -DX86 -DAMDT_PLATFORM_SUFFIX=\\\"32\\\"" "CODEXL_OUTPUT_DIR = Output_x86" "PLATFORM_DIR = x86" "GLES_PLATFORM_DIR = Linx86" "GTEST_LIBS = $(GTEST_LIBS32)"
71+
X86_OVERRIDES = "PLATFORM_CFLAG = -m32 -msse2" "PLATFORM_LFLAG = -m32" "PLATFORM_DEFINES = -DX86 -DAMDT_PLATFORM_SUFFIX=\\\"32\\\"" "PLATFORM_DIR = x86" "GTEST_LIBS = $(GTEST_LIBS32)"
6872
INTERNAL_OVERRIDES = "BUILD_DEFINES = -DAMDT_INTERNAL -DAMDT_BUILD_SUFFIX=\\\"-Internal\\\"" "INTERNAL_PUBLIC = _Internal"
69-
DEBUG_OVERRIDES = "OPTIMIZE = $(DEBUG_CFLAGS)" "DEBUG_RELEASE = debug" "DEBUG_DEFINES = -DAMDT_DEBUG_SUFFIX=\\\"-d\\\""
73+
DEBUG_OVERRIDES = "OPTIMIZE = $(DEBUG_CFLAGS)" "DEBUG_RELEASE = debug" "DEBUG_DEFINES = -DAMDT_DEBUG_SUFFIX=\\\"-d\\\" -DUSE_DEBUG_GPA"
7074

7175
BUILD_X86_OVERRIDES = "TARGET_SUFFIX = 32" "AMD_LIB_PATH = Bin/Linx86/" "AMD_LIB_SUFFIX = 32" $(X86_OVERRIDES)
7276
BUILD_INTERNAL_OVERRIDES = "TARGET_SUFFIX = -Internal" "AMD_LIB_PATH = Bin-Internal/Linx64/" "AMD_LIB_SUFFIX = -Internal" $(INTERNAL_OVERRIDES)

Build/Linux/CommonTargets.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ DbgInternalx86:
3838
$(MAKE) -f $(MAKEFILENAME) $(BUILD_DEBUG_INTERNAL_X86_OVERRIDES)
3939

4040
makedir:
41-
mkdir -p $(OBJ_DIR)
41+
mkdir -p $(OUTPUT_DIRS_TO_CREATE)
4242

4343
all: default x86 Internal Internalx86 Dbg Dbgx86 DbgInternal DbgInternalx86
4444

0 commit comments

Comments
 (0)