Compiling LAMMPS with KOKKOS/CUDA

Hi All,

I’m trying to compiling LAMMPS with KOKKOS/CUDA package. But I’m seeing an error message as follows.

ld: library not found for -lcuda

clang: error: linker command failed with exit code 1 (use -v to see invocation)

make[1]: *** […/lmp_kokkos_cuda] Error 1

make: *** [kokkos_cuda] Error 2

I’ve tried to locate the -lcuda library but did not find it anywhere. The CUDA version I’m using is 8.0.61. I was wondering if anyone has encountered this before?

Thanks,

Qizhang Jia
DuBay Research Group
University of Virginia

Hi All,

I'm trying to compiling LAMMPS with KOKKOS/CUDA package. But I'm seeing an
error message as follows.

ld: library not found for -lcuda

clang: error: linker command failed with exit code 1 (use -v to see
invocation)

make[1]: *** [../lmp_kokkos_cuda] Error 1

make: *** [kokkos_cuda] Error 2

I've tried to locate the -lcuda library but did not find it anywhere. The
CUDA version I'm using is 8.0.61. I was wondering if anyone has encountered
this before?

​libcuda.so is normally part of the cuda *driver*, not the toolkit.
however, if you have CUDA 8.x installed you should have a suitable "stub"
library in -L$(CUDA_HOME)/lib64/stubs

that should be sufficient for linking. you will probably have to adapt your
makefile accordingly.
btw: there is no Makefile.kokkos_cuda in the current LAMMPS distribution,
only Makefile.kokkos_cuda_mpich and Makefile.kokkos_cuda_openmpi,

so you may need to update your LAMMPS version, too. KOKKOS support is under
very active development and you should always update to the latest version
(at least to the latest stable version).

axel.

You may also need to link on a compute node if the head/build node doesn’t have the driver.

You may also need to link on a compute node if the head/build node doesn’t
have the driver.

​stan,

with cuda 8.0 and beyond this is no longer needed. please have a look into
the "stubs" folder under ${CUDA_HOME}/lib64​

have just used those stub libraries from the cuda toolkit successfully when
compiling LAMMPS executables for the new HPC cluster at temple.
the driver libraries should only be needed for cuda toolkit installations
that come without the "stubs" folder.

also, compute nodes often do not have a full installation, so if one needs
the cuda driver, i.e. libcuda.so, i copy it from a compute node into my
compilation folder and then compile on the head node of the cluster.

axel.

Axel,

Thanks for your reply. Actually I used the template “Makefile.kokkos_cuda_openmpi” and renamed it “Makefile.kokkos_cuda” after editing.

I reinstalled CUDA driver 8.0.90, my LAMMPS version is current, 11-Aug-17, and I’m still seeing the same error message.

Also, I thought maybe its the OS problem, and tried to install on my local Mac, which has an Nvidia GT750M capable to install CUDA. But it still complains about not finding the -lcuda library after I installed both the toolkit and the driver. I didn’t find anything related to this issue in the mail list. I was wondering if you have any suggestions.

Thanks,

Qizhang Jia
DuBay Research Group
University of Virginia

Axel,

Thanks for your reply. Actually I used the template
"Makefile.kokkos_cuda_openmpi" and renamed it "Makefile.kokkos_cuda" after
editing.

I reinstalled CUDA driver 8.0.90, my LAMMPS version is current, 11-Aug-17,
and I'm still seeing the same error message.

Also, I thought maybe its the OS problem, and tried to install on my local
Mac, which has an Nvidia GT750M capable to install CUDA. But it still
complains about not finding the -lcuda library after I installed both the
toolkit and the driver. I didn't find anything related to this issue in the
mail list. I was wondering if you have any suggestions.

​i already gave you *two* suggestions and it looks like you didn't follow
any of them.

axel.​