Skip to content

Commit

Permalink
Updates for 2.7 release.
Browse files Browse the repository at this point in the history
  • Loading branch information
AmitBM committed Dec 14, 2022
1 parent c49c5d1 commit eeb8f9f
Show file tree
Hide file tree
Showing 256 changed files with 15,775 additions and 26,439 deletions.
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
build/CMake
build/windows
build/linux
Output
output
.vscode
Output_Test
output_test
*.vs
build_output
BuildOutput
documentation/build
*.csproj.user
Expand All @@ -15,3 +16,4 @@ external/code_sanitizer
*.msi
RGA-Installer-cache
source/common/vulkan_layer_launcher/RGALayerLauncher/bin

30 changes: 15 additions & 15 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -72,18 +72,18 @@ if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR ${CMAKE_SYSTEM_NAME} STREQUAL "Darwi
endif()

# Output directories
set(BUILD_CONFIG "Release")
set(BUILD_CONFIG "release")
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
set(BUILD_CONFIG "Debug")
set(BUILD_CONFIG "debug")
endif()
if (GUI_AUTOMATION)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_SOURCE_DIR}/Output_Test/${BUILD_CONFIG}/bin")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_SOURCE_DIR}/Output_Test/${BUILD_CONFIG}/lib")
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_SOURCE_DIR}/Output_Test/${BUILD_CONFIG}/arch")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_SOURCE_DIR}/output_test/${BUILD_CONFIG}/bin")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_SOURCE_DIR}/output_test/${BUILD_CONFIG}/lib")
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_SOURCE_DIR}/output_test/${BUILD_CONFIG}/arch")
else()
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_SOURCE_DIR}/Output/${BUILD_CONFIG}/bin")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_SOURCE_DIR}/Output/${BUILD_CONFIG}/lib")
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_SOURCE_DIR}/Output/${BUILD_CONFIG}/arch")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_SOURCE_DIR}/output/${BUILD_CONFIG}/bin")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_SOURCE_DIR}/output/${BUILD_CONFIG}/lib")
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_SOURCE_DIR}/output/${BUILD_CONFIG}/arch")
endif()

elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
Expand All @@ -93,13 +93,13 @@ elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Windows")

# Output directories - use Windows path separaters so xcopy commands work
if (GUI_AUTOMATION)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}\\Output_Test\\$<$<CONFIG:debug>:Debug>$<$<CONFIG:release>:Release>\\bin)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}\\Output_Test\\$<$<CONFIG:debug>:Debug>$<$<CONFIG:release>:Release>\\lib)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}\\Output_Test\\$<$<CONFIG:debug>:Debug>$<$<CONFIG:release>:Release>\\arch)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}\\output_test\\$<$<CONFIG:debug>:debug>$<$<CONFIG:release>:release>\\bin)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}\\output_test\\$<$<CONFIG:debug>:debug>$<$<CONFIG:release>:release>\\lib)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}\\output_test\\$<$<CONFIG:debug>:debug>$<$<CONFIG:release>:release>\\arch)
else()
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}\\Output\\$<$<CONFIG:debug>:Debug>$<$<CONFIG:release>:Release>\\bin)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}\\Output\\$<$<CONFIG:debug>:Debug>$<$<CONFIG:release>:Release>\\lib)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}\\Output\\$<$<CONFIG:debug>:Debug>$<$<CONFIG:release>:Release>\\arch)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}\\output\\$<$<CONFIG:debug>:debug>$<$<CONFIG:release>:release>\\bin)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}\\output\\$<$<CONFIG:debug>:debug>$<$<CONFIG:release>:release>\\lib)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}\\output\\$<$<CONFIG:debug>:debug>$<$<CONFIG:release>:release>\\arch)
endif()

# Use multiple cores to compile all projects.
Expand Down Expand Up @@ -147,5 +147,5 @@ endif()

