Problems installing Lammps with GPU package with cmake

Dear Lammps users

I am trying to install lammps with the GPU package using CMAKE, the parameters that i used are

sudo cmake -DBIN2C=yes -D CMAKE_INSTALL_PREFIX=/usr/local/lammps -D BUILD_MPI=yes -D BUILD_OMP=yes -D CMAKE_C_COMPILER=gcc -D CMAKE_CXX_COMPILER=g++ -D CMAKE_Fortran_COMPILER=gfortran -D BUILD_EXE=yes -D BUILD_LIB=no -D BUILD_SHARED_LIBS=no -D BUILD_DOC=yes -D LAMMPS_MEMALIGN=64 -D INTEL_ARCH=cpu -D FFT=FFTW3 -D FFT_SINGLE=no -D FFT_PACK=array -D LAMMPS_SIZES=smallbig -D WITH_JPEG=yes -D WITH_PNG=yes -D WITH_FFMPEG=yes -D PKG_GPU=yes -D GPU_API=cuda -D GPU_PREC=mixed -D GPU_ARCH=sm_61 -D CUDPP_OPT=yes ../cmake

but when i try to do sudo make i got this error message

[  0%] Building NVCC cubin file cuda_compile_cubin_generated_lal_pppm_d.cu.cubin
ptxas info    : 0 bytes gmem
ptxas info    : Compiling entry function 'interp' for 'sm_61'
ptxas info    : Function properties for interp
    0 bytes stack frame, 0 bytes spill stores, 0 bytes spill loads
ptxas info    : Used 42 registers, 8704 bytes smem, 448 bytes cmem[0], 2 textures
ptxas info    : Compiling entry function 'make_rho' for 'sm_61'
ptxas info    : Function properties for make_rho
    0 bytes stack frame, 0 bytes spill stores, 0 bytes spill loads
ptxas info    : Used 50 registers, 5248 bytes smem, 392 bytes cmem[0]
ptxas info    : Compiling entry function 'particle_map' for 'sm_61'
ptxas info    : Function properties for particle_map
    0 bytes stack frame, 0 bytes spill stores, 0 bytes spill loads
ptxas info    : Used 20 registers, 456 bytes cmem[0], 2 textures
[  0%] Building NVCC cubin file cuda_compile_cubin_generated_lal_lj_expand.cu.cubin
ptxas info    : 0 bytes gmem
ptxas info    : Compiling entry function 'k_lj_expand_fast' for 'sm_61'
ptxas info    : Function properties for k_lj_expand_fast
    0 bytes stack frame, 0 bytes spill stores, 0 bytes spill loads
ptxas info    : Used 44 registers, 3892 bytes smem, 408 bytes cmem[0], 1 textures
ptxas info    : Compiling entry function 'k_lj_expand' for 'sm_61'
ptxas info    : Function properties for k_lj_expand
    0 bytes stack frame, 0 bytes spill stores, 0 bytes spill loads
ptxas info    : Used 48 registers, 20 bytes smem, 416 bytes cmem[0], 1 textures
[  0%] Generating lj_expand_cubin.h
/bin/sh: 1: ./yes: not found
CMakeFiles/gpu.dir/build.make:61: recipe for target 'lib/gpu/lj_expand_cubin.h' failed
make[2]: *** [lib/gpu/lj_expand_cubin.h] Error 127
make[2]: *** Deleting file 'lib/gpu/lj_expand_cubin.h'
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/gpu.dir/all' failed
make[1]: *** [CMakeFiles/gpu.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2

P.D: the pc that i'm using is a intel core i7 7700k with an nvidia GTX 1080ti (the drivers are nvidia 410 and cuda 10.0)

there is crucial information missing:

  • OS, OS version and hardware architecture
  • LAMMPS version
  • C/C++ compiler version

axel.

p.s.: please note, that excessive and unwarranted use of sudo is a mortal (unix) sin. :wink:
please repent and in the future only use it when doing the install step (or become a saint and install under your home directory, e.g. into $HOME/.local and not need sudo at all and thus avoid putting your entire OS installation at risk whenever compiling software from source. one innocent typo can ruin your entire installation!).

FWIW, it works for me:
Fedora Linux 29 (with self-compiled gcc-4.9 for use with CUDA 9.1) on x86_64 (intel core i7-7700) with a GeForce GTX 1060 using the latest LAMMPS patch version from today (9 November 2018)

mkdir build-cuda
cd build-cuda
cmake -D PKG_GPU=yes -D GPU_API=cuda -D GPU_PREC=mixed -D GPU_ARCH=sm_61 …/cmake

make
./lmp -h

gives:

Large-scale Atomic/Molecular Massively Parallel Simulator - 9 Nov 2018

Usage example: ./lmp -var t 300 -echo screen -in in.alloy

List of command line options supported by this LAMMPS executable:

-echo none/screen/log/both : echoing of input script (-e)
-help : print this help message (-h)
-in filename : read input from file, not stdin (-i)
-kokkos on/off … : turn KOKKOS mode on or off (-k)
-log none/filename : where to send log output (-l)
-mpicolor color : which exe in a multi-exe mpirun cmd (-m)
-nocite : disable writing log.cite file (-nc)
-package style … : invoke package command (-pk)
-partition size1 size2 … : assign partition sizes (-p)
-plog basename : basename for partition logs (-pl)
-pscreen basename : basename for partition screens (-ps)
-restart2data rfile dfile … : convert restart to data file (-r2data)
-restart2dump rfile dgroup dstyle dfile …
: convert restart to dump file (-r2dump)
-reorder topology-specs : processor reordering (-r)
-screen none/filename : where to send screen output (-sc)
-suffix gpu/intel/opt/omp : style suffix to apply (-sf)
-var varname value : set index style variable (-v)

Active compile time flags:

-DLAMMPS_GZIP
-DLAMMPS_PNG
-DLAMMPS_JPEG
-DLAMMPS_FFMPEG

Installed packages:

GPU