From c8c72311345f13304e4dd831483a88ec01f612d9 Mon Sep 17 00:00:00 2001 From: Daine McNiven <51674140+daineAMD@users.noreply.github.com> Date: Fri, 7 Jun 2024 10:13:16 -0600 Subject: [PATCH] Fixes for static build. (#878) --- CMakeLists.txt | 6 ++++++ install.sh | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ffe96a82..977df052 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -92,6 +92,12 @@ if(DEFINED USE_CUDA) endif() # Hip headers required of all clients; clients use hip to allocate device memory +if( NOT BUILD_SHARED_LIBS ) + # potentially a bug in hip, if AMDGPU_TARGETS is not set, it uses amdgpu-arch to find + # archs on the machine, but doesn't work with static builds + # trying this workaround out for now + set (AMDGPU_TARGETS "gfx000") +endif() find_package( hip CONFIG PATHS ${HIP_DIR} ${ROCM_PATH} /opt/rocm ) # support for cuda backend with hip < 6.0 diff --git a/install.sh b/install.sh index 845d36d6..70fc1830 100755 --- a/install.sh +++ b/install.sh @@ -567,7 +567,7 @@ fi # this can be removed and be done in rmake.py once --cuda flag support is gone if [[ "${build_cuda}" != true ]]; then - export HIP_PLATFORM="$(hipconfig --platform)" + export HIP_PLATFORM="$(${rocm_path}/bin/hipconfig --platform)" fi if [[ "${rmake_invoked}" == false ]]; then