Building LAMMPS with Kokkos GPU support

Hello, I used the following cmake command to build LAMMPS:

cmake -DPKG_KOKKOS=on \
  -DPKG_REAXFF=on \
  -DPKG_MANYBODY=on \
  -DPKG_ML-SNAP=on \
  -DBUILD_MPI=on \
  -DCMAKE_INSTALL_PREFIX=../install \
  -DMPI_CXX_COMPILER=$(which mpicxx) \
  -DCMAKE_BUILD_TYPE=Release \
  -DKokkos_ENABLE_SERIAL=on \
  -DCMAKE_CXX_STANDARD=14 \
  -DCMAKE_CXX_COMPILER=$(which mpicxx) \
  -DKokkos_ARCH_VOLTA70=ON \
  -DKokkos_GPU_VOLTA70=on \
  ../lammps/cmake

but when I try to run the lij.in example I get:
LAMMPS (15 Jun 2023 - Development - patch_15Jun2023-115-g3328389baf)
KOKKOS mode is enabled (src/KOKKOS/kokkos.cpp:107)
ERROR: GPUs are requested but Kokkos has not been compiled using a GPU-enabled backend (src/KOKKOS/kokkos.cpp:128)
Can you tell me what I am missing in my CMAKE?

I don’t see:

-DKokkos_ENABLE_CUDA=on

I don’t recall any -DKokkos_GPU_VOLTA70=on setting, but having an unused variable defined should do no harm.

1 Like

Yes! That did the trick. Running great. Thanks for your help, Axel.

1 Like