]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
build : Check the ROCm installation location (#4485)
authorMatheus Gabriel Alves Silva <redacted>
Sun, 17 Dec 2023 15:23:33 +0000 (12:23 -0300)
committerGitHub <redacted>
Sun, 17 Dec 2023 15:23:33 +0000 (17:23 +0200)
* build : Check the ROCm installation location

* more generic approach

* fixup! It was returning the path instead of the command output

* fixup! Trailing whitespace

Makefile

index fb775ae5b682e1b25327618278e5bcc1e486951b..8273f84004df69bbd8c9b8c97ec24fd7a2771fd1 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -439,9 +439,15 @@ ggml-opencl.o: ggml-opencl.cpp ggml-opencl.h
 endif # LLAMA_CLBLAST
 
 ifdef LLAMA_HIPBLAS
-       ROCM_PATH       ?= /opt/rocm
-       HIPCC       ?= $(ROCM_PATH)/bin/hipcc
-       GPU_TARGETS ?= $(shell $(ROCM_PATH)/llvm/bin/amdgpu-arch)
+
+       ifeq ($(wildcard /opt/rocm),)
+               ROCM_PATH       ?= /usr
+               GPU_TARGETS ?= $(shell $(shell which amdgpu-arch))
+       else
+               ROCM_PATH       ?= /opt/rocm
+               GPU_TARGETS ?= $(shell $(ROCM_PATH)/llvm/bin/amdgpu-arch)
+       endif
+       HIPCC                   ?= $(ROCM_PATH)/bin/hipcc
        LLAMA_CUDA_DMMV_X       ?= 32
        LLAMA_CUDA_MMV_Y        ?= 1
        LLAMA_CUDA_KQUANTS_ITER ?= 2