xiaoyeli / superlu_dist

Distributed memory, MPI based SuperLU
https://portal.nersc.gov/project/sparse/superlu/
Other
188 stars 66 forks source link

error: no instance of overloaded function "atomicAdd" matches the argument list. #155

Closed luoyueyuguang closed 11 months ago

luoyueyuguang commented 11 months ago

I compile it with CMake. It have these errors

error: no instance of overloaded function "atomicAdd" matches the argument list
            argument types are: (double *, double)

My CMake setting is below;

#!/bin/bash
source /home/lgy/software/oneapi-hpc/setvars.sh
export PARMETIS_ROOT=/home/zzh/projects/ASC2024/lapack_cae/parmetis-4.0.3
export PARMETIS_BUILD_DIR=${PARMETIS_ROOT}/build/Linux-x86_64
export COMBBLAS_ROOT=/home/zzh/projects/ASC2024/lapack_cae/CombBLAS
export COMBBLAS_BUILD_DIR=${COMBBLAS_ROOT}/_build
export LD_LIBRARY_PATH=/home/zzh/projects/ASC2024/lapack_cae/lapack-3.11:$LD_LIBRARY_P    ATH
export CUDAC=/usr/local/cuda-12.3/bin/nvcc
rm -rf build
mkdir build;cd build
make clean
cmake .. \
    -DTPL_PARMETIS_INCLUDE_DIRS="${PARMETIS_ROOT}/include;${PARMETIS_ROOT}/metis/include" \
    -DTPL_PARMETIS_LIBRARIES="${PARMETIS_BUILD_DIR}/libparmetis/libparmetis.a;${PARMETIS_BUILD_DIR}/libmetis/libmetis.a" \
    -DTPL_ENABLE_COMBBLASLIB=ON \
    -DTPL_COMBBLAS_INCLUDE_DIRS="${COMBBLAS_ROOT}/_install/include;${COMBBLAS_R\
OOT}/Applications/BipartiteMatchings" \
    -DTPL_COMBBLAS_LIBRARIES="${COMBBLAS_BUILD_DIR}/libCombBLAS.a" \
    -DCMAKE_INSTALL_PREFIX=.
    -DTPL_ENABLE_CUDALIB="/usr/local/cuda-12.3/lib64" \
    -DTPL_ENABLE_LAPACKLIB=ON \
    -D-TPL_LAPACKLIB_LIBRARIES="/lib/x86_64-linux-gnu/liblapack.so"
    -TPL_ENABLE_PARMETISLIB=ON \
    -DTPL_ENABLE_CUDALIB=ON \
    -DCMAKE_CUDA_FLAGS="-arch=sm_70,code=sm_70"
    -DCMAKE_C_FLAGS="-std=c99 -fPIC -O3 -DPRNTlevel=0"
    -DUSE_OPENBLAS

make -j 50

I use cuda-12.3. The gpu that I use is Tesla V100, which compute capability is 7.0. I use such commands compile this file alone.

nvcc -lib pdgstrs_lsum_cuda.cu -o pdgstrs_lsum_cuda.cu.o -arch=compute_70 -code=sm_70,compute_70

It can pass. The same erros in 8.1.2 and 8.2.1. My make.inc is below

############################################################################
#
#  Program:         SuperLU_DIST
#
#  Module:          make.inc
#
#  Purpose:         Top-level Definitions
#
#  Creation date:   March 1, 2016   version 5.0.0
#
#  Modified:        October 13, 2017    version 5.2.1
#           February 20, 2021   version 7.0.0
#           October 5, 2021     version 7.1.0
#
############################################################################
#
#  The name of the libraries to be created/linked to
#
SuperLUroot = /home/zzh/projects/ASC2024/lapack_cae/superlu_dist-8.1.2/build
#DSUPERLULIB = $(SuperLUroot)/SRC/libsuperlu_dist.a
#DSUPERLULIB = $(SuperLUroot)/lib/libsuperlu_dist.a
DSUPERLULIB = /home/zzh/projects/ASC2024/lapack_cae/superlu_dist-8.1.2/build/lib/libsuperlu_dist.a
INCLUDEDIR  = $(SuperLUroot)/include

XSDK_INDEX_SIZE = 
SLU_HAVE_LAPACK = TRUE
HAVE_PARMETIS   = TRUE
HAVE_COLAMD     = 
HAVE_COMBBLAS   = TRUE
HAVE_CUDA       = TRUE
HAVE_HIP        = 

