Skip to content

Commit 919c406

Browse files
authored
build : Check the ROCm installation location (#4485)
* build : Check the ROCm installation location * more generic approach * fixup! It was returning the path instead of the command output * fixup! Trailing whitespace
1 parent 4566863 commit 919c406

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

Makefile

+9-3
Original file line numberDiff line numberDiff line change
@@ -439,9 +439,15 @@ ggml-opencl.o: ggml-opencl.cpp ggml-opencl.h
439439
endif # LLAMA_CLBLAST
440440

441441
ifdef LLAMA_HIPBLAS
442-
ROCM_PATH ?= /opt/rocm
443-
HIPCC ?= $(ROCM_PATH)/bin/hipcc
444-
GPU_TARGETS ?= $(shell $(ROCM_PATH)/llvm/bin/amdgpu-arch)
442+
443+
ifeq ($(wildcard /opt/rocm),)
444+
ROCM_PATH ?= /usr
445+
GPU_TARGETS ?= $(shell $(shell which amdgpu-arch))
446+
else
447+
ROCM_PATH ?= /opt/rocm
448+
GPU_TARGETS ?= $(shell $(ROCM_PATH)/llvm/bin/amdgpu-arch)
449+
endif
450+
HIPCC ?= $(ROCM_PATH)/bin/hipcc
445451
LLAMA_CUDA_DMMV_X ?= 32
446452
LLAMA_CUDA_MMV_Y ?= 1
447453
LLAMA_CUDA_KQUANTS_ITER ?= 2

0 commit comments

Comments
 (0)