Running lammps with kokkos

I am new to kokkos and I am having trouble running lammps (lammps-stable_23Jun2022_update1) with kokkos on a supercomputer. Lammps always complains about not being able to find kokkos.

I am pretty sure that kokkos module has been loaded. Do I need to add kokkos path to somewhere?

Below are the commands and error message:

module load kokkos/2.7.24
lmp_kokkos -k on g 1 -sf kk -pk kokkos -in input.txt
ERROR: Cannot use -kokkos on without KOKKOS installed (src/lammps.cpp:649)

That may well be, but the LAMMPS executable is compiled without the KOKKOS package included.

Thank you for the reply. I tried to compile lammps with kokkos and did not see any error (except warnings). Below is how the executable was compiled

  • module load nixpkgs/16.09 intel/2018.3 openmpi/3.1.2
  • module load cmake/3.12.3
  • module load kokkos/2.7.24
  • unzip lammps-stable_23Jun2022_update1.zip -d .
  • mv lammps-stable_23Jun2022_update1 lammps_gpu
  • cd lammps_gpu
  • rm -rf build && mkdir build && cd build
  • cmake …/cmake -DPKG_MACHDYN=yes -DDOWNLOAD_EIGEN3=yes -DPKG_MANYBODY=yes -DKokkos_ENABLE_CUDA=yes
  • make -j8

Do you think if more flags are needed in cmake? How do I tell if the compilation is good?

Run ./lmp -h in the build folder and check the output.

Yes, please check: 3.7. Packages with extra build options — LAMMPS documentation

Ok, below is the output of “./lmp -h”. Can you tell if lammps compiled properly with kokkos?

[1665869734.494330] [beluga3:191676:0] sys.c:744 MXM WARN Conflicting CPU frequencies detected, using: 3402.83
[1665869734.604292] [beluga3:191676:0] mxm.c:196 MXM WARN The ‘ulimit -s’ on the system is set to ‘unlimited’. This may have negative performance implications. Please set the stack size to the default value (10240)

Large-scale Atomic/Molecular Massively Parallel Simulator - 23 Jun 2022 - Update 1

Usage example: ./lmp -var t 300 -echo screen -in in.alloy

List of command line options supported by this LAMMPS executable:

-echo none/screen/log/both : echoing of input script (-e)
-help : print this help message (-h)
-in none/filename : read input from file or stdin (default) (-i)
-kokkos on/off … : turn KOKKOS mode on or off (-k)
-log none/filename : where to send log output (-l)
-mdi ‘’ : pass flags to the MolSSI Driver Interface
-mpicolor color : which exe in a multi-exe mpirun cmd (-m)
-cite : select citation reminder style (-c)
-nocite : disable citation reminder (-nc)
-package style … : invoke package command (-pk)
-partition size1 size2 … : assign partition sizes (-p)
-plog basename : basename for partition logs (-pl)
-pscreen basename : basename for partition screens (-ps)
-restart2data rfile dfile … : convert restart to data file (-r2data)
-restart2dump rfile dgroup dstyle dfile …
: convert restart to dump file (-r2dump)
-reorder topology-specs : processor reordering (-r)
-screen none/filename : where to send screen output (-sc)
-skiprun : skip loops in run and minimize (-sr)
-suffix gpu/intel/opt/omp : style suffix to apply (-sf)
-var varname value : set index style variable (-v)

OS: Linux “CentOS Linux 7 (Core)” 3.10.0-1160.76.1.el7.x86_64 x86_64

Compiler: GNU C++ 7.3.0 with OpenMP 4.5
C++ standard: C++11
MPI v3.1: Open MPI v3.1.2, package: Open MPI [email protected] Distribution, ident: 3.1.2, repo rev: v3.1.2, Aug 22, 2018

Accelerator configuration:

Active compile time flags:

-DLAMMPS_GZIP
-DLAMMPS_PNG
-DLAMMPS_JPEG
-DLAMMPS_FFMPEG
-DLAMMPS_SMALLBIG
sizeof(smallint): 32-bit
sizeof(imageint): 32-bit
sizeof(tagint): 32-bit
sizeof(bigint): 64-bit

Available compression formats:

Extension: .gz Command: gzip
Extension: .bz2 Command: bzip2
Extension: .zst Command: zstd
Extension: .xz Command: xz
Extension: .lzma Command: xz
Extension: .lz4 Command: lz4