# Add Tests
if(AMD_INTERNAL)
add_subdirectory (${PROJECT_SOURCE_DIR}/../RGA-Internal/tests ${CMAKE_CURRENT_BINARY_DIR}/tests)
add_subdirectory (${PROJECT_SOURCE_DIR}/../rga_internal_utils/tests ${CMAKE_CURRENT_BINARY_DIR}/tests)
endif()
79 changes: 37 additions & 42 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ The supported modes by the **command-line tool** are:
* Vulkan Offline - using a static compiler, accepts GLSL/SPIR-V as input. Note: to ensure that the results that RGA provides are accurate and reflect the real-world case, please use the new Vulkan live driver mode (which is also supported in the GUI application).
* OpenCL - AMD's LLVM-based Lightning Compiler for Offline OpenCL
* OpenGL
* AMDIL

## System Requirements ##

Expand All @@ -36,7 +35,10 @@ The supported modes by the **command-line tool** are:

To run the tool, you would need to have the AMD Radeon Adrenalin Software (Windows) or amdgpu-pro driver (Linux) installed for all modes, except for the following "offline" modes, which are independent of the driver and hardware:
* Vulkan offline mode
* OpenCL offline mode
* OpenCL mode
* OpenGL mode
* DX11 mode


For the non-offline modes, it is strongly recommended to run with the latest drivers so that the latest compiler is used and the latest architectures can be targeted.

Expand All @@ -55,23 +57,21 @@ As a preliminary step, make sure that you have the following installed on your s

cd to the build sub-folder, and run:

```
prebuild.bat --qt <path of Qt's msvc2017_64 folder> --vs 2017
```

Where `<path to Qt's msvc2017_64 folder>` is the path to the Qt msvc2017_64 folder, such as `C:\Qt\Qt5.15.2\msvc2017_64`.
Where <path to Qt's msvc2017_64 folder> is the path to the Qt msvc2017_64 folder, such as C:\Qt\Qt5.15.2\msvc2017_64.

Running the prebuild script will fetch all the dependencies and generate the solution file for Visual Studio.
After successfully running the preuild script, open RGA.sln from build\windows\vs2019 (or vs2017), and build:
* RadeonGPUAnalyzerCLI project for the command line executable
* RadeonGPUAnalyzerGUI project for the GUI app

Some useful options of the prebuild script:
* `--vs <VS version>`: generate the solution files for a specific Visual Studio version. For example, to target VS 2019, add --vs 2019 to the command.
* `--qt <path>`: full path to the folder from where you would like the Qt binaries to be retrieved. By default, CMake would try to auto-detect Qt on the system.
* `--vk-include` and `--vk-lib`: full paths to where the Vulkan SDK include and Vulkan lib folders. By default, CMake would try to auto-detect the Vulkan SDK on the system.
* `--cli-only`: only build the command line tool (do not build the GUI app)
* `--no-fetch`: do not attempt to update the third-party repositories
* --vs <VS version>: generate the solution files for a specific Visual Studio version. For example, to target VS 2019, add --vs 2019 to the command.
* --qt <path>: full path to the folder from where you would like the Qt binaries to be retrieved. By default, CMake would try to auto-detect Qt on the system.
* --vk-include and --vk-lib: full paths to where the Vulkan SDK include and Vulkan lib folders. By default, CMake would try to auto-detect the Vulkan SDK on the system.
* --cli-only: only build the command line tool (do not build the GUI app)
* --no-fetch: do not attempt to update the third-party repositories

If you are intending to analyze DirectX 11 shaders using RGA, copy the x64 version of Microsoft's D3D compiler to a subdirectory
named "utils" under the RGA executable's directory (for example, D3DCompiler_47.dll).
Expand All @@ -82,53 +82,49 @@ If for some reason you do not want to use the prebuild.bat script, you can also
Start by running the FetchDependencies.py script to fetch the solution's dependencies.
To generate the solution file for VS 2017 in x64 configuration, use:

```
cmake.exe -G "Visual Studio 15 2017 Win64" <full path to the RGA repo directory>
```
cmake.exe -G "Visual Studio 15 2017 Win64" <full path to the RGA repo directory>

If you are intending to analyze DirectX shaders using RGA, copy the x64 version of Microsoft's D3D compiler to a subdirectory
named "utils" under the RGA executable's directory (for example, D3DCompiler_47.dll).

