Skip to content

Commit 17e12ca

Browse files
authored
Merge pull request #1039 from Qubitol/1037-compilation-for-hip-backend-fails-at-linking-stage-due-to-llvm-known-issues
AMD fix
2 parents 1579d33 + 0d59f99 commit 17e12ca

File tree

1 file changed

+4
-4
lines changed
  • epochX/cudacpp/CODEGEN/PLUGIN/CUDACPP_SA_OUTPUT/madgraph/iolibs/template_files/gpu

1 file changed

+4
-4
lines changed

epochX/cudacpp/CODEGEN/PLUGIN/CUDACPP_SA_OUTPUT/madgraph/iolibs/template_files/gpu/cudacpp.mk

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ export CXXFLAGS
114114
override CUDA_HOME = $(patsubst %%/bin/nvcc,%%,$(shell which nvcc 2>/dev/null))
115115

116116
# Set HIP_HOME from the path to hipcc, if it exists
117-
override HIP_HOME = $(patsubst %%/bin/hipcc,%%,$(shell which hipcc 2>/dev/null))
117+
override HIP_HOME = $(shell hipconfig --rocmpath)
118118

119119
# Configure CUDA_INC (for CURAND and NVTX) and NVTX if a CUDA installation exists (see #965)
120120
ifeq ($(CUDA_HOME),)
@@ -243,7 +243,7 @@ else ifeq ($(BACKEND),hip)
243243
###GPUFLAGS += -ggdb # FOR DEBUGGING ONLY
244244

245245
# AMD HIP architecture flags
246-
GPUARCHFLAGS = --offload-arch=gfx90a
246+
GPUARCHFLAGS = --offload-arch=gfx942
247247
GPUFLAGS += $(GPUARCHFLAGS)
248248

249249
# Other AMD-specific flags
@@ -878,7 +878,7 @@ endif
878878
$(gpu_fcheckmain): LIBFLAGS += $(GPULIBFLAGSRPATH) # avoid the need for LD_LIBRARY_PATH
879879
$(gpu_fcheckmain): $(BUILDDIR)/fcheck_sa_fortran.o $(BUILDDIR)/fsampler_$(GPUSUFFIX).o $(LIBDIR)/lib$(MG5AMC_GPULIB).so $(gpu_objects_exe)
880880
ifneq ($(findstring hipcc,$(GPUCC)),) # link fortran/c++/hip using $FC when hipcc is used #802
881-
$(FC) -o $@ $(BUILDDIR)/fcheck_sa_fortran.o $(BUILDDIR)/fsampler_$(GPUSUFFIX).o $(LIBFLAGS) -lgfortran -L$(LIBDIR) -l$(MG5AMC_GPULIB) $(gpu_objects_exe) -lstdc++ -L$(shell hipconfig --rocmpath)/lib -lamdhip64
881+
$(FC) -o $@ $(BUILDDIR)/fcheck_sa_fortran.o $(BUILDDIR)/fsampler_$(GPUSUFFIX).o $(LIBFLAGS) -lgfortran -L$(LIBDIR) -l$(MG5AMC_GPULIB) $(gpu_objects_exe) -lstdc++ -L$(HIP_HOME)/lib -lamdhip64
882882
else
883883
$(GPUCC) -o $@ $(BUILDDIR)/fcheck_sa_fortran.o $(BUILDDIR)/fsampler_$(GPUSUFFIX).o $(LIBFLAGS) -lgfortran -L$(LIBDIR) -l$(MG5AMC_GPULIB) $(gpu_objects_exe)
884884
endif
@@ -979,7 +979,7 @@ else # link only runTest_$(GPUSUFFIX).o (new: in the past, this was linking both
979979
$(gpu_testmain): LIBFLAGS += $(GPULIBFLAGSRPATH) # avoid the need for LD_LIBRARY_PATH
980980
$(gpu_testmain): $(LIBDIR)/lib$(MG5AMC_COMMONLIB).so $(gpu_objects_lib) $(gpu_objects_exe) $(GTESTLIBS)
981981
ifneq ($(findstring hipcc,$(GPUCC)),) # link fortran/c++/hip using $FC when hipcc is used #802
982-
$(FC) -o $@ $(gpu_objects_lib) $(gpu_objects_exe) -ldl $(LIBFLAGS) -lstdc++ -lpthread -L$(shell hipconfig --rocmpath)/lib -lamdhip64
982+
$(FC) -o $@ $(gpu_objects_lib) $(gpu_objects_exe) -ldl $(LIBFLAGS) -lstdc++ -lpthread -L$(HIP_HOME)/lib -lamdhip64
983983
else
984984
$(GPUCC) -o $@ $(gpu_objects_lib) $(gpu_objects_exe) -ldl $(LIBFLAGS) -lcuda
985985
endif

0 commit comments

Comments
 (0)