File tree Expand file tree Collapse file tree 2 files changed +11
-12
lines changed Expand file tree Collapse file tree 2 files changed +11
-12
lines changed Original file line number Diff line number Diff line change @@ -179,14 +179,13 @@ effectiveStdenv.mkDerivation (
179
179
)
180
180
]
181
181
++ optionals useRocm [
182
- ( cmakeFeature "CMAKE_C_COMPILER" "hipcc" )
183
- ( cmakeFeature "CMAKE_CXX_COMPILER" "hipcc" )
182
+ ( cmakeFeature "CMAKE_HIP_COMPILER" "${ rocmPackages . llvm . clang } /bin/clang" )
184
183
185
184
# Build all targets supported by rocBLAS. When updating search for TARGET_LIST_ROCM
186
185
# in https://github.com/ROCmSoftwarePlatform/rocBLAS/blob/develop/CMakeLists.txt
187
186
# and select the line that matches the current nixpkgs version of rocBLAS.
188
187
# Should likely use `rocmPackages.clr.gpuTargets`.
189
- "-DAMDGPU_TARGETS= gfx803;gfx900;gfx906:xnack-;gfx908:xnack-;gfx90a:xnack+;gfx90a:xnack-;gfx940;gfx941;gfx942;gfx1010;gfx1012;gfx1030;gfx1100;gfx1101;gfx1102"
188
+ ( cmakeFeature "CMAKE_HIP_ARCHITECTURES" " gfx803;gfx900;gfx906:xnack-;gfx908:xnack-;gfx90a:xnack+;gfx90a:xnack-;gfx940;gfx941;gfx942;gfx1010;gfx1012;gfx1030;gfx1100;gfx1101;gfx1102")
190
189
]
191
190
++ optionals useMetalKit [ ( lib . cmakeFeature "CMAKE_C_FLAGS" "-D__ARM_FEATURE_DOTPROD=1" ) ]
192
191
++ optionals useBlas [ ( lib . cmakeFeature "LLAMA_BLAS_VENDOR" "OpenBLAS" ) ] ;
Original file line number Diff line number Diff line change @@ -398,15 +398,15 @@ if (LLAMA_CLBLAST)
398
398
endif ()
399
399
400
400
if (LLAMA_HIPBLAS )
401
- list (APPEND CMAKE_PREFIX_PATH /opt/rocm )
402
-
403
- if (NOT ${CMAKE_C_COMPILER_ID} MATCHES "Clang" )
404
- message (WARNING "Only LLVM is supported for HIP, hint: CC=/opt/rocm/llvm/bin/clang" )
405
- endif ()
406
- if (NOT ${CMAKE_CXX_COMPILER_ID} MATCHES "Clang" )
407
- message (WARNING "Only LLVM is supported for HIP, hint: CXX=/opt/rocm/llvm/bin/clang++" )
401
+ if ($ENV{ROCM_PATH} )
402
+ set (ROCM_PATH $ENV{ROCM_PATH} )
403
+ else ()
404
+ set (ROCM_PATH /opt/rocm )
408
405
endif ()
409
406
407
+ list (APPEND CMAKE_PREFIX_PATH ${ROCM_PATH} )
408
+
409
+ enable_language (HIP )
410
410
find_package (hip )
411
411
find_package (hipblas )
412
412
find_package (rocblas )
@@ -430,8 +430,8 @@ if (LLAMA_HIPBLAS)
430
430
target_compile_definitions (ggml-rocm PRIVATE GGML_CUDA_DMMV_X=${LLAMA_CUDA_DMMV_X} )
431
431
target_compile_definitions (ggml-rocm PRIVATE GGML_CUDA_MMV_Y=${LLAMA_CUDA_MMV_Y} )
432
432
target_compile_definitions (ggml-rocm PRIVATE K_QUANTS_PER_ITERATION=${LLAMA_CUDA_KQUANTS_ITER} )
433
- set_source_files_properties (ggml-cuda.cu PROPERTIES LANGUAGE CXX )
434
- target_link_libraries (ggml-rocm PRIVATE hip::device PUBLIC hip::host roc::rocblas roc::hipblas )
433
+ set_source_files_properties (ggml-cuda.cu PROPERTIES LANGUAGE HIP )
434
+ target_link_libraries (ggml-rocm PUBLIC hip::host roc::rocblas roc::hipblas )
435
435
436
436
if (LLAMA_STATIC )
437
437
message (FATAL_ERROR "Static linking not supported for HIP/ROCm" )
You can’t perform that action at this time.
0 commit comments