gpuopen-tools / radeon_gpu_analyzer Goto Github PK
View Code? Open in Web Editor NEWThe Radeon GPU Analyzer (RGA) is an offline compiler and code analysis tool for Vulkan, DirectX, OpenGL, and OpenCL.
License: MIT License
The Radeon GPU Analyzer (RGA) is an offline compiler and code analysis tool for Vulkan, DirectX, OpenGL, and OpenCL.
License: MIT License
When running RGA on Windows, I get the following error:
rga -s cl --list-kernels apply_local_velocity.cl -I "..\build\Visual Studio 14 Win64\ecs4"
Error (reported by the ROCm OpenCL Compiler):
clang.exe: error: no such file or directory: 'Studio'
clang.exe: error: no such file or directory: '14'
clang.exe: error: no such file or directory: 'Win64\ecs4'
I made a PR (#24) in the past to add the executable flag myself, but every new release this flag goes away. Could you add it in your release script so it's automatic?
Extracting ISA of opencl kernels fails when pointing RGA to the rocm opencl-compiler.
RGA call: rga -s rocm-cl --compiler-bin=/opt/rocm/opencl/bin/x86_64/ --compiler-inc=/opt/rocm/opencl/include --compiler-lib=/opt/rocm/opencl/lib/x86_64/bitcode -cgfx906 --livereg=registers.txt vecadd.cl
vecadd.cl:
kernel
void vecadd(global int *A, global int *B, global int *C) {
int idx = get_global_id(0);
C[idx] = A[idx] + B[idx];
}
RGA output:
gfx906 (Vega)
AMD Radeon VII
Building for gfx906... succeeded.
Extracting ISA for gfx906... failed.
Error: unknown compilation status returned.
I tested on Ubuntu 18.04 with ROCm 2.2 and RGA 2.1
I expect that exception handling is usually supported by a C++ program. I wonder why your function “main” does not contain corresponding try and catch instructions so far.
How do you think about recommendations by Matthew Wilson in an article?
Would you like to adjust the implementation if you consider effects for uncaught/unhandled exceptions?
I am trying to create a dump with VK_LAYER_RGA_pipeline_extraction on Windows 10 with a Vulkan 1.1.101.0 runtime. Application is Vulkan 1.0 compatible.
The application is utilizing VkSpecializationInfo (with a several dozen parameters, typical uber shader) and push constants, but aside from that nothing unusual.
I have all the documented environment variables set: ENABLE_RGA_PIPELINE_EXTRACTION_LAYER=1;RGA_LAYER_LOG_ENABLE=1RGA_LAYER_OUTPUT_PATH=C:\RGADump
VK_LAYER_RGA_pipeline_extraction is the only active layer, and I can confirm that it actually intercepts all the relevant API calls, for several pipelines, render passes etc.
The VK_EXT_debug_marker extension is not available (and hence also unused).
Yet this is the only output it ever creates:
***Convertion started ***
version 1
Handling samplers.
Handling descriptor set layout.
The log file stops there and no warnings or anything whatsoever during application shutdown.
When opening the VS2015 sln straight after cloning, external dependencies are missing.
Running UpdateCommon.py pulled those dependencies in, maybe you should mention that in the build instructions?
Currently the python script UpdateCommon.py
leaves its root folder and tries to create folders in a parent directory. This is rather bad as the executing user might not have access to the parent folder and hence runs into security restrictions.
For instance, executing ./prebuild.sh --build release
caues these errors:
Directory /mnt/ext_projects/Common/Src/ShaderUtils does not exist, using 'git clone' to get latest from https://github.com/GPUOpen-Tools/common-src-ShaderUtils.git
fatal: could not create leading directories of '/mnt/ext_projects/Common/Src/ShaderUtils': Permission denied
git clone failed with 128
Directory /mnt/ext_projects/Common/Src/CElf does not exist, using 'git clone' to get latest from https://github.com/GPUOpen-Tools/common-src-CElf.git
fatal: could not create leading directories of '/mnt/ext_projects/Common/Src/CElf': Permission denied
git clone failed with 128
I have a trouble compiling OpenCL kernel. Minimal example to reproduce is this:
void test(image1d_buffer_t buf, float4 *data) {
(*data) = read_imagef(buf, 0);
}
__kernel void testk(image1d_buffer_t buf) {
float4 data;
test(buf, &data);
}
This results in "clang.exe: error: clang frontend command failed due to signal" and saved crash dump.
The exact failing command for invoking clang is:
./clang.exe --target=amdgcn-amd-amdhsa -include "..\include\opencl-c.h" \
-Xclang -mlink-bitcode-file -Xclang "..\lib\bitcode\opencl.amdgcn.bc" \
-Xclang -mlink-bitcode-file -Xclang "..\lib\bitcode\ockl.amdgcn.bc" \
-Xclang -mlink-bitcode-file -Xclang "..\lib\bitcode\irif.amdgcn.bc" \
-Xclang -mlink-bitcode-file -Xclang "..\lib\bitcode\ocml.amdgcn.bc" \
-Xclang -mlink-bitcode-file -Xclang "..\lib\bitcode\oclc_correctly_rounded_sqrt_on.amdgcn.bc" \
-Xclang -mlink-bitcode-file -Xclang "..\lib\bitcode\oclc_correctly_rounded_sqrt_off.amdgcn.bc" \
-Xclang -mlink-bitcode-file -Xclang "..\lib\bitcode\oclc_daz_opt_on.amdgcn.bc" \
-Xclang -mlink-bitcode-file -Xclang "..\lib\bitcode\oclc_daz_opt_off.amdgcn.bc" \
-Xclang -mlink-bitcode-file -Xclang "..\lib\bitcode\oclc_unsafe_math_on.amdgcn.bc" \
-Xclang -mlink-bitcode-file -Xclang "..\lib\bitcode\oclc_unsafe_math_off.amdgcn.bc" \
-Xclang -mlink-bitcode-file -Xclang "..\lib\bitcode\oclc_finite_only_on.amdgcn.bc" \
-Xclang -mlink-bitcode-file -Xclang "..\lib\bitcode\oclc_finite_only_off.amdgcn.bc" \
-Xclang -mlink-bitcode-file -Xclang "..\lib\bitcode\oclc_isa_version_900.amdgcn.bc" \
-cl-std=cl2.0 -D__OPENCL_VERSION__=200 -g -mcpu=tonga ./test.cl -o "tonga_codeobj.bin"
The error occurs with bundled clang 7.0.0 and seems to be fixed in clang version 8.0.1 (from latest LLVM installer), above command succeeds and I see output .bin file. Manually placing newer clang in RGA's directory does not work as they are incompatible (I receive "Error: unknown compilation status returned." in later stages).
I understand that this is not RGA's problem, but are there any plans on updating clang bundled with RGA?
The README.md says this:
Note that the this mode is about to be removed from RGA. To ensure that the results that RGA provides are accurate and reflect the real-life case, please use the new Vulkan live driver mode (which is also supported in the GUI application).
AMD Radeon Adrenalin Software must be installed to run this tool (for all modes except for Offline Vulkan and ROCm OpenCL).
This tool is invaluable to debug shaders and the way the code will generate for SPIRV on various architectures. If primary shader development is being done on an nvidia workstation, deprecating this mode will make it essentially impossible to debug shaders for AMD platforms, making this tool useless and discouraging optimization for performance on AMD platforms unless the entire development environment is on AMD workstations. Similar complaints apply to the AMD Radeon Adrenalin Software (which cannot be applied on headless or intel or nvidia workstations).
While I don't develop on an AMD workstation, I'd like my code to be compliant and performant on those platforms, which requires some way of inspecting the shader ISA, even if I'm not currently running the AMD driver on AMD hardware in my development environment... So therefore it's in AMD's best interest for development targeting of their platform that this is still possible, and this tool is the only way I know of to accomplish it.
Instead of "Number of allocated registers", this should say "Number of live registers".
My source: Matthäus G. Chajdas said so :)
At the moment, rga.exe --cfg
will give you a per instruction CFG, because of this line:
Matthäus suggested the default could be per basic-block (https://twitter.com/NIV_Anteru/status/1033794778230677504). As far as I can tell this could be done by simply changing dump-pi-cfg
to dump-bb-cfg
, but I don't know if backwards compatibility is a concern, in which case a new CLI argument might be required.
Hi,
RGA does not work for me.
/rga -s cl -c Tonga --cfg /home/robin/output/cfg.dot --livereg /home/robin/output/regs.txt --analysis /home/robin/analysis.vsc -D NUMINTEGRATIONPOINTS=8 /home/robin/kernel.txt
Output:
Target GPU detected:
Tonga (Graphics IP v8)
AMD FirePro S7100X
AMD FirePro S7150
AMD FirePro W7100
AMD MxGPU
AMD RADEON R9 M390X
AMD RADEON R9 M395X
AMD Radeon (TM) R9 380 Series
AMD Radeon (TM) R9 M390X
AMD Radeon R9 200 Series
Building for Tonga... succeeded.
Error: failed to disassemble binary output and produce textual ISA code for Tonga (kernel: formMatrices).
kernel.txt
System:
TR1950X, R9 390X
Kubuntu 17.10
Kernel 4.13.0-45-generic
UPDATE:
It was a driver problem with AMDGPU-PRO 18.10, Works with 18.20 (however, nothing was mentioned in the release notes)
V_SQRT_F32 should not be 4 cycles, but 16 - the same as V_RSQ_F32
https://github.com/GPUOpen-Tools/RGA/blob/f3f9539759c22e1a01bf184397ff089e95638d86/RadeonGPUAnalyzerBackend/Emulator/Parser/VOPInstruction.h#L180
Maybe check that the other instructions marked with "// guess" are accurate?
Please add -v/--verbose options so that the user can see how clang and lld are invoked by rga.
Hi There,
Why isn't it possible to legacy compile OpenCL directly from the GUI. Is there any limitation? Why it's only possible to compile ROCm OpenCl from the GUI?
Thanks in advance.
Hi! RGA crashes when i try to compiling Vulkan Graphics Pipeline.
I attached RGA project, but may be need to change path to resources
Archive contains the soure code of HLSL shaders.
BR, Andrey
Is it possible to use the RGA for disassembling a shader on a machine without AMD GPU?
When I open it only lets me deal with CL files, not HLSL ones. And If I force import one and try to build the CL compiler of course fails.
Please advise
Best regards
M.
Hi,
First some minor doc issues:
Then some build issues:
/xxx/more/RGA/Core/Vulkan/Backend/../../../../RGA/Utils/Vulkan/Include/rgPipelineTypes.h:10:10: fatal error: Utils/Include/rgaSharedDataTypes.h: No such file or directory
#include <Utils/Include/rgaSharedDataTypes.h>
The directory casing is wrong. It's include
not Include
Hello,
I am using the newest VS2017 Enterprise Release, but Building RGA in Release Mode does not work.
I get the following errors:
LNK1104 cannot open file 'libboost_filesystem-vc140-mt-1_59.lib' RadeonGPUAnalyzerCLI D:\RGA-master\Build\CMake\VS2017\RadeonGPUAnalyzerCLI D:\RGA-master\Build\CMake\VS2017\RadeonGPUAnalyzerCLI\LINK 1 Build
LNK4075 ignoring '/EDITANDCONTINUE' due to '/OPT:ICF' specification RadeonGPUAnalyzerCLI D:\RGA-master\Build\CMake\VS2017\RadeonGPUAnalyzerCLI D:\RGA-master\Build\CMake\VS2017\RadeonGPUAnalyzerCLI\tinyxml2-d.lib(tinyxml2.obj) 1 Build
LNK2038 mismatch detected for 'RuntimeLibrary': value 'MDd_DynamicDebug' doesn't match value 'MD_DynamicRelease' in kcCLICommander.obj RadeonGPUAnalyzerCLI D:\RGA-master\Build\CMake\VS2017\RadeonGPUAnalyzerCLI D:\RGA-master\Build\CMake\VS2017\RadeonGPUAnalyzerCLI\libboost_system-vc140-mt-gd-1_59.lib(error_code.obj) 1 Build
LNK2038 mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in kcCLICommander.obj RadeonGPUAnalyzerCLI D:\RGA-master\Build\CMake\VS2017\RadeonGPUAnalyzerCLI D:\RGA-master\Build\CMake\VS2017\RadeonGPUAnalyzerCLI\libboost_system-vc140-mt-gd-1_59.lib(error_code.obj) 1 Build
Building in Debug mode seems to work.
Is there a Docker image somewhere (i.e https://github.com/RadeonOpenCompute/ROCm-docker ) that can run RGA with any of its compiler back-ends?
I'm trying to do this myself but I'm having trouble getting the driver dependencies inside a container.
I followed README.md "Building on Ubuntu". To install qt, I ran (sudo apt-get install qtbase5-dev). README.md says to use Qt 5.9.2, so next I will try installing from http://download.qt.io/official_releases/qt/5.9/5.9.2/ -> qt-opensource-linux-x64-5.9.2.run. However, my make errors seem unrelated to Qt.
$ cd ~/pemCode/GPUOpen/RGA/Build
$ ./Prebuild.sh --vk-include /usr/include/vulkan/ --vk-lib /usr/lib/x86_64-linux-gnu
$ cd Linux/Make/Build
$ make
[ 25%] Building CXX object Core/Vulkan/Backend/CMakeFiles/VulkanBackend.dir/__/__/__/Utils/Vulkan/Src/rgPsoSerializerVulkan.cpp.o
In file included from /home/pemgithub/pemCode/GPUOpen/RGA/Utils/Vulkan/Src/rgPsoSerializerVulkan.cpp:6:0:
/home/pemgithub/pemCode/GPUOpen/RGA/Core/Vulkan/Backend/../../../../Common/Lib/Ext/json/json-3.2.0/single_include/nlohmann/json.hpp:1:1: error: expected unqualified-id before ‘<’ token
<HTML><HEAD>
^
In file included from /usr/include/c++/7/vector:63:0,
from /home/pemgithub/pemCode/GPUOpen/RGA/Core/Vulkan/Backend/../../../../RGA/Utils/Vulkan/Include/rgPipelineTypes.h:4,
from /home/pemgithub/pemCode/GPUOpen/RGA/Core/Vulkan/Backend/../../../../RGA/Utils/Vulkan/Include/rgPsoSerializerVulkan.h:7,
from /home/pemgithub/pemCode/GPUOpen/RGA/Utils/Vulkan/Src/rgPsoSerializerVulkan.cpp:7:
/usr/include/c++/7/bits/stl_uninitialized.h: In static member function ‘static _ForwardIterator std::__uninitialized_copy<_TrivialValueTypes>::__uninit_copy(_InputIterator, _InputIterator, _ForwardIterator)’:
/usr/include/c++/7/bits/stl_uninitialized.h:83:8: error: ‘_Construct’ is not a member of ‘std’
std::_Construct(std::__addressof(*__cur), *__first);
^~~~~~~~~~
/usr/include/c++/7/bits/stl_uninitialized.h:88:13: error: ‘_Destroy’ is not a member of ‘std’
std::_Destroy(__result, __cur);
^~~~~~~~
/usr/include/c++/7/bits/stl_uninitialized.h: In static member function ‘static void std::__uninitialized_fill<_TrivialValueType>::__uninit_fill(_ForwardIterator, _ForwardIterator, const _Tp&)’:
/usr/include/c++/7/bits/stl_uninitialized.h:150:8: error: ‘_Construct’ is not a member of ‘std’
std::_Construct(std::__addressof(*__cur), __x);
It appears that RGA sometimes mis-interprets SPIR-V as GLSL when given SPIR-V input. Here is the result of compiling a pair of spir-v files. Both were generated by the glslang HLSL front-end, and pass spirv-val. One works as expected. The other throws a GLSL parse error
c:\scratch>"c:\Program Files\GPUOpen\Radeon GPU Analyzer\rga.exe" -s vulkan-spv good.spv --isa ".\pyramid.isa" -a ".\pyramid.analysis" --il ".\pyramid.il" -c Baffin
Target GPU detected:
Baffin (Graphics IP v8)
AMD Radeon (TM) E9260
AMD Radeon Pro 450
AMD Radeon Pro 455
AMD Radeon Pro 460
AMD Radeon Pro 465
Radeon (TM) Pro V5300X
Radeon (TM) Pro WX 4100
Radeon (TM) Pro WX Series
Radeon RX 550 Series
Radeon RX 560 Series
Radeon(TM) RX 460 Graphics
Building for Baffin... succeeded.
c:\scratch>"c:\Program Files\GPUOpen\Radeon GPU Analyzer\rga.exe" -s vulkan-spv bad.spv --isa ".\pyramid.isa" -a ".\pyramid.analysis" --il ".\pyramid.il" -c Baffin
Target GPU detected:
Baffin (Graphics IP v8)
AMD Radeon (TM) E9260
AMD Radeon Pro 450
AMD Radeon Pro 455
AMD Radeon Pro 460
AMD Radeon Pro 465
Radeon (TM) Pro V5300X
Radeon (TM) Pro WX 4100
Radeon (TM) Pro WX Series
Radeon RX 550 Series
Radeon RX 560 Series
Radeon(TM) RX 460 Graphics
Building for Baffin... failed.
Compiling fragment stage:
ERROR: #version: Desktop shaders for Vulkan SPIR-V require version 140 or higher
ERROR: 0:1: '' : syntax error, unexpected IDENTIFIER
ERROR: 2 compilation errors. No code generated.
Apologies for the silly question, I just wanted to make sure, is the output from RGA fully optimized for HSLS? I cannot find an optimization flag to use.
I am currently using:
rga temp.hlsl -f PS -s hlsl --parse-isa --isa out.txt -I E:\WORK_IN_PROGRESS\C \SirEngineThe3rd\data\shaders\rasterization -p ps_5_0 -c gfx902 --il il.txt
Best regards
M.
I am trying to run the tool with a very simple pixel shader to generate the isa. No matter how simple I make the shader the tool fails to generate any output. It also doesn't matter what ASIC I target (they all fail).
I invoke the tool like this:
rga.exe -c Oland -s hlsl -f main -p ps_4_0 --isa test.isa TestPS.hlsl
TestPS.hlsl contains:
struct PSIn
{
float2 uv : TEXTURE0;
};
float4 main(PSIn psIn) : SV_Target
{
return float4(1.0,0.0,0.0,1.0);
}
And I get output like this (same output with --verbose
option on):
atidxx64.dll AmdDxGsaCompileShader failed.
Building for Oland... failed.
I am using the Crimson Relive 17.7.1-July10 driver (Non-WHQL-Win10-64Bit-Radeon-Software-Crimson-ReLive-17.7.1-July10.exe
) on Win10 64-bit Enterprise (rs2).
Are there any known issues?
Using pr rebuilt linux/windows binaries (2.0.1 d730d0b) I'm having trouble compiling a simple .cl program.
Command:
rga -s rocm-cl --isa output/isa3.text hello.cl
Program:
__kernel void HelloWorld(__global char* data)
{
data[0] = 'H';
data[1] = 'e';
data[2] = 'l';
data[3] = 'l';
data[4] = 'o';
data[5] = ',';
data[6] = ' ';
data[7] = 'W';
data[8] = 'o';
data[9] = 'r';
data[10] = 'l';
data[11] = 'd';
data[12] = '!';
data[13] = 'H';
}
I get the same error on Windows and Ubuntu 18.04.
Interestingly, if you edit the last line to be data[14] or remove it. It compiles 😕
This code does compile on RGA rga-2.0.1193 (tested on linux) and 1.1 (tested on windows)
hello.cl.txt
error.txt
hello-f4d1ea.sh.txt
hello-f4d1ea.cl.txt
Hi,
just asking if we can expect an RGA release on Navi launch day (7 july) or shortly after with support for 5700XT..
some ETA?
thanks..
This simple OpenCL kernel crashes clang in RGA when compiled with --line-numbers
:
__kernel void apply_gamma(
__global float3 *result,
const __global float3 *input)
{
const int id = get_global_id(0);
result[id] = powr(input[id], 0.454545f);
}
Compiled with:
./rga -s rocm-cl --isa isa.txt --line-numbers apply_gamma.cl
OS: Ubuntu 16.04.3 LTS
Version: rga-1.4.172 (from releases)
Hi,
Is there a way to build for Vega?
Looking at the code, it doesn't seem it's supported yet. Am I correct?
C:\> rga.exe -s rocm-cl test.cl -b test.bin
Building for gfx900... succeeded.
Building for gfx902... succeeded.
C:\>
Please add support for gfx803 and other GPU's.
Super nitpicking at this point, but amdspv
prints AMDSPV SUCCESS!!!
on the error output when it succeeded. I feel like this is not useful, since we already get an error code when that happens. Maybe put this output in a --verbose
switch?
If you compile a compute shader with [numthreads(64,1,1)] the top of the ISA output says "wave_size(64)". However it's apparent from the generated asm that the code generated was designed for wave32.
Evidence for this is manipulation of only exec_lo (exec_hi is never touched) and the fact that DX12 Wave Intrinsics such as "WaveActiveSum" generate code that only sums across 32 lanes.
If GFX1010 uses Wave32 now as its native wave size for Compute then the "wave_size(64)" at the top of the ISA output should read "wave_size(32)" instead.
Should be "Vector Memory".
Looking at the source code I couldn't immediately spot why it's misidentified, considering that ParserSIMUBUF::Get9OpMUBUF() contains the right code to handle it.
I have a non-AMD Windows 8.1 machine at home, which I do a lot of side projects on. I have installed the 1.2 release, and on this machine, RGA is not producing a live register report. I can get it to produce isa, but no reg report. Here is a sample session.
c:\scratch>ls
PYRAMID_amdcodexl
c:\scratch>"C:\Program Files\GPUOpen\Radeon GPU Analyzer\rga.exe" --version
OpenCL Error: Can't find AMD platform.
Radeon GPU Analyzer Version: 1.2.58
Failed to initialize.
c:\scratch>"C:\Program Files\GPUOpen\Radeon GPU Analyzer\rga.exe" -s vulkan-spv --isa ".\pyramid.isa" --livereg ".\livereg_report.txt" -c Baffin PYRAMID_amdcodexl
Target GPU detected:
Baffin (Graphics IP v8)
AMD Radeon (TM) E9260
AMD Radeon Pro 450
AMD Radeon Pro 455
AMD Radeon Pro 460
AMD Radeon Pro 465
Radeon (TM) Pro V5300X
Radeon (TM) Pro WX 4100
Radeon (TM) Pro WX Series
Radeon RX 550 Series
Radeon RX 560 Series
Radeon(TM) RX 460 Graphics
Building for Baffin... succeeded.
c:\scratch>ls
Baffin_frag_pyramid.isa PYRAMID_amdcodexl spvLogInfo.txt
c:\scratch>
Hi There,
First of all, congratulations on everyone involved in the Radeon Gpu Analyzer project. I am trying to build it on MSVC2017 - all went well with the prebuilt script, but when trying to build all projects the GUI project fails (all others OK) - with several errors like:
"use of undefined type QtIntValidator"
"use of undefined type QAction"
...
Can anyone help me check out what could be the problem. Thanks in advance.
Pedro
I cannot build it in linux.
My process:
1)I have run the .sh file because the .bat file that fails immediately.
2)Following the build instructions apparently the current folder structures does not match the instructions. I have worked that out by pointing at the folder where the files in question end up being.
3) I run make in the subfolder /RGA-master/Build/CMake/linux/Release$
Error:
1)The build fails after 40% as follows:
Last line before error:
/usr/bin/x86_64-linux-gnu-ld: /home/myuser/Downloads/GPUOpen/Common/Lib/Ext/yaml-cpp/lib/linux/gcc5/libyaml-cpp.a(exp.cpp.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a PIE object; recompile with -fPIC
First error line:
/usr/bin/x86_64-linux-gnu-ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
RadeonGPUAnalyzerCLI/CMakeFiles/RadeonGPUAnalyzerCLI.dir/build.make:417: recipe for target '../../../../output/bin/rga-bin' failed
make[2]: *** [../../../../output/bin/rga-bin] Error 1
CMakeFiles/Makefile2:293: recipe for target 'RadeonGPUAnalyzerCLI/CMakeFiles/RadeonGPUAnalyzerCLI.dir/all' failed
make[1]: *** [RadeonGPUAnalyzerCLI/CMakeFiles/RadeonGPUAnalyzerCLI.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
Thank you.
Not only would this be helpful for catching build failure on commit. It's helpful for others because it gives unambiguous reliable steps to follow for doing a build.
"SGPR_SPILLS" and "VGPR_SPILLS" are alway get added to the CSV header even though the values aren't when analyzing HLSL shaders/CL programs.
Steps to reproduce:
test.comp
:#version 450
void main()
{
}
glslc test.comp
-s vulkan-spv a.spv --asic Fiji --isa .
to get error Building for Fiji... failed.
I tried to build rga
at commit a183542
.
[ 1%] Built target DeviceInfoLib
[ 8%] Built target AMDTBaseTools
[ 9%] Building CXX object Core/Vulkan/Backend/CMakeFiles/VulkanBackend.dir/src/beVulkanBackend.cpp.o
[ 64%] Built target AMDTOSWrappers
[ 88%] Built target RadeonGPUAnalyzerBackend
In file included from /home/ryp/dev/reaper/external/amd-rga/Core/Vulkan/Backend/src/beVulkanBackend.cpp:25:
/home/ryp/dev/reaper/external/amd-rga/Core/Vulkan/Backend/include/beVulkanBackend.h:11:10: fatal error: Utils/Include/rgaSharedDataTypes.h: No such file or directory
11 | #include <Utils/Include/rgaSharedDataTypes.h>
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated
I executed these commands:
$ cmake -H. -Bbuild -DCMAKE_BUILD_TYPE=Release -DBUILD_CLI_ONLY=1
$ cmake --build build
Here's the VERBOSE version:
cd /home/ryp/dev/reaper/external/amd-rga/build/Core/Vulkan/Backend && /usr/bin/c++ -DAMDT_PUBLIC -DCMAKE_BUILD -DLINUX -DRGA_ENABLE_VULKAN -D_LINUX -I/home/ryp/dev/reaper/external/amd-rga/Core/Vulkan/Backend/include -I/home/ryp/dev/reaper/external/amd-rga/Core/Vulkan/Backend/../../../../Common/Lib/Ext -I/home/ryp/dev/reaper/external/amd-rga/Core/Vulkan/Backend/../../../../RGA -O3 -DNDEBUG -std=c++11 -fmessage-length=0 -Wno-unknown-pragmas -pthread -std=c++11 -o CMakeFiles/VulkanBackend.dir/src/beVulkanBackend.cpp.o -c /home/ryp/dev/reaper/external/amd-rga/Core/Vulkan/Backend/src/beVulkanBackend.cpp
In file included from /home/ryp/dev/reaper/external/amd-rga/Core/Vulkan/Backend/src/beVulkanBackend.cpp:25:
/home/ryp/dev/reaper/external/amd-rga/Core/Vulkan/Backend/include/beVulkanBackend.h:11:10: fatal error: Utils/Include/rgaSharedDataTypes.h: No such file or directory
11 | #include <Utils/Include/rgaSharedDataTypes.h>
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Is there any plans to support OpenCL offline(non-rocm) compilation for Navi?
As of right now it appears that RGA only takes glsl files for the vulkan backend. Ideally I'd feed it my own .spv files. It looks like beProgramBuilderVulkan.cpp
is only missing handling for in.spv
and in.spvText
cmd's into amdspv.exe
so it should be easy to add as long as amdspv.exe
properly supports it.
Error: unsupported Shader Model detected: ps_5_1. RGA supports Shader Model 5.0 and below.
I would like to point out that identifiers like “_KCCLICOMMANDER_H_
” and “kcUtils_h__
” do not fit to the expected naming convention of the C++ language standard.
Would you like to adjust your selection for unique names?
Similar to #7 the OpenGL and Vulkan backends rely on OpenCL to enumerate a list of cards, and it fails on non-AMD hardware.
I fixed e.g. GL just by removing that code. If CL was initialised by being requested, that array would already be filled out earlier and then just enumerating all cards the same as #7 did for DX. It gives the same behaviour as DX and I think this is safe, but I'm not sure if GL/CL are more tied together than D3D/CL were, so I didn't want to make this a pull request just yet.
If you think it's a good change I can make a PR for the GL and vulkan back-ends.
Note: Even with this change, the actual compilation subsequently fails on non-AMD, but it does so gracefully instead of just crashing the process. Also in future maybe the compilation will work on non-AMD 😄.
diff --git a/RadeonGPUAnalyzerBackend/src/beBackend.cpp b/RadeonGPUAnalyzerBackend/src/beBackend.cpp
index 40edca7..074c14b 100644
--- a/RadeonGPUAnalyzerBackend/src/beBackend.cpp
+++ b/RadeonGPUAnalyzerBackend/src/beBackend.cpp
@@ -447,23 +447,6 @@ bool Backend::GetSupportedPublicDevices(std::set<std::string>& devices)
ret = true;
devices = m_supportedPublicDevices;
}
- else
- {
- // Get the supported public devices from the OpenCL backend.
- if (m_beOpenCL == nullptr)
- {
- m_beOpenCL = new beProgramBuilderOpenCL;
- }
-
- beKA::beStatus rc = m_beOpenCL->Initialize();
-
- if (rc == beStatus_SUCCESS)
- {
- // Retrieve the supported public devices from the OpenCL runtime.
- m_beOpenCL->GetSupportedPublicDevices(devices);
- ret = true;
- }
- }
return ret;
}
diff --git a/RadeonGPUAnalyzerBackend/src/beProgramBuilderOpenGL.cpp b/RadeonGPUAnalyzerBackend/src/beProgramBuilderOpenGL.cpp
index 9887403..076c03b 100644
--- a/RadeonGPUAnalyzerBackend/src/beProgramBuilderOpenGL.cpp
+++ b/RadeonGPUAnalyzerBackend/src/beProgramBuilderOpenGL.cpp
@@ -132,6 +132,12 @@ beKA::beStatus beProgramBuilderOpenGL::GetDeviceTable(std::vector<GDT_GfxCardInf
}
}
+ // If this is empty then odds are you are not using AMD hardware.
+ if(table.empty())
+ {
+ AMDTDeviceInfoUtils::Instance()->GetAllCards(table);
+ }
+
std::sort(table.begin(), table.end(), beUtils::GfxCardInfoSortPredicate);
if (!table.empty())
On recent drivers (at least 18.12.3 and 19.1.1) running the following command:
rga -s opengl --isa isa.txt -b out.bin --vert test.vert -c baffin
for this shader test.vert
:
void main(void) {
const vec4 verts[4] = vec4[4](vec4(-1.0, -1.0, 0.5, 1.0), vec4(1.0, -1.0, 0.5, 1.0),
vec4(-1.0, 1.0, 0.5, 1.0), vec4(1.0, 1.0, 0.5, 1.0));
gl_Position = verts[gl_VertexID];
}
Fails and outputs:
Building for Baffin... failed.
Error: failed to generate one or more output files
With only the .bin
file and no ISA file.
Rolling back to driver 18.8.2 works correctly.
Tested on Windows 10 x64 with RGA 2.0.1.
Hi, I'm invoking RGA like this:
$ ./rga -h -s vulkan-spv -c gfx900 --comp $SHADER --livereg live-test
but getting an error
Error: Error: fail to validate: Line 762: 468: 36(bool) GroupNonUniformElect 468(Subgroup).
Fail to perform SPIRV-to-IL conversion for COMPUTE SHADER.
If I compile my glsl with -s vulkan
, it fails with the same issue.
Hi,
Our OpenGL engine uses multiple sources per shader stage. This allows us to have a modular system that can mix and match GLSL with different #version values.
The RGA tool is really nice, but we cannot supply multiple source files per stage.
Please allow more than one source to be specified per shader stage.
Hi!
My apologies for an issue probably due to my own inaptitude and understanding of the context . I assumed it would be possible to use the offline rocm compiler included in the 1.4 release to produce some binary form that could be loaded and with clCreateProgramWithBinary+clBuildProgram under Windows. Regardless of what I try, the hsacobj ELF produced is rejected with the message "The binary is incorrect or incomplete. Finalization to ISA couldn't be performed.".
Is it possible to do what I'm trying to do? The main reason is that I observe a much better VGPR usage in the live reg analysis with the rocm compiler that would allow for more scheduled wavefronts.
Thanks,
hogstres
When the primary display is plugged into a GPU other than an AMD GPU, RGA will emit the following error:
G:\Downloads\rga-windows-x64-2.3>rga -s dx12 -c Bonaire --cs H:\product.txt --cs-model cs_6_3 --cs-entry main --isa H:\isa.txt
Building for Bonaire...
Error: failed to invoke the DX12 backend.
Error: cannot retrieve the list of targets supported by the driver.
failed.
This error occurs when multiple GPUs are present in the system and the primary display is not attached to the AMD GPU.
Please update RGA to enumerate available adapters and pick the AMD one in preference to NVIDIA or Intel GPUs - or report an error indicative of the fact that an AMD GPU is present but not currently the 'main' adapter.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.