[CP2K-user] [CP2K:17938] Re: Errors building CP2K 2022.2 for GPU Inbox

Ole Schütt ole.schuett at cp2k.org
Wed Oct 26 13:03:20 UTC 2022


Hi Luis,

the flags for GPU support have recently changed a bit:

  
https://github.com/cp2k/cp2k/blob/master/INSTALL.md#2i-cuda-optional-improved-performance-on-gpu-systems

 Try adding -D__OFFLOAD_CUDA

-Ole

On Wednesday, October 26, 2022 at 2:35:08 PM UTC+2 LC wrote:

> Hello,
>
> I am trying to build CP2K 2022.2 for NVIDIA GPUs. I've built  ELPA with 
> GPU support (no OpenMP, yes MPI), and COSMA 2.5 with GPU support too. The 
> error I am getting is as follows:
>
> mpifort -c -D__MKL -D__FFTW3 -D__LIBXSMM  -D__LIBINT -D__parallel 
> -D__SCALAPACK -D__HAS_ISO_C_BINDING -D__ACC -D__DBCSR_ACC -D__PW_CUDA 
> -D__GRID_CUDA -D__OFFLOAD_PROFILING -D__HAS_PATCHED_CUFFT_70 -D__COSMA 
> -D__ELPA_NVIDIA_GPU  -D__LIBVORI -D__SPGLIB -O3 -fopenmp -ffree-form 
> -ffree-line-length-none -ftree-vectorize -funroll-loops -std=f2008 
> -I/opt/intel/compilers_and_libraries_2019.5.281/linux/mkl/include 
>  -I/home/COSMA/include -I/home/libxsmm-1.17.0/include   
> -I/home/elpa-2021.11.002/include/elpa-2021.11.002/modules 
> -I/home/elpa-2021.11.002/include/elpa-2021.11.002/elpa 
> -I/home/elpa-2021.11.002/include/elpa-2021.11.002/src/helpers 
> -I/home/fftw-3.3.10/include -I/home/libint-v2.6.0-cp2k-lmax-4/include 
> -I/cuda/cuda-11.2/include -m64 
> -I/opt/intel/compilers_and_libraries_2019.5.281/linux/mkl/include 
> -D__COMPILE_ARCH="\"nvidiaGPU\""  -D__COMPILE_REVISION="\"git:a95ec40\"" 
> -D__DATA_DIR="\"/home/cp2k-2022.2/data\"" 
> -D__SHORT_FILE__="\"xc/xc_input_constants.F\"" 
> -I'/home/cp2k-2022.2/src/xc/' 
> -I'/home/cp2k-2022.2/obj/nvidiaGPU/psmp/exts/dbcsr' xc_input_constants.F90 
>
> /home/cp2k-2022.2/tools/build_utils/fypp -n 
> /home/cp2k-2022.2/src/shg_int/constants_operator.F constants_operator.F90
> cmp: /home/cp2k-2022.2/obj/git-ref: No such file or directory
> /home/cp2k-2022.2/src/pw/gpu/pw_gpu_kernels.h(22): error: identifier 
> "offloadStream_t" is undefined
>
> and here you can see my arch file:
>
>
> NVCC     = ${CUDA_HOME}/bin/nvcc
> GPUVER   = V100
>
> CXX      = mpicxx
> CC       = mpicc
> FC       = mpifort
> LD       = mpifort
> AR       = ar -r
>
> OFFLOAD_CC = nvcc
> OFFLOAD_FLAGS = -O3 -g -w --std=c++11
>
> OPTFLAGS += -fopenmp -O3 -march=native
>
> DFLAGS   += -D__MKL -D__FFTW3 -D__LIBXSMM  -D__LIBINT \
>   -D__parallel -D__SCALAPACK -D__HAS_ISO_C_BINDING
>   
> DFLAGS += -D__ACC -D__DBCSR_ACC -D__PW_CUDA -D__GRID_CUDA 
> -D__OFFLOAD_PROFILING
> DFLAGS += -D__HAS_PATCHED_CUFFT_70 -D__COSMA -D__ELPA_NVIDIA_GPU 
>
> DFLAGS+= -D__LIBVORI -D__SPGLIB
>
> # C++ flags
> CXXFLAGS = -O3 $(OPTFLAGS) -g -I${CUDA_HOME}/include -std=c++11
>
> # NVIDIA 
> NVFLAGS  = $(DFLAGS) $(OPTFLAGS) -g -O3 -arch sm_70 -Xcompiler='-fopenmp' 
> --std=c++11
>
> # Fortran flags
> FCFLAGS  = $(DFLAGS) -O3 -fopenmp -ffree-form -ffree-line-length-none
> FCFLAGS    += -ftree-vectorize -funroll-loops -std=f2008
> INC_FLAGS    = -I${MKLROOT}/include 
> INC_FLAGS    += -I$(COSMA)/include
> INC_FLAGS    += -I$(LIBXSMM)/include  
> INC_FLAGS    += -I$(INCELPA)/modules -I$(INCELPA)/elpa 
> -I$(INCELPA)/src/helpers
> INC_FLAGS    += -I$(LIBFFTW3)/include
> INC_FLAGS    += -I$(LIBINT)/include
> INC_FLAGS    += -I${CUDA_HOME}/include
> INC_FLAGS    += -m64 -I${MKLROOT}/include
>
> # C++ flags
> CXXFLAGS += $(INC_FLAGS)
>
> FCFLAGS +=  $(INC_FLAGS)
>
> # C flags
> CFLAGS   = $(DFLAGS) $(OPTFLAGS) $(INC_FLAGS)
>
> # Libraries
> LDFLAGS  = $(FCFLAGS) 
> LDFLAGS_C = $(FCFLAGS)
>
> # ELPA libs
> LIBS     = $(LIBELPA)/lib/libelpa.a
> # Libvori lib
> LIBS     += $(LIBVORI)/lib/libvori.a
> # LIBXSMM libs
> LIBS    += -L$(LIBXSMM)/lib -lxsmmf -lxsmm -lxsmmext  
> # LIBINT libs
> LIBS    += -L$(LIBINT)/lib -lint2 -lstdc++
> # FFTW libs
> LIBS    += -L$(LIBFFTW3)/lib -lfftw3 -lfftw3_threads
> #SPGLIB
> LIBS    += -L$(LIBSPG)/lib64 -lsymspg
> #LIBXC
> LIBS += -L$(LIBXC)/lib -lxcf03 -lxc
>
> # Scalapack libs
> LIBS    += -L/usr/lib64
>
> LIBS    += -L$(MKLROOT)/lib/intel64 -Wl,--start-group -lmkl_scalapack_lp64 
> -lmkl_gf_lp64 -lmkl_sequential -lmkl_core -l
> mkl_blacs_openmpi_lp64 -Wl,--end-group -lpthread -lz -ldl
>   
> #COSMA
> LIBS    += -L$(COSMA_LIB)/ -lcosma_prefixed_pxgemm -lcosma 
> -lcosta_prefixed_scalapack -lcosta
>
> #CUDA
> LIBS   += -L${CUDA_HOME}/lib64 -lstdc++ -lcudart -lnvrtc -lcuda -lcufft 
> -lcublas -lnvToolsExt
>
> # Required due to memory leak that occurs if high optimisations are used
> mp2_optimize_ri_basis.o: mp2_optimize_ri_basis.F
> $(FC) -c $(subst O2,O0,$(FCFLAGS)) $<
>
> Could anyone help me with this please?
>
> Regards
> LC
>

-- 
You received this message because you are subscribed to the Google Groups "cp2k" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cp2k+unsubscribe at googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cp2k/359554dc-fd75-466e-b155-2b14606e9ca9n%40googlegroups.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.cp2k.org/archives/cp2k-user/attachments/20221026/728fa19c/attachment-0001.htm>


More information about the CP2K-user mailing list