### Building on Ubuntu ###
* One time setup:
* Install the Vulkan SDK (version 1.1.97.0 or above). To download the Vulkan SDK, visit https://vulkan.lunarg.com/
* `sudo apt-get install libboost-all-dev`
* `sudo apt-get install gcc-multilib g++-multilib`
* `sudo apt-get install libglu1-mesa-dev mesa-common-dev libgtk2.0-dev`
* `sudo apt-get install zlib1g-dev libx11-dev:i386`
* sudo apt-get install libboost-all-dev
* sudo apt-get install gcc-multilib g++-multilib
* sudo apt-get install libglu1-mesa-dev mesa-common-dev libgtk2.0-dev
* sudo apt-get install zlib1g-dev libx11-dev:i386
* Install CMake 3.10 or above. For auto-detecting the Vulkan SDK version 3.7 or above is required.
* Install Python 3.6 (or above)
* Install python 3.6 (or above)
* To build the GUI app, you should also have Qt installed

* Build:

`cd` to the Build sub-folder
cd to the build sub-folder

On Linux, it is recommended to explicitly pass to CMake the location of the Vulkan SDK include and lib directories as well as the location of Qt. For example:

```bash
./prebuild.sh --qt ~/Qt-5.15.2/5.15.2/gcc_64 --vk-include ~/work/vulkan-sdk/1.1.97.0/x86_64/include/ --vk-lib ~/work/vulkan-sdk/1.1.97.0/x86_64/lib/
```
./prebuild.sh --qt ~/Qt-5.15.2/5.15.2/gcc_64 --vk-include ~/work/vulkan-sdk/1.1.97.0/x86_64/include/ --vk-lib ~/work/vulkan-sdk/1.1.97.0/x86_64/lib/

This will fetch all the dependencies and generate the make files.

Then, `cd `to the auto-generated subfolder build/linux/make and run `make`.
Then, cd to the auto-generated subfolder build/linux/make and run make.

-=-

If for some reason you do not want to use the `prebuild.sh` script, you can also manually fetch the dependencies and generate the makefiles:
If for some reason you do not want to use the prebuild.sh script, you can also manually fetch the dependencies and generate the makefiles:

* run: `python3 fetch_dependencies.py`
* run: `cmake –DCMAKE_BUILD_TYPE=Release` (or: `Debug`) `<full or relative path to the RGA repo directory>`
* run: python3 fetch_dependencies.py
* run: cmake –DCMAKE_BUILD_TYPE=Release (or: Debug) <full or relative path to the RGA repo directory>

It is recommended to create a directory to hold all build files, and launch cmake from that directory.

For example:
* `cd` to the RGA repo directory
* `mkdir _build`
* `cd _build`
* `cmake –DCMAKE_BUILD_TYPE=Release ../`
* run: `make`
* cd to the RGA repo directory
* mkdir _build
* cd _build
* cmake –DCMAKE_BUILD_TYPE=Release ../
* run: make

## Running ##
### GUI App ###
Expand All @@ -139,21 +135,20 @@ Run the RadeonGPUAnalyzerGUI executable. The app provides a quickstart guide and
Run the rga executable.

* Usage:
* General: `rga -h`
* DirectX 12: `rga -s dx12 -h`
* DirectX 11: `rga -s dx11 -h`
* DirectX Raytracing: `rga -s dxr -h`
* General: rga -h
* DirectX 12: rga -s dx12 -h
* DirectX 11: rga -s dx11 -h
* DirectX Raytracing: rga -s dxr -h

Note: RGA's DX11 mode requires Microsoft's D3D Compiler DLL in runtime. If you copy the relevant D3D Compiler DLL to the utils
subdirectory under the executable's directory, RGA will use that DLL in runtime. The default D3D compiler that RGA public releases ship with
is d3dcompiler_47.dll.
* OpenGL: `rga -s opengl -h`
* OpenCL offline: `rga -s opencl -h`
* Vulkan live-driver: `rga -s vulkan -h`
* Vulkan offline - GLSL: `rga -s vk-offline -h`
* Vulkan offline - SPIR-V binary input: `rga -s vk-offline-spv -h`
* Vulkan offline - SPIRV-V textual input: `rga -s vk-offline-spv-txt -h`
* AMD IL: `rga -s amdil -h`
* OpenGL: rga -s opengl -h
* OpenCL offline: rga -s opencl -h
* Vulkan live-driver: rga -s vulkan -h
* Vulkan offline - glsl: rga -s vk-offline -h
* Vulkan offline - SPIR-V binary input: rga -s vk-offline-spv -h
* Vulkan offline - SPIRV-V textual input: rga -s vk-offline-spv-txt -h