Installed packages:

MACHDYN MANYBODY

List of individual style options included in this LAMMPS executable

  • Atom styles:

atomic body charge ellipsoid hybrid
line smd sphere tri

  • Integrate styles:

respa verlet

  • Minimize styles:

cg fire fire/old hftn quickmin
sd

  • Pair styles:

adp airebo airebo/morse atm bop
born buck buck/coul/cut comb comb3
coul/cut coul/debye coul/dsf coul/wolf reax
eam eam/alloy eam/cd eam/cd/old eam/fs
eam/he edip edip/multi eim extep
gw gw/zbl hybrid hybrid/overlay hybrid/scaled
lcbop lj/cut lj/cut/coul/cut lj/expand local/density
meam/spline meam/sw/spline morse nb3b/harmonic polymorphic
rebo smd/hertz smd/tlsph smd/tri_surface smd/ulsph
soft sw sw/angle/table sw/mod table
tersoff tersoff/mod tersoff/mod/c tersoff/table tersoff/zbl
threebody/table vashishta vashishta/table yukawa zbl
zero

  • Bond styles:

hybrid zero

  • Angle styles:

hybrid zero

  • Dihedral styles:

hybrid zero

  • Improper styles:

hybrid zero

  • KSpace styles:

  • Fix styles

adapt addforce ave/atom ave/chunk ave/correlate
ave/histo ave/histo/weight ave/time aveforce
balance box/relax deform deposit ave/spatial
ave/spatial/sphere lb/pc lb/rigid/pc/sphere
client/md dt/reset efield enforce2d evaporate
external gravity halt heat indent
langevin lineforce momentum move nph
nph/sphere npt npt/sphere nve nve/limit
nve/noforce nve/sphere nvt nvt/sllod nvt/sphere
planeforce press/berendsen print property/atom qeq/comb
recenter restrain setforce smd/adjust_dt
smd/integrate_tlsph smd/integrate_ulsph
smd/move_tri_surf smd/setvel smd/wall_surface
spring spring/chunk spring/self store/force store/state
temp/berendsen temp/rescale thermal/conductivity vector
viscous wall/harmonic wall/lj1043 wall/lj126 wall/lj93
wall/morse wall/reflect wall/region

  • Compute styles:

aggregate/atom angle angle/local angmom/chunk bond
bond/local centro/atom centroid/stress/atom chunk/atom
chunk/spread/atom cluster/atom cna/atom com
com/chunk coord/atom dihedral dihedral/local dipole
dipole/chunk displace/atom erotate/sphere erotate/sphere/atom
fragment/atom global/atom group/group gyration gyration/chunk
heat/flux improper improper/local inertia/chunk ke
ke/atom msd msd/chunk omega/chunk orientorder/atom
pair pair/local pe pe/atom pressure
property/atom property/chunk property/local rdf reduce
reduce/chunk reduce/region slice smd/contact/radius
smd/damage smd/hourglass/error smd/internal/energy
smd/plastic/strain smd/plastic/strain/rate smd/rho
smd/tlsph/defgrad smd/tlsph/dt smd/tlsph/num/neighs
smd/tlsph/shape smd/tlsph/strain smd/tlsph/strain/rate
smd/tlsph/stress smd/triangle/vertices smd/ulsph/effm
smd/ulsph/num/neighs smd/ulsph/strain
smd/ulsph/strain/rate smd/ulsph/stress smd/vol
stress/atom temp temp/chunk temp/com temp/deform
temp/partial temp/profile temp/ramp temp/region temp/sphere
torque/chunk vacf vcm/chunk

  • Region styles:

block cone cylinder ellipsoid intersect
plane prism sphere union

  • Dump styles:

atom cfg custom image local
movie xyz

  • Command styles

balance change_box create_atoms create_bonds create_box
delete_atoms delete_bonds reset_ids kim_init kim_interactions
kim_param kim_property kim_query message server
displace_atoms info minimize read_data read_dump
read_restart replicate rerun reset_atom_ids reset_mol_ids
run set velocity write_coeff write_data
write_dump write_restart

It did not. You can see the Installed Packages section contains only MACHDYN and MANYBODY. Follow Axel’s suggested reading for section 3.7 of the manual.

1 Like

You need cmake -D PKG_KOKKOS=yes

1 Like

