From 9ab904562ea2eb650e81eea4b6daef2bc8a6257d Mon Sep 17 00:00:00 2001 From: DaniAndTheWeb <57776841+DaniAndTheWeb@users.noreply.github.com> Date: Sat, 20 Jan 2024 03:11:04 +0000 Subject: [PATCH] Debian Unstable compatibility for HIP (#620) * Support rocm on Debian unstable * Update Makefile --- Makefile | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 5b2376eb1..c0a6ded52 100644 --- a/Makefile +++ b/Makefile @@ -198,10 +198,17 @@ ggml_v3-cuda.o: otherarch/ggml_v3-cuda.cu otherarch/ggml_v3-cuda.h endif # LLAMA_CUBLAS ifdef LLAMA_HIPBLAS - ROCM_PATH ?= /opt/rocm - HCC := $(ROCM_PATH)/llvm/bin/clang - HCXX := $(ROCM_PATH)/llvm/bin/clang++ - GPU_TARGETS ?= gfx803 gfx900 gfx906 gfx908 gfx90a gfx1030 gfx1100 $(shell $(ROCM_PATH)/llvm/bin/amdgpu-arch) + ifeq ($(wildcard /opt/rocm),) + ROCM_PATH ?= /usr + GPU_TARGETS ?= $(shell $(shell which amdgpu-arch)) + HCC := $(ROCM_PATH)/bin/hipcc + HCXX := $(ROCM_PATH)/bin/hipcc + else + ROCM_PATH ?= /opt/rocm + GPU_TARGETS ?= gfx803 gfx900 gfx906 gfx908 gfx90a gfx1030 gfx1100 $(shell $(ROCM_PATH)/llvm/bin/amdgpu-arch) + HCC := $(ROCM_PATH)/llvm/bin/clang + HCXX := $(ROCM_PATH)/llvm/bin/clang++ + endif LLAMA_CUDA_DMMV_X ?= 32 LLAMA_CUDA_MMV_Y ?= 1 LLAMA_CUDA_KQUANTS_ITER ?= 2