diff --git a/CMakeLists.txt b/CMakeLists.txt index 620305ca7..76ea27412 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -557,12 +557,17 @@ if (LLAMA_VULKAN) endif() if (LLAMA_HIPBLAS) - if ($ENV{ROCM_PATH}) - set(ROCM_PATH $ENV{ROCM_PATH}) + if (NOT EXISTS $ENV{ROCM_PATH}) + if (NOT EXISTS /opt/rocm) + set(ROCM_PATH /usr) + else() + set(ROCM_PATH /opt/rocm) + endif() else() - set(ROCM_PATH /opt/rocm) + set(ROCM_PATH $ENV{ROCM_PATH}) endif() list(APPEND CMAKE_PREFIX_PATH ${ROCM_PATH}) + list(APPEND CMAKE_PREFIX_PATH "${ROCM_PATH}/lib64/cmake") # CMake on Windows doesn't support the HIP language yet if(WIN32)