Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Tweaked CMake files to compile/run benchmarks with clang on gfx1010/1012 #116

Closed
wants to merge 1 commit into from

Conversation

mihirparadkar
Copy link

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:

export HIP_PLATFORM=clang
export ROCM_PATH=/opt/rocm
export HIP_CLANG_PATH=<path-to-llvm-10.0.0 >/bin/
export DEVICE_LIB_PATH=/opt/rocm/lib

The generated flags.make and link.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 run build/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.

@saadrahim saadrahim requested review from AJcodes and neon60 April 3, 2020 19:30
@saadrahim
Copy link
Member

Thank you for your contribution. I will evaluate its inclusion as AMD may opt for a slightly different approach to supporting the GPUs you added.

@saadrahim
Copy link
Member

Closing this ticket now. Navi support will be available later this year.

@saadrahim saadrahim closed this Jul 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants