[WIP] Tweaked CMake files to compile/run benchmarks with clang on gfx1010/1012 #116
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I managed to build and run the benchmark kernel on an RX 5700 XT (gfx1010) with latest stable LLVM+Clang (10.0.0), the included tweaks to the CMake files, and editing some of the generated Makefiles manually.
System is Linux Mint 19.3 with linux kernel 5.5.11-050511-generic, amdgpu drivers, Ryzen 3900X CPU and ROCm version 3.1.0 .
CMake command:
CXX=hipcc cmake -DBUILD_BENCHMARK=ON -DENABLE_INLINE_ASM=OFF ../.
Environment Variables:
The generated
flags.make
andlink.txt
files contained invalid flags for clang, specifically the -hc flag.(flags.make)
CXX_FLAGS = -Wno-unused-command-line-argument -Wall -Wextra -O3 -DNDEBUG -fPIC -hc -fPIC -std=c++14 -std=c++11
(link.txt)
/opt/rocm/bin/hipcc -fPIC -Wno-unused-command-line-argument -Wall -Wextra -O3 -DNDEBUG -shared -Wl,-soname,libhiprand.so.1 -o libhiprand.so.1.1 CMakeFiles/hiprand.dir/src/hiprand/hiprand_hcc.cpp.o -Wl,-rpath,/home/mihir/Programs/rocRAND/build_default/library:/opt/rocm/hcc/lib:/opt/rocm-3.1.0/lib: librocrand.so.1.1 --amdgpu-target=gfx803 --amdgpu-target=gfx900 --amdgpu-target=gfx906 --amdgpu-target=gfx908 --amdgpu-target=gfx1010 --amdgpu-target=gfx1012 /opt/rocm-3.1.0/hip/lib/libhip_hcc.so -Wl,--enable-new-dtags -hc -L /opt/rocm/hcc/lib -Wl,-rpath /opt/rocm/hcc/lib -Wl,--whole-archive /opt/rocm/hcc/lib/libmcwamp.so.3.1.30100 -Wl,--no-whole-archive -ldl -lm /opt/rocm/hcc/lib/libhc_am.so.3.1.30100 /opt/rocm-3.1.0/lib/libhsa-runtime64.so -fPIC
make
completed successfully when I removed the incorrect flags, and I was able to runbuild/benchmark/benchmark_rocrand_kernel
I don't have much CMake experience so I couldn't figure out how those flags were generated; some pointers would be much appreciated.