mirror of
https://github.com/LostRuins/koboldcpp.git
synced 2026-09-19 17:25:07 +02:00
try update cmake for rocm hipblas (not sure if working)
This commit is contained in:
+9
-3
@@ -152,7 +152,13 @@ endif()
|
||||
|
||||
if (LLAMA_HIPBLAS)
|
||||
if (MSVC)
|
||||
list(APPEND CMAKE_PREFIX_PATH "C:/Program Files/AMD/ROCm/5.5")
|
||||
execute_process(COMMAND powershell.exe -Command "Get-ChildItem 'C:/Program Files/AMD/ROCm/' | Sort-Object {$_.Version} | Select-Object -Last 1 | ForEach-Object { Write-Output $_.FullName }"
|
||||
OUTPUT_VARIABLE ROCM_PATH
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
list(APPEND CMAKE_PREFIX_PATH ${ROCM_PATH})
|
||||
add_compile_options("$<$<COMPILE_LANGUAGE:CXX>:-xhip>")
|
||||
message(STATUS "ROCM_PATH: ${ROCM_PATH}")
|
||||
else()
|
||||
list(APPEND CMAKE_PREFIX_PATH /opt/rocm)
|
||||
endif()
|
||||
@@ -177,7 +183,7 @@ if (LLAMA_HIPBLAS)
|
||||
list(APPEND GGML_SOURCES_ROCM ${SRCS})
|
||||
file(GLOB SRCS "ggml/src/ggml-cuda/template-instances/mmq*.cu")
|
||||
list(APPEND GGML_SOURCES_ROCM ${SRCS})
|
||||
add_compile_definitions(GGML_USE_HIP GGML_USE_CUDA SD_USE_CUDA)
|
||||
add_compile_definitions(GGML_USE_HIP GGML_USE_CUDA SD_USE_CUDA GGML_HIP_NO_VMM)
|
||||
add_library(ggml-rocm ${GGML_SOURCES_CUDA})
|
||||
|
||||
file(GLOB SRCS "ggml/src/ggml-cuda/template-instances/fattn-vec*q4_0-q4_0.cu")
|
||||
@@ -206,7 +212,7 @@ if (LLAMA_HIPBLAS)
|
||||
if (LLAMA_STATIC)
|
||||
message(FATAL_ERROR "Static linking not supported for HIP/ROCm")
|
||||
endif()
|
||||
set(LLAMA_EXTRA_LIBS ${LLAMA_EXTRA_LIBS} ggml-rocm ggml-v2-rocm ggml-v2-legacy-rocm)
|
||||
set(LLAMA_EXTRA_LIBS ${LLAMA_EXTRA_LIBS} ggml-rocm ggml-v2-rocm ggml-v3-rocm ggml-v2-legacy-rocm)
|
||||
else()
|
||||
message(WARNING "hipBLAS or HIP not found. Try setting CMAKE_PREFIX_PATH=/opt/rocm")
|
||||
endif()
|
||||
|
||||
Reference in New Issue
Block a user