By loading more modules and adding more flags, the compilation still does not go through unfortunately.

module loading commands

  • module load StdEnv/2020 nvhpc/22.7
  • module load cuda/11.4
  • module load cmake/3.23.1

cmake command

cmake …/cmake -DPKG_MACHDYN=yes -DDOWNLOAD_EIGEN3=yes -DPKG_MANYBODY=yes -DKokkos_ARCH_HOSTARCH=yes -DKokkos_ARCH_GPUARCH=yes -DKokkos_ENABLE_CUDA=yes -DKokkos_ENABLE_OPENMP=yes -DPKG_KOKKOS=yes -DKokkos_ARCH_VOLTA70=ON

cmake warning msg

Manually-specified variables were not used by the project:
Kokkos_ARCH_GPUARCH
Kokkos_ARCH_HOSTARCH

make command

make -j8

make error msg

[ 0%] Generating includes/lammps/citeme.h
[ 0%] Generating includes/lammps/comm.h
[ 0%] Creating directories for ‘Eigen3_build’
[ 0%] Generating includes/lammps/angle.h
[ 0%] Generating includes/lammps/bond.h
[ 0%] Generating includes/lammps/atom.h
[ 0%] Building CXX object lib/kokkos/core/src/CMakeFiles/kokkoscore.dir/impl/Kokkos_CPUDiscovery.cpp.o
[ 0%] Built target citeme.h
– Git Directory: /home/bluegene/projects/def-hongguo/bluegene/proj01_NanoMD2/lammps_gpu/.git
– Generating lmpgitversion.h…
[ 0%] Built target bond.h
[ 0%] Built target comm.h
[ 0%] Performing download step (download, verify and extract) for ‘Eigen3_build’
[ 0%] Building CXX object lib/kokkos/core/src/CMakeFiles/kokkoscore.dir/impl/Kokkos_Command_Line_Parsing.cpp.o
[ 0%] Building CXX object lib/kokkos/core/src/CMakeFiles/kokkoscore.dir/impl/Kokkos_Core.cpp.o
[ 0%] Built target atom.h
– Downloading…
dst=‘/home/bluegene/projects/def-hongguo/bluegene/proj01_NanoMD2/lammps_gpu/build4/Eigen3_build-prefix/src/eigen-3.4.0.tar.gz’
timeout=‘none’
inactivity timeout=‘none’
– Using src=‘https://download.lammps.org/thirdparty/eigen-3.4.0.tar.gz
[ 0%] Built target angle.h
[ 0%] Generating includes/lammps/compute.h
[ 0%] Built target compute.h
[ 1%] Generating includes/lammps/dihedral.h
[ 1%] Built target gitversion
[ 1%] Building CXX object lib/kokkos/core/src/CMakeFiles/kokkoscore.dir/impl/Kokkos_Error.cpp.o
[ 1%] Generating includes/lammps/domain.h
– [download 1% complete]
– [download 2% complete]
– [download 3% complete]
– [download 4% complete]
[ 1%] Built target dihedral.h
[ 1%] Built target domain.h
– [download 5% complete]
– [download 6% complete]
– [download 7% complete]
– [download 8% complete]
– [download 9% complete]
– [download 10% complete]
– [download 11% complete]
– [download 12% complete]
– [download 13% complete]
– [download 14% complete]
– [download 15% complete]
– [download 16% complete]
– [download 17% complete]
[ 1%] Generating includes/lammps/error.h
[ 1%] Building CXX object lib/kokkos/core/src/CMakeFiles/kokkoscore.dir/impl/Kokkos_ExecPolicy.cpp.o
– [download 18% complete]
– [download 19% complete]
– [download 20% complete]
– [download 21% complete]
– [download 22% complete]
– [download 23% complete]
– [download 24% complete]
– [download 25% complete]
– [download 26% complete]
– [download 27% complete]
– [download 28% complete]
– [download 29% complete]
– [download 30% complete]
– [download 31% complete]
– [download 32% complete]
– [download 33% complete]
– [download 34% complete]
– [download 35% complete]
– [download 36% complete]
– [download 37% complete]
– [download 38% complete]
– [download 39% complete]
– [download 40% complete]
– [download 41% complete]
– [download 42% complete]
– [download 43% complete]
– [download 44% complete]
– [download 45% complete]
– [download 46% complete]
– [download 47% complete]
– [download 48% complete]
– [download 49% complete]
– [download 50% complete]
– [download 51% complete]
– [download 52% complete]
– [download 53% complete]
– [download 54% complete]
– [download 55% complete]
– [download 56% complete]
– [download 57% complete]
– [download 58% complete]
– [download 59% complete]
– [download 60% complete]
– [download 61% complete]
– [download 62% complete]
– [download 63% complete]
– [download 64% complete]
– [download 65% complete]
– [download 66% complete]
– [download 67% complete]
– [download 68% complete]
– [download 69% complete]
– [download 70% complete]
– [download 71% complete]
– [download 72% complete]
– [download 73% complete]
– [download 74% complete]
– [download 75% complete]
– [download 76% complete]
– [download 77% complete]
– [download 78% complete]
– [download 79% complete]
– [download 80% complete]
– [download 81% complete]
– [download 82% complete]
– [download 83% complete]
– [download 84% complete]
– [download 85% complete]
– [download 86% complete]
– [download 87% complete]
– [download 88% complete]
– [download 89% complete]
– [download 90% complete]
– [download 91% complete]
– [download 92% complete]
– [download 93% complete]
– [download 94% complete]
– [download 95% complete]
– [download 96% complete]
– [download 97% complete]
– [download 98% complete]
– [download 99% complete]
– [download 100% complete]
– verifying file…
file=‘/home/bluegene/projects/def-hongguo/bluegene/proj01_NanoMD2/lammps_gpu/build4/Eigen3_build-prefix/src/eigen-3.4.0.tar.gz’
[ 1%] Generating includes/lammps/fix.h
– Downloading… done
[ 1%] Built target error.h
[ 2%] Building CXX object lib/kokkos/core/src/CMakeFiles/kokkoscore.dir/impl/Kokkos_HostBarrier.cpp.o
[ 2%] Built target fix.h
– extracting…
src=‘/home/bluegene/projects/def-hongguo/bluegene/proj01_NanoMD2/lammps_gpu/build4/Eigen3_build-prefix/src/eigen-3.4.0.tar.gz’
dst=‘/home/bluegene/projects/def-hongguo/bluegene/proj01_NanoMD2/lammps_gpu/build4/Eigen3_build-prefix/src/Eigen3_build’
– extracting… [tar xfz]
[ 3%] Generating includes/lammps/force.h
[ 3%] Built target force.h
[ 3%] Building CXX object lib/kokkos/core/src/CMakeFiles/kokkoscore.dir/impl/Kokkos_HostSpace.cpp.o
/cvmfs/soft.computecanada.ca/easybuild/software/2020/Core/gcccore/11.3.0/include/c++/11.3.0/bits/std_function.h:435:145: error: parameter packs not expanded with ‘…’:
435 | function(_Functor&& __f)
| ^
/cvmfs/soft.computecanada.ca/easybuild/software/2020/Core/gcccore/11.3.0/include/c++/11.3.0/bits/std_function.h:435:145: note: ‘_ArgTypes’
/cvmfs/soft.computecanada.ca/easybuild/software/2020/Core/gcccore/11.3.0/include/c++/11.3.0/bits/std_function.h:530:146: error: parameter packs not expanded with ‘…’:
530 | operator=(_Functor&& __f)
| ^
/cvmfs/soft.computecanada.ca/easybuild/software/2020/Core/gcccore/11.3.0/include/c++/11.3.0/bits/std_function.h:530:146: note: ‘_ArgTypes’
make[2]: *** [lib/kokkos/core/src/CMakeFiles/kokkoscore.dir/build.make:76: lib/kokkos/core/src/CMakeFiles/kokkoscore.dir/impl/Kokkos_CPUDiscovery.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs…
[ 3%] Generating includes/lammps/group.h
/cvmfs/soft.computecanada.ca/easybuild/software/2020/Core/gcccore/11.3.0/include/c++/11.3.0/bits/std_function.h:435:145: error: parameter packs not expanded with ‘…’:
435 | function(_Functor&& __f)
| ^
/cvmfs/soft.computecanada.ca/easybuild/software/2020/Core/gcccore/11.3.0/include/c++/11.3.0/bits/std_function.h:435:145: note: ‘_ArgTypes’
/cvmfs/soft.computecanada.ca/easybuild/software/2020/Core/gcccore/11.3.0/include/c++/11.3.0/bits/std_function.h:530:146: error: parameter packs not expanded with ‘…’:
530 | operator=(_Functor&& __f)
| ^
/cvmfs/soft.computecanada.ca/easybuild/software/2020/Core/gcccore/11.3.0/include/c++/11.3.0/bits/std_function.h:530:146: note: ‘_ArgTypes’
[ 3%] Built target group.h
make[2]: *** [lib/kokkos/core/src/CMakeFiles/kokkoscore.dir/build.make:90: lib/kokkos/core/src/CMakeFiles/kokkoscore.dir/impl/Kokkos_Command_Line_Parsing.cpp.o] Error 1
[ 3%] Generating includes/lammps/improper.h
[ 3%] Built target improper.h
[ 3%] Generating includes/lammps/input.h
[ 3%] Generating includes/lammps/info.h
[ 3%] Built target input.h
[ 3%] Built target info.h
[ 3%] Generating includes/lammps/kspace.h
[ 3%] Generating includes/lammps/lammps.h
[ 3%] Built target kspace.h
[ 3%] Built target lammps.h
[ 4%] Generating includes/lammps/library.h
[ 4%] Built target library.h
[ 4%] Generating includes/lammps/lattice.h
[ 4%] Generating includes/lammps/lmppython.h
[ 4%] Built target lattice.h
[ 4%] Built target lmppython.h
[ 4%] Generating includes/lammps/lmptype.h
[ 5%] Generating includes/lammps/memory.h
[ 5%] Built target lmptype.h
/cvmfs/soft.computecanada.ca/easybuild/software/2020/Core/gcccore/11.3.0/include/c++/11.3.0/bits/std_function.h:435:145: error: parameter packs not expanded with ‘…’:
435 | function(_Functor&& __f)
| ^
/cvmfs/soft.computecanada.ca/easybuild/software/2020/Core/gcccore/11.3.0/include/c++/11.3.0/bits/std_function.h:435:145: note: ‘_ArgTypes’
/cvmfs/soft.computecanada.ca/easybuild/software/2020/Core/gcccore/11.3.0/include/c++/11.3.0/bits/std_function.h:530:146: error: parameter packs not expanded with ‘…’:
530 | operator=(_Functor&& __f)
| ^
/cvmfs/soft.computecanada.ca/easybuild/software/2020/Core/gcccore/11.3.0/include/c++/11.3.0/bits/std_function.h:530:146: note: ‘_ArgTypes’
[ 5%] Built target memory.h
[ 5%] Generating includes/lammps/modify.h
[ 5%] Built target modify.h
[ 5%] Generating includes/lammps/neighbor.h
[ 5%] Generating includes/lammps/neigh_list.h
[ 5%] Built target neighbor.h
[ 5%] Built target neigh_list.h
/cvmfs/soft.computecanada.ca/easybuild/software/2020/Core/gcccore/11.3.0/include/c++/11.3.0/bits/std_function.h:435:145: error: parameter packs not expanded with ‘…’:
435 | function(_Functor&& __f)
| ^
/cvmfs/soft.computecanada.ca/easybuild/software/2020/Core/gcccore/11.3.0/include/c++/11.3.0/bits/std_function.h:435:145: note: ‘_ArgTypes’
/cvmfs/soft.computecanada.ca/easybuild/software/2020/Core/gcccore/11.3.0/include/c++/11.3.0/bits/std_function.h:530:146: error: parameter packs not expanded with ‘…’:
530 | operator=(_Functor&& __f)
| ^
/cvmfs/soft.computecanada.ca/easybuild/software/2020/Core/gcccore/11.3.0/include/c++/11.3.0/bits/std_function.h:530:146: note: ‘_ArgTypes’
[ 5%] Generating includes/lammps/output.h
[ 5%] Generating includes/lammps/pair.h
make[2]: *** [lib/kokkos/core/src/CMakeFiles/kokkoscore.dir/build.make:118: lib/kokkos/core/src/CMakeFiles/kokkoscore.dir/impl/Kokkos_Error.cpp.o] Error 1
[ 5%] Built target output.h
[ 5%] Built target pair.h
make[2]: *** [lib/kokkos/core/src/CMakeFiles/kokkoscore.dir/build.make:146: lib/kokkos/core/src/CMakeFiles/kokkoscore.dir/impl/Kokkos_HostBarrier.cpp.o] Error 1
[ 6%] Generating includes/lammps/region.h
[ 6%] Generating includes/lammps/pointers.h
[ 6%] Generating includes/lammps/timer.h
[ 6%] Generating includes/lammps/universe.h
[ 6%] Built target pointers.h
[ 6%] Built target region.h
[ 6%] Built target universe.h
[ 6%] Built target timer.h
[ 6%] Generating includes/lammps/update.h
[ 6%] Generating includes/lammps/utils.h
[ 7%] Generating includes/lammps/variable.h
[ 7%] Built target update.h
[ 7%] Built target utils.h
[ 7%] Built target variable.h
/cvmfs/soft.computecanada.ca/easybuild/software/2020/Core/gcccore/11.3.0/include/c++/11.3.0/bits/std_function.h:435:145: error: parameter packs not expanded with ‘…’:
435 | function(_Functor&& __f)
| ^
/cvmfs/soft.computecanada.ca/easybuild/software/2020/Core/gcccore/11.3.0/include/c++/11.3.0/bits/std_function.h:435:145: note: ‘_ArgTypes’
/cvmfs/soft.computecanada.ca/easybuild/software/2020/Core/gcccore/11.3.0/include/c++/11.3.0/bits/std_function.h:530:146: error: parameter packs not expanded with ‘…’:
530 | operator=(_Functor&& __f)
| ^
/cvmfs/soft.computecanada.ca/easybuild/software/2020/Core/gcccore/11.3.0/include/c++/11.3.0/bits/std_function.h:530:146: note: ‘_ArgTypes’
make[2]: *** [lib/kokkos/core/src/CMakeFiles/kokkoscore.dir/build.make:160: lib/kokkos/core/src/CMakeFiles/kokkoscore.dir/impl/Kokkos_HostSpace.cpp.o] Error 1
/cvmfs/soft.computecanada.ca/easybuild/software/2020/Core/gcccore/11.3.0/include/c++/11.3.0/bits/std_function.h:435:145: error: parameter packs not expanded with ‘…’:
435 | function(_Functor&& __f)
| ^
/cvmfs/soft.computecanada.ca/easybuild/software/2020/Core/gcccore/11.3.0/include/c++/11.3.0/bits/std_function.h:435:145: note: ‘_ArgTypes’
/cvmfs/soft.computecanada.ca/easybuild/software/2020/Core/gcccore/11.3.0/include/c++/11.3.0/bits/std_function.h:530:146: error: parameter packs not expanded with ‘…’:
530 | operator=(_Functor&& __f)
| ^
/cvmfs/soft.computecanada.ca/easybuild/software/2020/Core/gcccore/11.3.0/include/c++/11.3.0/bits/std_function.h:530:146: note: ‘_ArgTypes’
make[2]: *** [lib/kokkos/core/src/CMakeFiles/kokkoscore.dir/build.make:132: lib/kokkos/core/src/CMakeFiles/kokkoscore.dir/impl/Kokkos_ExecPolicy.cpp.o] Error 1
/cvmfs/soft.computecanada.ca/easybuild/software/2020/Core/gcccore/11.3.0/include/c++/11.3.0/bits/std_function.h:435:145: error: parameter packs not expanded with ‘…’:
435 | function(_Functor&& __f)
| ^
/cvmfs/soft.computecanada.ca/easybuild/software/2020/Core/gcccore/11.3.0/include/c++/11.3.0/bits/std_function.h:435:145: note: ‘_ArgTypes’
/cvmfs/soft.computecanada.ca/easybuild/software/2020/Core/gcccore/11.3.0/include/c++/11.3.0/bits/std_function.h:530:146: error: parameter packs not expanded with ‘…’:
530 | operator=(_Functor&& __f)
| ^
/cvmfs/soft.computecanada.ca/easybuild/software/2020/Core/gcccore/11.3.0/include/c++/11.3.0/bits/std_function.h:530:146: note: ‘_ArgTypes’
make[2]: *** [lib/kokkos/core/src/CMakeFiles/kokkoscore.dir/build.make:104: lib/kokkos/core/src/CMakeFiles/kokkoscore.dir/impl/Kokkos_Core.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:2226: lib/kokkos/core/src/CMakeFiles/kokkoscore.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs…
– extracting… [analysis]
– extracting… [rename]
– extracting… [clean up]
– extracting… done
[ 7%] No update step for ‘Eigen3_build’
[ 8%] No patch step for ‘Eigen3_build’
[ 8%] No configure step for ‘Eigen3_build’
[ 8%] No build step for ‘Eigen3_build’
[ 8%] No install step for ‘Eigen3_build’
[ 8%] Completed ‘Eigen3_build’
[ 8%] Built target Eigen3_build
make: *** [Makefile:136: all] Error 2

You may need to use a GCC version 11.1 or earlier. See: error: parameter packs not expanded with ‘...’ · Issue #119 · NVlabs/instant-ngp · GitHub for a similar issue.

You will be greatly helping us (and yourself!) if you can extract the relevant error messages from the output of the building process. For example, we did not need a hundred lines telling us the download progress of Eigen3 :slight_smile: You can try piping your output through | grep 'error' and see what that gets you – it would have isolated the problem clearly in this instance.

1 Like

Thank you for the advice. Yes, I’ll extract relevant error message in the future communication. I think you pointed out a good direction to go. I checked Kokkos’s compilation requirements and verified that the problem is indeed caused by incompatible gcc version. I think that I am very close to the final solution.

Hi, I am still struggling with lammps-kokkos. The compilation goes through but a runtime error shows up.

terminate called after throwing an instance of ‘std::runtime_error’
what(): cudaGetDeviceCount(&m_cudaDevCount) error( cudaErrorStubLibrary): CUDA driver is a stub library /lammps_gpu/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Instance.cpp:254

I looked into Kokkos_Cuda_Instance.cpp:254 and found
KOKKOS_IMPL_CUDA_SAFE_CALL(cudaGetDeviceCount(&m_cudaDevCount));

I don’t understand it and need more help.

Below are commands used in my compilation

  • module load StdEnv/2020 nvhpc/22.7
  • module load gcc/9.3.0 cuda/11.4
  • module load cmake/3.23.1
  • rm -rf build && mkdir build && cd build
  • cmake …/cmake -DPKG_MACHDYN=yes -DDOWNLOAD_EIGEN3=yes -DPKG_MANYBODY=yes -DKokkos_ARCH_HOSTARCH=yes -DKokkos_ARCH_GPUARCH=yes -DKokkos_ENABLE_CUDA=yes -DKokkos_ENABLE_OPENMP=yes -DPKG_KOKKOS=yes -DKokkos_ARCH_VOLTA70=ON
  • make -j8

I would also like to mention that gpu lammps compilation was done successfully on the SAME supercomputer WITHOUT kokkos. The commands are as follows:

Anther minor issue is the flag -DDOWNLOAD_EIGEN3=yes. Sometimes, for unknown reasons, the supercomputer cannot access to https://download.lammps.org/thirdparty/eigen-3.4.0.tar.gz and issues fatal errors during compilation. I tried -D EIGEN3_INCLUDE_DIR=my_eigen3_path but did not succeed. Any suggestions?

Can you post the output of running the nvidia-smi command on your machine (on a compute node if the login nodes are different).

You need to contact your machine admins about this. When compiling, the cuda package may use “stub” libraries instead of the real cuda drivers, since those are often only installed on machine with a GPU. However, when running on the GPU those shared libraries must not be found by the LAMMPS executable, since you cannot access the GPUs with it.

It looks like your CUDA install may be corrupted, see this link:

Thu Oct 20 15:19:31 2022       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 515.65.01    Driver Version: 515.65.01    CUDA Version: 11.7     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  Tesla V100-SXM2...  Off  | 00000000:1C:00.0 Off |                    0 |
| N/A   31C    P0    39W / 300W |      0MiB / 16384MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|  No running processes found                                                 |
+-----------------------------------------------------------------------------+

@Eric_Zhu that looks fine. I would check your CUDA install, see the link I posted above.

Thank you for the follow-up. CUDA was installed by the administrator, I simply loaded the module. Moreover, previous compilation of lammps with this CUDA runs smoothly without kokkos. I don’t see why CUDA installation might be a problem with kokkos.

This is a runtime error, like LD_LIBRARY_PATH is set incorrectly to point at /usr/local/cuda/lib64/stubs or something like that. And this is an issue with your system, not LAMMPS or Kokkos, so you’ll need to contact your system admins as Axel mentioned.

The previous compilation setting you posted without KOKKOS was not making any use of CUDA, so that does reflect in any way on the status of your CUDA installation.