How to build LAMMPS for AMD MI210

Hello! I have built the liggpu.a for the MI210. Now I would like to build LAMMPS with GPU support and CPU. What is are good, MI210 supported, packages to build? I understand the Kokkos package for MI210 is still in the early stages.
Thanks in advance and greetings, Gabriele

Please see: 7.4. Accelerator packages — LAMMPS documentation

You have only two choices: the GPU or the KOKKOS package and for the former you can try compiling for OpenCL or HIP. KOKKOS should be working ok, if you have a sufficiently recent HIP/ROCm installation and also use the latest LAMMPS release 15 June 2023.

Building the libgpu.a is for use with the GPU package only.

Thanks, Axel. I thought that libgpu was necessary, even for Kokkos. Is this not true? On a different system, when I built for Kokkos, it was looking for the libgpu.a. hip/rocm versions are:
rocmod5.4.1. I am working with the Jun2023 LAMMPS version. I did manage to build for GPU (no Kokkos), but I could not set -fopenmp for the libgpu build, because, I just could not get the -fopenmp flag into the build for lammps, and then of course I could not link with the libgpu when -fopenmp was set. For the LAMMPS build, I am using a slightly modified version of the Makefile.hip, that comes with the lammps distribution. I tried adding the -fopenmp at various places, but it never made it to link line. My executable (gpu, no OpenMP) is currently not running.LAMMPS (15 Jun 2023)
WARNING: Using I/O redirection is unreliable with parallel runs. Better to use the -in switch to read input files. (…/lammps.cpp:531)
ERROR: Unable to initialize accelerator for use (…/gpu_extra.h:65), I am looking into how to resolve this…
Thanks for your help, Axel.

No.

I don’t understand this. You have the CCFLAGS variable for compilation and LINKFLAGS for linking.

That said, I rarely use the conventional build these days. By using CMake it is far easier to have a consistent build and no special compilation in the lib folder is needed, since those files and libraries are all compiled in one swoop.

This is usually due to a permission error, driver problem, or a mismatch of compilation settings.

Please note that the information you provide is vague, unspecific, and in parts inconsistent, so it is difficult to provide meaningful and specific advice.

Thanks for the suggestions, Axel. Yep, I agree there must be some inconsistencies in my compilation settings, I am trying to figure out where. KOKKOS_ABSOLUTE_PATH = (shell cd (KOKKOS_PATH); pwd)
#CC = mpicxx -cxx=$(KOKKOS_ABSOLUTE_PATH)/config/nvcc_wrapper
CC = mpicxx
CCFLAGS = -g -O3 -fopenmp
SHFLAGS = -fPIC
DEPFLAGS = -M

but during the build I only see:
mpicxx -g -O3 -DLAMMPS_GZIP -DLAMMPS_MEMALIGN=64 -DLMP_GPU -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1 -c …/nstencil_full_bin_3d.cpp

I am trying to find out why that is.
Regarding the error message I get when trying to run: Could you give me an example of mismatch of compilation settings?

One more question regarding Kokkos: I know that I don’t need libgpu for general Kokkos. However, I thought in order to use Kokkos for the GPU, I would need the library. So, what you are saying: Kokkos supports GPU without having the libgpu?
Thanks and greetings, Gabriele

Correct. Just use make yes-kokkos and compile.

Thanks, Stan! Could you tell me how I should set the KOKKOS_ARCH for MI210? On the website I only see the setting Mi200, which is VEGA90A for AMD GPU MI200 GFX90A. I have GFX906. Can I use the same architecture?

Pretty sure you need KOKKOS_ARCH=GFX90A for MI210, see Complete the supported GPU list · Issue #2044 · RadeonOpenCompute/ROCm · GitHub and AMD Radeon Instinct MI210 Specs | TechPowerUp GPU Database.