Building LAMMPS with Kokkos Package for AMD GPUs with Various Precisions

I’m building LAMMPS for ORNLs Frontier supercomputer. My ROCm version is rocm/6.4.2 I have uploaded my bash script to build LAMMPS.

configure_build_lammps.sh (1.6 KB)

My LAMMPS version has commit “611ca3b7f8525ba802373b04f9e3d632d515f7e3 (HEAD → stable, tag: stable_22Jul2025_update4”.

Critically, I’m using the Kokkos package to target the AMD GPUs. I have the CMake option “-D Kokkos_PREC=double”. Does setting this option actually do anything for the Kokkos package targeting the AMD GPUs?

I did the grep command “grep -I -nri “KOKKOS_PREC” on the LAMMPS src and got no matches. However I did the grep command “grep -I -nri “GPU_PREC .” and got several matches.

If the CMake option “-D Kokkos_PREC=<some_value>” does nothing, then the LAMMPS documentation in “3.8.5 Kokkos package” and subsection “Advanced Kokkos compilation settings” is confusing. There one can find a discussion on setting this CMake option.

I’m probably misunderstanding something basic and any help in clarifying this CMake option would be helpful.

@arnold It won’t do anything for any hardware unless you move to a more recent LAMMPS release. The support for mixed and single precision was introduced in version 10 September 2025 (but we recommend to use the latest feature release, 30 March 2026, when not using a stable release/update).

You have to use the correct URL. The regular version of the documentation at https://docs.lammps.org/ targets the latest feature release. The documentation for the latest stable release or update is at LAMMPS Documentation (22 Jul 2025 version) — LAMMPS documentation
Please note the version information on the title page and the bottom of the navigation sidebar on the left.

I will checkout the release 30 March 2026 repeat my tests.

I think I know what’s happening here.

I went to the documentation link with the latest stable release:

In the search area labelled “search docs” I typed in “Kokkos optional”, I click on the link for Kokkos and I am stealthily taken to docs for version 30Mar2026. However, if I follow the links within the stable release web page and not use any links returned by the search bar, I get the correct version of the web pages that don’t have any mention to the Kokkos precision CMake option.

You need to click here:

Thanks all for the promptly answering my questions. I was able to download and compile the release version. My concern is the following. Suppose I wanted the stable version, but I do a search for a LAMMPS documentation feature using the “search the docs” box for that stable version. Some of the hits/matches I’m getting redirect me to a release version. Many features don’t change from a stable to a release version. However, the one feature I wanted to get info on, building LAMMPS with the Kokkos package in various precisions, had not been implemented in the stable version but was implemented in a later release version. The release version required one to use the “-DKokkos_PREC= CMake flag. As Axel has previously stated, this flag does nothing for the stable version I was building.

I believe that whatever version of the LAMMPS documentation you are using, doing a search with the “search the docs” box should only return/redirect to LAMMPS doc matches for that same version.

That won’t work for the online version since that uses the Google search box and Google doesn’t include the /latest and /stable versions of the documentation in their index. You can check for that by using searching on google directly with site:docs.lammps.org/stable appended. This is confirmed by looking at the information Google provides at their “Search console” website.

So to get the search restricted to the LAMMPS version you are using, you would have to use the local html files that are part of the standard LAMMPS tarball (either from LAMMPS Source Download Repository: . or from the Github LAMMPS release page Releases · lammps/lammps · GitHub) and then use the pre-translated HTML documentation in the doc/html folder. That uses the JavaScript based search (which is not as effective as the Google search box and does not include content from the LAMMPS homepage).

1 Like