Building LAMMPS with Kokkos GPU support

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

cmake -DPKG_KOKKOS=on \
  -DPKG_ML-SNAP=on \
  -DBUILD_MPI=on \
  -DMPI_CXX_COMPILER=$(which mpicxx) \
  -DKokkos_ENABLE_SERIAL=on \
  -DCMAKE_CXX_COMPILER=$(which mpicxx) \
  -DKokkos_ARCH_VOLTA70=ON \
  -DKokkos_GPU_VOLTA70=on \

but when I try to run the 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:


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