## Support ##
For support, please visit the RGA repository github page: https://github.com/GPUOpen-Tools/RGA
Expand Down
9 changes: 5 additions & 4 deletions build/dependency_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
github_root = "https://github.com/GPUOpen-Tools/"

# repositories.
git_mapping = {}
git_mapping = {
"update_check_api" : ["Common/Src/update_check_api", "amd-2.1.0"]
}

github_mapping = {
# Lib.
Expand All @@ -26,13 +28,12 @@
"common_lib_ext_tinyxml2_5.0.1" : ["Common/Lib/Ext/tinyxml2", "master"],
"cxxopts" : ["Common/Lib/Ext/cxxopts", "master"],
"volk" : ["Common/Lib/Ext/volk", "master"],
"device_info" : ["Common/Src/DeviceInfo", "rga-v2.6.1"],
"update_check_api" : ["Common/Src/update_check_api", "v2.0.1"],
# Src.
"adl_util" : ["Common/Src/ADLUtil", "master"],
"dynamic_library_module" : ["Common/Src/DynamicLibraryModule", "master"],
"tsingleton" : ["Common/Src/TSingleton", "master"],
"common_src_miniz" : ["Common/Src/Miniz", "master"],
"device_info" : ["Common/Src/DeviceInfo", "5e6c83cc74e4588bdf44e1f3c74d419b46bb1a0c"],
"dynamic_library_module" : ["Common/Src/DynamicLibraryModule", "amd-rga-v2.7"],
# QtCommon.
"qt_common" : ["QtCommon", "rga-2.5"],
}
Expand Down
4 changes: 2 additions & 2 deletions build/fetch_dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
print("Error: Unable to determine origin for RGA git project")
exit(1)

# Temporary for development during server migration.
# Used for development using alternate github servers.
gerrit_root = "git@github.amd.com:Developer-Solutions/"


Expand Down Expand Up @@ -268,7 +268,7 @@ def do_fetch_dependencies(arguments):

# Strip everything after the last '/' from the URL to retrieve the root
amd_github_root = (amd_github_url.rsplit('/', 1))[0] + '/'

# If cloning from github.com - use the master branch as the default branch - otherwise use amd-master
git_branch = "amd-master"
if "github.com" in amd_github_url:
Expand Down
7 changes: 4 additions & 3 deletions build/prebuild.bat
Original file line number Diff line number Diff line change
Expand Up @@ -126,15 +126,15 @@ goto :shift_arg
:run_clean
if exist %SCRIPT_DIR%windows (
echo INFO: Deleting %SCRIPT_DIR%\windows folder
del /s /f /q %SCRIPT_DIR%\windows
rmdir /s /q %SCRIPT_DIR%\windows
)
if exist %SCRIPT_DIR%..\output (
echo INFO: Deleting %SCRIPT_DIR%..\output folder
del /s /f /q %SCRIPT_DIR%..\output
rmdir /s /q %SCRIPT_DIR%..\output
)
if exist %SCRIPT_DIR%..\output_test (
echo INFO: Deleting %SCRIPT_DIR%..\output_test folder
del /s /f /q %SCRIPT_DIR%..\output_test
rmdir /s /q %SCRIPT_DIR%..\output_test
)
exit /b 0

Expand Down Expand Up @@ -220,3 +220,4 @@ if not !ERRORLEVEL!==0 (
)
cd %CURRENT_DIR%
echo Done.

