Issues with installing lammps with cuda

Hi everyone,

I have encountered a problem and I would appreciate any help in resolving it. Here are the details:
module load compiler/cuda/12.1
module load compiler/inteloneAPI/mpi/2021.13
module load compiler/inteloneAPI/tbb
module load compiler/inteloneAPI/compiler-rt/2024.2.1
module load compiler/inteloneAPI/compiler/2024.2.1
module load compiler/inteloneAPI/mkl/2024.2
module load compiler/gcc/12.4.0
cmake -C …/cmake/presets/basic.cmake
-C …/cmake/presets/oneapi.cmake
-D CMAKE_CUDA_COMPILER=/public/software/compiler/cuda/12.1/bin/nvcc
-D LAMMPS_CUDA=yes
-D CMAKE_BUILD_TYPE=Release
-D CMAKE_INSTALL_PREFIX=/public/software/apps/lammps/29Aug2024-intelOneAPI-gpu-4090
-D BUILD_OMP=yes
-D PKG_OPENMP=yes
-D PKG_MOLECULE=yes
-D PKG_MANYBODY=yes
-D PKG_KSPACE=yes
-D PKG_INTEL=yes
-D PKG_SHIK=yes
-D BUILD_SHIK=yes
-D ENABLE_GPU=yes
-D ENABLE_KIM=yes
-D ENABLE_REAXC=yes
-D FFT=MKL
-D FFT_KOKKOS=MKL
-D PKG_GPU=on
-D GPU_ARCH=89
-D GPU_API=cuda
-D CMAKE_CXX_FLAGS=β€œ-msse4.1 -msse4.2”
-D CUDA_TOOLKIT_ROOT_DIR=/public/software/compiler/cuda/12.1
…/cmake
This generated the following file contents:
loading initial cache file …/cmake/presets/basic.cmake
loading initial cache file …/cmake/presets/oneapi.cmake
– Appending /public/software/compiler/gcc/13.3.0/lib64:/public/software/apps/lammps/29Aug2024-inteloneAPI-gpu/lib:/public/software/compiler/intel/oneAPIBaseToolkit/mkl/2024.2/lib:/public/software/compiler/intel/oneAPIBaseToolkit/mpi/2021.13/opt/mpi/libfabric/lib:/public/software/compiler/intel/oneAPIBaseToolkit/mpi/2021.13/lib:/public/software/compiler/intel/oneAPIBaseToolkit/compiler/2024.2/lib:/public/software/compiler/intel/oneAPIBaseToolkit/tbb/2021.13/lib to CMAKE_LIBRARY_PATH: /public/software/compiler/gcc/13.3.0/lib64:/public/software/apps/lammps/29Aug2024-inteloneAPI-gpu/lib:/public/software/compiler/intel/oneAPIBaseToolkit/mkl/2024.2/lib:/public/software/compiler/intel/oneAPIBaseToolkit/mpi/2021.13/opt/mpi/libfabric/lib:/public/software/compiler/intel/oneAPIBaseToolkit/mpi/2021.13/lib:/public/software/compiler/intel/oneAPIBaseToolkit/compiler/2024.2/lib:/public/software/compiler/intel/oneAPIBaseToolkit/tbb/2021.13/lib
– Running check for auto-generated files from make-based build system
– Found OpenMP_CXX: -qopenmp -qopenmp-simd
– Could NOT find FFMPEG (missing: FFMPEG_EXECUTABLE)
– Checking for module β€˜fftw3’
– Package β€˜fftw3’, required by β€˜virtual:world’, not found
– Found OpenMP_CXX: -qopenmp -qopenmp-simd
– Generating style headers…
– Generating package headers…
– Generating lmpinstalledpkgs.h…
– Could NOT find ClangFormat (missing: ClangFormat_EXECUTABLE) (Required is at least version β€œ11.0”)
– The following tools and libraries have been found and configured:

  • Git
  • MPI
  • CURL
  • JPEG
  • PNG
  • ZLIB
  • PkgConfig
  • TBB_MALLOC
  • MKL
  • Threads
  • CUDA
  • OpenMP
  • Python3

