Closed eric-yu-zhu closed 2 years ago
This seems to be a kokkos version issue? @anjohan
Hi @eric-yu-zhu ,
I think this is a mismatch between the Kokkos library bundled with LAMMPS and the KokkosKernels that we download.
In lammps/cmake/CMakeLists.txt
, locate kokkoskernels
near the bottom and add the GIT_TAG
line below:
FetchContent_Declare(
kokkoskernels
GIT_REPOSITORY https://github.com/kokkos/kokkos-kernels.git
GIT_TAG 3.6.00
)
Btw, I wouldn't necessarily expect
-DKokkos_ENABLE_CUDA=yes -DKokkos_ENABLE_OPENMP=yes
to work together. While I did template PairFLAREKokkos
on the device, there is a decent chance that I have forgotten to use it in some places, and I have never tried running Kokkos with OpenMP in a CUDA build.
If you find problems running OpenMP, you can make a separate build directory without CUDA enabled. As of writing, the Kokkos pair style is also optimized for GPUs only, so it will probably be faster to just run the non-Kokkos version with MPI when not using the GPU.
Hi anjohan, thank you so much for your advice. The solution works nicely!
I believe you are right about the -DKokkos_ENABLE_OPENMP flag. It was copied from lammps website.
For those who have trouble with kokkos like me, here's the recipe that worked on my gpu workstation
edit lammps_gpu_v2/cmake/CMakeLists.txt and replace if(PKG_KOKKOS) ... endif() block if(PKG_KOKKOS) set(KokkosKernels_ADD_DEFAULT_ETI OFF CACHE BOOL "faster build") set(KokkosKernels_ENABLED_COMPONENTS BLAS CACHE STRING "faster build")
if(EXTERNAL_KOKKOS)
find_package(KokkosKernels REQUIRED)
else()
include(FetchContent)
FetchContent_Declare(
kokkoskernels
GIT_REPOSITORY https://github.com/kokkos/kokkos-kernels.git
GIT_TAG 3.6.00
)
FetchContent_MakeAvailable(kokkoskernels)
endif()
target_link_libraries(lammps PUBLIC Kokkos::kokkoskernels)
endif()
Great!
I'll have a look to see if there's a way to automatically determine the KokkosKernels version based on the LAMMPS+Kokkos versions selected by the user.
Dear flare team,
I am having problem compiling lammps-flare with gpu via kokkos. On the other hand, I can run flare and compile lammps with gpu via kokkos without flare. So the problem might be in the connetion between flare and lammps. Any help would be appreciated!
Version info
Command history
Error message