14 changes: 7 additions & 7 deletions build/util/linux/copy_post_build_cli.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ if [ ! -d "$X64_DIR" ]; then
fi
cp ../../../external/vulkan_offline/linux/* $X64_DIR/
chmod +x $X64_DIR/amdspv
chmod +x $X64_DIR/spvgen.so

# Copy the OpenGL backend.
cp ../../../external/opengl/glc/linux/glc $X64_DIR/
Expand All @@ -29,19 +28,19 @@ chmod +x $X64_DIR/glc
if [ ! -d "$X64_DIR/lc" ]; then
mkdir -p $X64_DIR/lc
fi
mkdir -p $X64_DIR/lc/opencl/lib/clang/14.0.0/include
mkdir -p $X64_DIR/lc/opencl/lib/clang/16.0.0/include
cp -rf ../../../external/lc/opencl/linux/* $X64_DIR/lc/opencl
rm -f $X64_DIR/lc/opencl/include/opencl-c-base.h
cp -f ../../../external/lc/opencl/additional-targets $X64_DIR/lc/opencl/
cp -f ../../../external/lc/opencl/linux/include/opencl-c-base.h $X64_DIR/lc/opencl/lib/clang/14.0.0/include/
cp -f ../../../external/lc/opencl/linux/include/opencl-c-base.h $X64_DIR/lc/opencl/lib/clang/16.0.0/include/

# Copy the LC disassembler.
if [ ! -d "$X64_DIR/lc/disassembler" ]; then
mkdir $X64_DIR/lc/disassembler
fi
cp ../../../external/lc/disassembler/linux/amdgpu-dis $X64_DIR/lc/disassembler

# make sure lc/opencl/bin/clang is link to clang-14
# make sure lc/opencl/bin/clang is link to clang-16
CURDIR=`pwd`
rm -f $X64_DIR/lc/opencl/bin/clang
cd $X64_DIR/lc/opencl/bin/
Expand All @@ -56,17 +55,17 @@ if [ -e llvm-readelf ]; then
rm -f llvm-readelf
fi
# create new symlinks
ln -s clang-14 clang
ln -s clang-16 clang
ln -s lld ld.lld
ln -s llvm-readobj llvm-readelf
cd $CURDIR

chmod +x $X64_DIR/lc/opencl/bin/lld $X64_DIR/lc/opencl/bin/clang-14 $X64_DIR/lc/opencl/bin/llvm-objdump $X64_DIR/lc/opencl/bin/llvm-readobj
chmod +x $X64_DIR/lc/opencl/bin/lld $X64_DIR/lc/opencl/bin/clang-16 $X64_DIR/lc/opencl/bin/llvm-objdump $X64_DIR/lc/opencl/bin/llvm-readobj
chmod +x $X64_DIR/lc/opencl/lib/bitcode/*.bc

# Copy the static analysis backend.
if [ "$INTERNAL" = true ]; then
cp ../../../../RGA-Internal/core/shader_analysis/linux/x64/shae-internal $X64_DIR/
cp ../../../../rga_internal_utils/core/shader_analysis/linux/x64/shae-internal $X64_DIR/
chmod +x $X64_DIR/shae-internal
if [ -e $X64_DIR/shae ]; then
rm bin/shae
Expand Down Expand Up @@ -108,3 +107,4 @@ cp ../../../RGA_NOTICES.txt $OUTPUT_DIR/
# Copy README.md and Release notes
cp ../../../README.md $OUTPUT_DIR/
cp ../../../documentation/RGA_RELEASE_NOTES.txt $OUTPUT_DIR/

4 changes: 3 additions & 1 deletion build/util/linux/copy_post_build_gui.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ chmod +x $OUTPUT_DIR/RadeonGPUAnalyzer

# Copy the automation files/folders.
if [ "$AUTOMATION" = "-automation" ]; then
unzip -o -d $OUTPUT_DIR/ ../../../../rga_internal_utils/tests/rga_gui_test_data.zip
if [ -f ../../../../rga_internal_utils/tests/rga_gui_test_data.zip ]; then
unzip -o -d $OUTPUT_DIR/ ../../../../rga_internal_utils/tests/rga_gui_test_data.zip
fi
cp ../../../../rga_internal_utils/tests_gui/run.py $OUTPUT_DIR/
chmod +x $OUTPUT_DIR/run.py
fi
Expand Down

0 comments on commit eeb8f9f

Please sign in to comment.