Dear LAMMPS GPU developers and users,
I have a linking problem with building the GPU LAMMPS project:
[[email protected]... src]$ make linux
make[1]: Entering directory `/home/ndtrung/codes/lammps-gpu/src/Obj_linux'
mpic++ -O -L../../lib/gpu -L/home/ndtrung/codes/fftw-2.1.5/build/lib -L/opt/cuda3.0/lib64 angle_charmm.o angle_cosine.o ...
../../lib/gpu/libgpu.a(pair_gpu_device.o): In function `lmp_gpu_forces(double**, double**, double*, double**, double*, double&)':
pair_gpu_device.cpp:(.text+0xa4): undefined reference to `cuStreamSynchronize'
../../lib/gpu/libgpu.a(pair_gpu_device.o): In function `ucl_cudadr::UCL_Timer::clear()':
pair_gpu_device.cpp:(.text._ZN10ucl_cudadr9UCL_Timer5clearEv[ucl_cudadr::UCL_Timer::clear()]+0x14): undefined reference to `cuEventDestroy'
pair_gpu_device.cpp:(.text._ZN10ucl_cudadr9UCL_Timer5clearEv[ucl_cudadr::UCL_Timer::clear()]+0x21): undefined reference to `cuEventDestroy'
pair_gpu_device.cpp:(.text._ZN10ucl_cudadr9UCL_Timer5clearEv[ucl_cudadr::UCL_Timer::clear()]+0x6b): undefined reference to `cuEventDestroy'
../../lib/gpu/libgpu.a(pair_gpu_device.o): In function `ucl_cudadr::UCL_H_Vec<float>::~UCL_H_Vec()':
pair_gpu_device.cpp:(.text._ZN10ucl_cudadr9UCL_H_VecIfED1Ev[ucl_cudadr::UCL_H_Vec<float>::~UCL_H_Vec()]+0x1d): undefined reference to `cuMemFreeHost'
...
I should mention that before building LAMMPS, I already built lib/gpu/libgpu.a by checking out the source (revision 577) from:
svn checkout http://gpulammps.googlecode.com/svn/trunk/ lammps-gpu
and modifying the Makefile.linux file to point to the CUDA toolkit. And running nvc_get_devices showed:
Using platform: NVIDIA Corporation NVIDIA CUDA
CUDA Driver Version: 3.20
CUDA Runtime Version: 3.0
Device 0: "GeForce GTX 480"
Type of device: GPU
Compute capability: 2
Double precision support: Yes
...
Device 1: "nForce 980a/780a SLI"
Type of device: GPU
Compute capability: 1.1
Double precision support: No
(One note is that in the geryon/nvc_device.h, line 293, CUDART_VERSION should be > 3000 because the ECCEnabled field of cudaDeviceProp is not available for CUDA 3.0 and older.)
Next, I modified the MAKE/Makefile.linux in the LAMMPS src to point to the CUDA lib path on my machine (the same as that I used for building libgpu)
gpu_SYSLIB = -lcudart
...
gpu_SYSPATH = -L/opt/cuda3.0/lib64
and run
make yes-gpu
make linux
Everything was smooth until the linking part gave the errors as shown above. The errors seem to indicate that the compiler could not find the CUDA library (libcudart), which I don't know why.
Did I miss something important and is there further information I should provide?
Please comment and help. Thanks,
-Trung