– <<< Build configuration >>>
LAMMPS Version: 20240829
Operating System: Linux CentOS 8
CMake Version: 3.20.2
Build type: Release
Install path: /public/software/apps/lammps/29Aug2024-intelOneAPI-gpu-4090
Generator: Unix Makefiles using /usr/bin/gmake
– Enabled packages: GPU;INTEL;KSPACE;MANYBODY;MOLECULE;OPENMP;RIGID
– <<< Compilers and Flags: >>>
– C++ Compiler: /public/software/compiler/intel/oneAPIBaseToolkit/compiler/2024.2/bin/icpx
Type: IntelLLVM
Version: 2024.2.1
C++ Standard: 11
C++ Flags: -msse4.1 -msse4.2 -O3 -DNDEBUG
Defines: LAMMPS_SMALLBIG;LAMMPS_MEMALIGN=64;LAMMPS_OMP_COMPAT=4;LAMMPS_CURL;LAMMPS_JPEG;LAMMPS_PNG;LAMMPS_GZIP;FFT_MKL;FFT_MKL_THREADS;LMP_OPENMP;LMP_INTEL;LMP_INTEL_USELRT;LMP_USE_MKL_RNG;LMP_GPU
Options: -Wno-tautological-constant-compare;-Wno-unused-command-line-argument
– <<< Linker flags: >>>
– Executable name: lmp
– Static library flags:
– <<< MPI flags >>>
– MPI_defines: MPICH_SKIP_MPICXX;OMPI_SKIP_MPICXX;_MPICC_H
– MPI includes: /public/software/compiler/intel/oneAPIBaseToolkit/mpi/2021.13/include
– MPI libraries: /public/software/compiler/intel/oneAPIBaseToolkit/mpi/2021.13/lib/libmpicxx.so;/public/software/compiler/intel/oneAPIBaseToolkit/mpi/2021.13/lib/libmpi.so;/usr/lib64/librt.so;/usr/lib64/libpthread.so;/usr/lib64/libdl.so;
– <<< GPU package settings >>>
– GPU API: CUDA
– CUDA Compiler: /public/software/compiler/cuda/12.1/bin/nvcc
– GPU default architecture: 89
– GPU binning with CUDPP: OFF
– CUDA MPS support: OFF
– GPU precision: MIXED
– <<< FFT settings >>>
– Primary FFT lib: MKL
– Using double precision FFTs
– Using threaded FFTs
– Using builtin distributed FFT algorithms
– Configuring done
– Generating done
– Build files have been written to: /public/sourcecode/lammps1/lammps-stable_29Aug2024_update1/build
Howere, when i run make, here are the output:
[ 0%] Building NVCC fatbin file cuda_compile_fatbin_1_generated_lal_zbl.cu.fatbin
[ 0%] Built target memory.h
[ 0%] Built target fmt_core.h
[ 1%] Built target nvc_get_devices
[ 1%] Building NVCC fatbin file cuda_compile_fatbin_1_generated_lal_atom.cu.fatbin
[ 1%] Building NVCC fatbin file cuda_compile_fatbin_1_generated_lal_amoeba.cu.fatbin
[ 2%] Built target variable.h
[ 2%] Building NVCC fatbin file cuda_compile_fatbin_1_generated_lal_beck.cu.fatbin
/public/software/compiler/gcc/12.4.0/lib/gcc/x86_64-pc-linux-gnu/12.4.0/…/…/…/…/include/c++/12.4.0/ext/type
_traits.h(196): error: parameter pack β€œ_Tp” was referenced but not expanded
using __promoted_t = decltype((typename __promote<_Tp>::__type(0) + …));
^
/public/software/compiler/gcc/12.4.0/lib/gcc/x86_64-pc-linux-gnu/12.4.0/…/…/…/…/include/c++/12.4.0/ext/type
_traits.h(196): error: expected an expression
using __promoted_t = decltype((typename __promote<_Tp>::__type(0) + …));
^
/public/software/compiler/gcc/12.4.0/lib/gcc/x86_64-pc-linux-gnu/12.4.0/…/…/…/…/include/c++/12.4.0/ext/type
_traits.h(196): error: parameter pack β€œ_Tp” was referenced but not expanded
using __promoted_t = decltype((typename __promote<_Tp>::__type(0) + …));
^
/public/software/compiler/gcc/12.4.0/lib/gcc/x86_64-pc-linux-gnu/12.4.0/…/…/…/…/include/c++/12.4.0/ext/type
_traits.h(196): error: expected an expression
using __promoted_t = decltype((typename __promote<_Tp>::__type(0) + …));
^
/public/software/compiler/gcc/12.4.0/lib/gcc/x86_64-pc-linux-gnu/12.4.0/…/…/…/…/include/c++/12.4.0/ext/type
_traits.h(196): error: parameter pack β€œ_Tp” was referenced but not expanded
using __promoted_t = decltype((typename __promote<_Tp>::__type(0) + …));
^
/public/software/compiler/gcc/12.4.0/lib/gcc/x86_64-pc-linux-gnu/12.4.0/…/…/…/…/include/c++/12.4.0/ext/type
_traits.h(196): error: expected an expression
using __promoted_t = decltype((typename __promote<_Tp>::__type(0) + …));
^
/public/software/compiler/gcc/12.4.0/lib/gcc/x86_64-pc-linux-gnu/12.4.0/…/…/…/…/include/c++/12.4.0/type_tra
:
I want use lammps with GPU, how can i fix this issue.
Thank you in advance for your assistance!

