Hello lammps users
I’m running into a linker error compiling the KOKKOS/CUDA version of LAMMPS using cmake:
nvlink fatal : Could not open input file ‘/usr/lib/x86_64-linux-gnu/libdl.a’
It seems like the error I’m running into may be a problem specific to the way my nvidia compiler and drivers were installed on my computer, but I’d love to hear that confirmed. I don’t want to burden everyone trying to determine how to fix it. But once that’s confirmed, I can direct my efforts to fixing that problem (instead of continuing to play around with my cmake settings).
Incidentally, I have no trouble to compile LAMMPS using the GPU package (using “cmake -D GPU_API=cuda -D GPU_PREC=single -D GPU_ARCH=sm_80 -D PKG_GPU=yes …/cmake”).
I only run into problems compiling with KOKKOS.
Here is the procedure I’m using to compile KOKKOS enabled LAMMPS:
mkdir build-kokkos-cuda
cd build-kokkos-cuda/
cmake \
-C ../cmake/presets/basic.cmake \
-C ../cmake/presets/kokkos-cuda.cmake \
../cmake
cmake --build .
…and here is an excerpt of the log from the build process:
[ 0%] Building CXX object lib/kokkos/core/src/CMakeFiles/kokkoscore.dir/impl/Kokkos_CPUDiscovery.cpp.o
...
[100%] Built target lammps
[100%] Linking CXX executable lmp
nvcc warning : The 'compute_35', 'compute_37', 'compute_50', 'sm_35', 'sm_37' and 'sm_50' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
nvlink warning : Skipping incompatible '/usr/lib/x86_64-linux-gnu/libdl.a' when searching for -ldl
nvlink fatal : Could not open input file '/usr/lib/x86_64-linux-gnu/libdl.a'
gmake[2]: *** [CMakeFiles/lmp.dir/build.make:118: lmp] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:1026: CMakeFiles/lmp.dir/all] Error 2
gmake: *** [Makefile:149: all] Error 2
More background information:
I am using Nvidia RTX 3060 (laptop) hardware.
I am using the default nvidia binaries and libraries which were bundled with ubuntu 21.10. People using this environment are likely to run into this problem. Here is the “nvcc” binary I am using:
$ which nvcc
/usr/bin/nvcc
$ nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2021 NVIDIA Corporation
Built on Mon_May__3_19:15:13_PDT_2021
Cuda compilation tools, release 11.3, V11.3.109
Build cuda_11.3.r11.3/compiler.29920130_0
Thanks in advance!
Andrew