KOKKOS C++ memory allocation failed: (null)

Hi,

I compiled LAMMPS with KOKKOS package (nvhpc23.11, cuda12). But when I ran the lammps script with the command “mpirun -np 1 lmp -k on g 1 -sf kk -pk kokkos neigh half -in base.in”, it failed to run. The error information is shown below:

"
LAMMPS (29 Aug 2024 - Update 1)
KOKKOS mode with Kokkos version 4.3.1 is enabled (src/KOKKOS/kokkos.cpp:72)
will use up to 1 GPU(s) per node
C++ memory allocation failed: (null)

MPI_ABORT was invoked on rank 0 in communicator MPI_COMM_WORLD
with errorcode 1.

NOTE: invoking MPI_ABORT causes Open MPI to kill all MPI processes.
You may or may not see output from other processes, depending on
exactly when Open MPI kills them.
"

The lammps version: 29 Aug 2024 - Update 1
GPU: A100

Thanks for your help!
Yi

Without a simple way to reproduce what you are seeing, there is very little that we can do to help you. Chances are, that there is a problem with the size of a system that you want to simulate.

Here are a few things that you can try:

  • run LAMMPS with the inputs in the “bench” folder. Check the README file for instruction on how to grow the problems by using -var flags until it reaches the size of your system
  • check if you can run the same input without KOKKOS.
  • try using the latest feature release version 4 Feb 2025 of LAMMPS

Likely you are running out of memory. Does it run without KOKKOS enabled on a CPU? Like Axel said, we need a minimal working example that reproduces the issue to investigate further.

Hi Axel ,

Thanks so much for your help.

I recompiled the LAMMPS with the newest version (4 Feb 2025) and it worked well in the GPU.

Best,
Yi

Hi Stan,

Thanks so much for your help.

I recompiled the LAMMPS with the newest version (4 Feb 2025) and it worked well in the GPU.

Best,
Yi

1 Like