GPU acceleration issue

I have recently build the LAMMPS with GPU acceleration package.

While running input file through command “lmp_gpu -sf gpu -pk gpu 1 -in in_D1_PKA”, I am getting following error.

LAMMPS (30 Jul 2021)
ERROR: GPU library not compiled for this accelerator (…/gpu_extra.h:61)
Last command: package gpu 0
Cuda driver error 4 in call at file ‘geryon/nvd_device.h’ in line 137.

Can anyone help me.

This message was quite clear:
ERROR: GPU library not compiled for this accelerator

So, other than following the doc:
you should also mention the GPU model and what software library you used to drive it (CUDA, HIP, or OpenCL).

Please note also that during runtime the driver for your GPU needs to be compatible with that software library. I don’t believe, for example, that e.g. installing CUDA into Anaconda does anything for the kernel driver.


Dear Giacomo Fiorin,

Thanks for prompt reply. I will ask our HPC Team to follow your suggestion.

With regards,

There is too little information to provide specific advice.
When reporting issues you should always report:

  • version of LAMMPS
  • how compiled with what settings (cmake or GNU make)
  • for the GPU package also the settings used for the GPU library. The error message hints that it was configured incorrectly.
  • Compiler and version, CUDA toolkit version, CUDA driver version, GPU hardware, output of nvc_get_devices

some general advice:

  • if you are using an older version of LAMMPS, always check with the latest version (either 29 September 2021 stable version with updates or 14 December 2021 patch release).
  • if you compiled with traditional make build system, try using CMake. For the GPU package this will create a much more transferable binary, since it will compile the kernels with support for multiple GPU architectures (also available for GNU make, but requires the Makefile.linux_multi make file and adjusting the settings).