Error in Build the GPU library

Dear Lammps-Users,

I am now trying to use gpu(CUDA) to accelarate lammps, following
http://lammps.sandia.gov/doc/accelerate_gpu.html.
However, in step (a) Build the GPU library,
I can not build GPU library in lammps-**/lib/gpu/

I have tried three distribution packages, but neigher have worked.
I am worried some bug in Lammps or CUDA, or there might be some version problems.
I am so glad if someone can help me.

In the following, I attach
1. Error message
2. Makefile
3. System specification

------1. Error message---------------------------------------------
When I try to build as following,
$ make -f Makefile.linux.mine.mixed

I got the error message below:

nvcc -I/usr/local/cuda/include -DUNIX -O3 -Xptxas -v --use_fast_math -Icudpp_mini -arch=sm_35 -D_SINGLE_DOUBLE --cubin -DNV_KERNEL -o atom.cubin lal_atom.cu
/usr/local/cuda/include/surface_functions.h(134): error: expected a ";"
/usr/local/cuda/include/surface_functions.h(135): error: expected a ";"
--- same errors with different line numbers
/usr/local/cuda/include/surface_functions.h(164): error: expected a ";"

/usr/local/cuda/include/surface_functions.h(228): error: expected a ";"
/usr/local/cuda/include/surface_functions.h(229): error: expected a ";"
/usr/local/cuda/include/surface_functions.h(230): error: expected a ";"
/usr/local/cuda/include/surface_functions.h(231): error: expected a ";"

/usr/local/cuda/include/surface_functions.h(294): error: expected a ";"
/usr/local/cuda/include/surface_functions.h(295): error: expected a ";"
--- same errors with different line numbers
/usr/local/cuda/include/surface_functions.h(393): error: expected a ";"

/usr/local/cuda/include/surface_functions.h(456): error: expected a ";"
/usr/local/cuda/include/surface_functions.h(457): error: expected a ";"
--- same errors with different line numbers
/usr/local/cuda/include/surface_functions.h(485): error: expected a ";"

Error limit reached.
100 errors detected in the compilation of "/tmp/tmpxft_00000ac1_00000000-7_lal_atom.cpp1.ii".
Compilation terminated.
Nvidia.makefile:158: recipe for target 'atom.cubin' failed
make: *** [atom.cubin] Error 4

------2. Makefile---------------------------------------------
Since the GPU card is GeForce GTX Titan (GK110),
CUDA_ARCH is set to be sm_35 following
https://en.wikipedia.org/wiki/CUDA

EXTRAMAKE = Makefile.lammps.standard

CUDA_HOME = /usr/local/cuda
NVCC = nvcc

CUDA_ARCH = -arch=sm_35

# this setting should match LAMMPS Makefile
# one of LAMMPS_SMALLBIG (default), LAMMPS_BIGBIG and LAMMPS_SMALLSMALL

LMP_INC = -DLAMMPS_SMALLBIG

CUDA_PRECISION = -D_SINGLE_DOUBLE

CUDA_INCLUDE = -I$(CUDA_HOME)/include
CUDA_LIB = -L$(CUDA_HOME)/lib64
CUDA_OPTS = -DUNIX -O3 -Xptxas -v --use_fast_math

CUDR_CPP = mpic++ -DMPI_GERYON -DUCL_NO_EXIT -DMPICH_IGNORE_CXX_SEEK
CUDR_OPTS = -O2 # -xHost -no-prec-div -ansi-alias

BIN_DIR = ./
OBJ_DIR = ./
LIB_DIR = ./
AR = ar
BSH = /bin/sh

CUDPP_OPT = -DUSE_CUDPP -Icudpp_mini

include Nvidia.makefile

------3. System specification---------------------------------
System specification

workstation:
Ubuntu 16.04.1 LTS
gcc version 5.4.0

Lammps distribution:
14May16 (stable)
30Jul16 (stable)
20Oct16 (not stable)
(all fail with same error)

Cuda: CUDA Version 8.0.44
nvcc: Cuda compilation tools, release 7.5, V7.5.17

GPU: sudo lshw -C video
  *-display
       description: VGA compatible controller
       product: GK110 [GeForce GTX TITAN]
       vendor: NVIDIA Corporation
       physical id: 0
       bus info: [email protected]:01:00.0
       version: a1
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress vga_controller bus_master cap_list rom
       configuration: driver=nvidia latency=0
       resources: irq:32 memory:f6000000-f6ffffff memory:e8000000-efffffff memory:f0000000-f1ffffff ioport:e000(size=128) memory:f7000000-f707ffff

Sorry for a long post.
Thanks in advance.

Best regards,
Kota Ito

Hi Kota,

you seem to have two versions of the CUDA toolkit installed on your system 7.5 and 8.0. Can you try remove one of the versions (or remove both and then reinstall one of them), and rebuild the GPU library?

Best,
-Trung

Dear Dr. Nguyen,

Thank you for your help.

I have removed "nvidia-cuda-toolkit" by

sudo apt-get remove nvidia-cuda-toolkit

, then the whole process have worked as it is documented in the lammps web site.

Initially, I had installed cuda through the webpage,
then I had installed "nvidia-cuda-toolkit" through apt-get.
We don't need "nvidia-cuda-toolkit" for Lammps and the toolkit obtained through apt-get is the old one.

Thanks again.

Best regards,
Kota Ito

----- e$B85$N%a%C%;!<%8e(B -----
e$B:9=P?Me(B: "Trung Nguyen" <[email protected]>
[email protected](B: "Kota Ito" <[email protected]>
e$BAw?.:Q$_e(B: 2016e$BG/e(B11e$B7ne(B17e$BF|e(B, e$BLZMKF|e(B e$B8a8ee(B 11:59:30
e$B7oL>e(B: Re: [lammps-users] Error in Build the GPU library

Hi Kota,

you seem to have two versions of the CUDA toolkit installed on your system
7.5 and 8.0. Can you try remove one of the versions (or remove both and
then reinstall one of them), and rebuild the GPU library?

Best,
-Trung