Skip to content

Commit d584fc1

Browse files
committed
Makefile: enable cross compile to multi gpu machine with MULTI_GPU=1
1 parent 8b79e41 commit d584fc1

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Makefile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,10 @@ else ifneq ($(filter gfx90a,$(AMDGPU_TARGETS)),)
8080
else
8181
$(warning Did not find a supported AMD device. Rebuild with AMDGPU_TARGETS env variable to force build for device)
8282
endif
83-
ifeq ($(shell test `$(ROCM_PATH)/llvm/bin/amdgpu-offload-arch -a | grep $(AMDGPU_TARGETS) | wc -l` -lt 2; echo $$?),0)
84-
NO_MULTI_GPU ?= 1
83+
ifndef MULTI_GPU # use MULTI_GPU to force a multi-gpu build in a cross compile situation
84+
ifeq ($(shell test `$(ROCM_PATH)/llvm/bin/amdgpu-offload-arch -a | grep $(AMDGPU_TARGETS) | wc -l` -lt 2; echo $$?),0)
85+
NO_MULTI_GPU ?= 1
86+
endif
8587
endif
8688
HIPCC_FLAGS += $(addprefix --offload-arch=,$(AMDGPU_TARGETS))
8789
ifneq ($(NO_MULTI_GPU), 1)

0 commit comments

Comments
 (0)