XSDK_ENABLE_Fortran = ON
ifeq ($(XSDK_ENABLE_Fortran),ON)
#  DFORTRANLIB = $(SuperLUroot)/lib/libsuperlu_dist_fortran.a
  DFORTRANLIB = /home/zzh/projects/ASC2024/lapack_cae/superlu_dist-8.1.2/build/lib/libsuperlu_dist_fortran.a
  LIBS = $(DFORTRANLIB) $(DSUPERLULIB) /usr/lib/x86_64-linux-gnu/libopenblas.so -lm
  LIBS +=  -lgfortran -lm -lgcc_s -lgcc -lquadmath -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc
else
  LIBS = $(DSUPERLULIB) /usr/lib/x86_64-linux-gnu/libopenblas.so -lm
endif

LIBS     += /usr/lib/x86_64-linux-gnu/libopenblas.so -lm -ldl
LIBS     += /home/zzh/projects/ASC2024/lapack_cae/parmetis-4.0.3/build/Linux-x86_64/libparmetis/libparmetis.a /home/zzh/projects/ASC2024/lapack_cae/parmetis-4.0.3/build/Linux-x86_64/libmetis/libmetis.a
LIBS     += 
LIBS     += /home/zzh/projects/ASC2024/lapack_cae/CombBLAS/_build/libCombBLAS.a
LIBS     += -lgcc_s -lgcc -lc -lgcc_s -lgcc 
# LIBS     += CUDA::cudart CUDA::cublas CUDA::cusolver

CUDALIBS = /usr/local/cuda-12.3/lib64/libcudart.so /usr/local/cuda-12.3/lib64/libcublas.so
LIBS     += $(CUDALIBS)

#
#  The archiver and the flag(s) to use when building archive (library)
#  If your system has no ranlib, set RANLIB = echo.
#
ARCH         = /usr/bin/ar
ARCHFLAGS    = cr
RANLIB       = /usr/bin/ranlib

CC           = /usr/bin/cc
CFLAGS       = -O3 -DNDEBUG -I/home/zzh/projects/ASC2024/lapack_cae/parmetis-4.0.3/metis/include -I/home/zzh/projects/ASC2024/lapack_cae/parmetis-4.0.3/include -DUSE_VENDOR_BLAS -fopenmp   
##-fPIC
#CFLAGS      += -D
# CFLAGS     += 
CXX          = /usr/bin/c++
CXXFLAGS     = -O3 -DNDEBUG -I/home/zzh/projects/ASC2024/lapack_cae/CombBLAS/Applications/BipartiteMatchings -I/home/zzh/projects/ASC2024/lapack_cae/CombBLAS/_install/include -fopenmp  
NVCC         = /usr/local/cuda-12.3/bin/nvcc
NVCCFLAGS    = -arch=compute_70 -code=sm_70,compute_70

NOOPTS       = -O0
FORTRAN      = /usr/bin/gfortran
FFLAGS       =   

LOADER       = /usr/bin/c++
LOADOPTS     =  -Xlinker --enable-new-dtags -Xlinker -rpath -Xlinker "/home/inspur/nfs/lgy/software/oneapi-hpc/mpi/2021.11/lib" -Xlinker -rpath -Xlinker "/home/inspur/nfs/lgy/software/oneapi-hpc/mpi/2021.11/lib" -Xlinker --enable-new-dtags -Xlinker --enable-new-dtags -Xlinker -rpath -Xlinker "/home/inspur/nfs/lgy/software/oneapi-hpc/mpi/2021.11/lib" -Xlinker -rpath -Xlinker "/home/inspur/nfs/lgy/software/oneapi-hpc/mpi/2021.11/lib" -Xlinker --enable-new-dtags
xiaoyeli commented 11 months ago

@liuyangzhuan Can you please take a look at this? Is it due to earlier version of nvcc not supporting atomic ops ?

liuyangzhuan commented 11 months ago

I think it's because you should have used

-DCMAKE_CUDA_FLAGS="-gencode arch=compute_70,code=sm_70" instead of -DCMAKE_CUDA_FLAGS="-arch=sm_70,code=sm_70" in cmake.

luoyueyuguang commented 11 months ago

sorry, It can't work. But I add set(CMAKE_CUDA_ARCHITECTURES 70;70;70) to CMakeLists.txt. It can work