Best regards,

Need more info: what is the error message you get, what version of LAMMPS, etc.

I would be very grateful for your help.

The nvcc compiler is very particular and has limitations which combination of compiler and OS version can be used in combination with it.

I would suggest to simplify your configuration and remove anything related to the Intel compiler and compile with GCC and the basic preset only and the GPU package added.

If you get the same issue, then you would probably need to switch to an older gcc version.
If this completes the compilation and can run the benchmark examples with GPU acceleration, then you can step-by-step re-add packages and compiler settings and you will then see where things fail.

[Update]

I forgot to mention that another way to avoid any nvcc issues, is to compile the GPU package for the OpenCL API instead of CUDA. Performance should be almost the same for most cases.

I really appreciate your help! I successfully installed LAMMPS following your instructions. I removed everything related to CUDA and switched to OpenCL instead. Since my server is offline, LAMMPS was attempting to download OpenCL, so I added the following command to CMake:" -D USE_STATIC_OPENCL_LOADER=no \ -D OpenCL_LIBRARIES=/public/software/lib/opencl/lib64\ " to prevent any downloads. I manually installed the OpenCL library on my server and compiled LAMMPS successfully. After installation, I completed the GPU test. I’m very grateful for your assistance, which solved the problem that was bothering me for a day!
Here is my cmake command:
cmake -C …/cmake/presets/basic.cmake
-C …/cmake/presets/oneapi.cmake
-D CMAKE_CUDA_COMPILER=/public/software/compiler/cuda/12.1/bin/nvcc
-D LAMMPS_CUDA=yes
-D CMAKE_BUILD_TYPE=Release
-D CMAKE_INSTALL_PREFIX=/public/software/apps/lammps/29Aug2024-intelOneAPI-gpu-4090
-D BUILD_OMP=yes
-D PKG_OPENMP=yes
-D PKG_MOLECULE=yes
-D PKG_MANYBODY=yes
-D PKG_KSPACE=yes
-D PKG_INTEL=yes
-D PKG_SHIK=yes
-D BUILD_SHIK=yes
-D ENABLE_GPU=yes
-D ENABLE_KIM=yes
-D ENABLE_REAXC=yes
-D PKG_REAXC=yes
-D FFT=MKL
-D FFT_KOKKOS=MKL
-D PKG_GPU=on
-D GPU_API=opencl
-D USE_STATIC_OPENCL_LOADER=no
-D OpenCL_LIBRARIES=/public/software/lib/opencl/lib64
-D CMAKE_CXX_FLAGS=β€œ-msse4.1 -msse4.2”
…/cmake

2 Likes