marekandreas / elpa

A scalable eigensolver for dense, symmetric (hermitian) matrices (fork of https://gitlab.mpcdf.mpg.de/elpa/elpa.git)
Other
27 stars 13 forks source link

make error when use cuda support #18

Closed Fadelis98 closed 2 years ago

Fadelis98 commented 2 years ago

The system environment is CentOS7 and i'm using intel oneapi toolkit and devtoolset-9, so the complier is latest ifortran+gcc9. As for hardware, the cpu supports avx512 and the GPU is Nvidia A100

It can be compiled successfully without cuda support. FC=mpiifort CC=mpiicc ../configure FCFLAGS="-O3 -xCORE-AVX512" CFLAGS="-O3 -xCORE-AVX512" --enable-option-checking=fatal SCALAPACK_LDFLAGS=" -L${MKLROOT}/lib/intel64 -lmkl_scalapack_lp64 -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -lmkl_blacs_intelmpi_lp64 -lpthread -lm -ldl" SCALAPACK_FCFLAGS=" -I"${MKLROOT}/include"" --enable-avx2 --enable-avx512

However, if I add gpu support: ../configure FC=mpiifort CC=mpicc FCFLAGS="-O3 -xCORE-AVX512" CFLAGS="-O3 -march=skylake-avx512 -mfma -funsafe-loop-optimizations -funsafe-math-optimizations -ftree-vect-loop-version -ftree-vectorize" SCALAPACK_LDFLAGS=" -L${MKLROOT}/lib/intel64 -lmkl_scalapack_lp64 -lmkl_cdft_core -lmkl_blacs_intelmpi_lp64 -liomp5 -lpthread -lm -ldl" SCALAPACK_FCFLAGS=" -qmkl=parallel" --enable-avx2 --enable-avx512 --enable-nvidia-gpu --with-cuda-path=/usr/local/cuda --with-NVIDIA-GPU-compute-capability=sm_80

I got this:

image

marekandreas commented 2 years ago

Hi, it seems that the "-lstdc++" is not linked automatically. Can you try whether adding LIBS="-lstdc++" to configure helps?

Fadelis98 commented 2 years ago

Hi, it seems that the "-lstdc++" is not linked automatically. Can you try whether adding LIBS="-lstdc++" to configure helps?

It works now, Thanks!

marekandreas commented 2 years ago

Ok, great