Compiling LAMMPS with CUDA -- CUDA_ARCH

Dear all,

I’m trying to compile LAMMPS with the user-CUDA package, following the steps on this page: . I: 1) have the Cuda toolkit and drivers for my Quadro K2000 up and running (tested), 2) compiled the user-cuda package (lib/cuda) with default options, 3) copied the files liblammpscuda.a and Makefile.lammps to the LAMMPS src directory, 4) and invoked “make clean-all”, “make yes-user-cuda” and “make openmpi”. Everything goes well and with no errors up to the last command, where I get the following error: “…/cuda.cpp:87:43: error: ‘CUDA_ARCH’ was not declared in this scope”. I’ve tried changing the default architecture from 20 to 21, but that didn’t make any difference. My LAMMPS version is April2013. Can anyone tell me how to fix this error? Regards, Martijn van den Ende PhD Candidate Utrecht University

Dear all,

I'm trying to compile LAMMPS with the user-CUDA package, following the steps
on this page: http://lammps.sandia.gov/doc/Section_accelerate.html#acc_7. I:

1) have the Cuda toolkit and drivers for my Quadro K2000 up and running
(tested),
2) compiled the user-cuda package (lib/cuda) with default options,
3) copied the files liblammpscuda.a and Makefile.lammps to the LAMMPS src
directory,
4) and invoked "make clean-all", "make yes-user-cuda" and "make openmpi".

Everything goes well and with no errors up to the last command, where I get
the following error: "../cuda.cpp:87:43: error: ‘CUDA_ARCH’ was not declared
in this scope". I've tried changing the default architecture from 20 to 21,
but that didn't make any difference. My LAMMPS version is April2013. Can
anyone tell me how to fix this error?

please update to the latest version of LAMMPS and try again. perhaps
this issue has been fixed in the last 18 months.

please also note that USER-CUDA is currently in some kind of "limbo"
state. the original author is working on a new project aiming to
replace USER-CUDA and USER-OMP (and USER-INTEL) and the LAMMPS
maintainers are not CUDA experts, and as a "user" package it only gets
a limited amount of attention when fixing problems.

I’ve tried building the 28jun2014 version of LAMMPS with CUDA, but I’m rolling from one error into the other. The last bug I’ve encountered was: “…/fft3d_wrap_cuda.cpp:62:48: error: too few arguments to function ‘fft_plan_3d* fft_3d_create_plan(MPI_Comm, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int*, int)’;”. I guess I’ll have to wait for Christian to release his new project…

Martijn

I've tried building the 28jun2014 version of LAMMPS with CUDA, but I'm
rolling from one error into the other. The last bug I've encountered was:
"../fft3d_wrap_cuda.cpp:62:48: error: too few arguments to function
‘fft_plan_3d* fft_3d_create_plan(MPI_Comm, int, int, int, int, int, int,
int, int, int, int, int, int, int, int, int, int, int, int*, int)’;".

please try this one-line fix. this is due to an optional optimization
of the 3d-FFT for BG/Q machines, that slightly changed the fftw3d API.

diff --git a/src/USER-CUDA/fft3d_wrap_cuda.cpp b/src/USER-CUDA/fft3d_wrap_cuda.c
index 0599240..80fc7b8 100644
--- a/src/USER-CUDA/fft3d_wrap_cuda.cpp
+++ b/src/USER-CUDA/fft3d_wrap_cuda.cpp
@@ -59,7 +59,7 @@ FFT3dCuda::FFT3dCuda(LAMMPS *lmp, MPI_Comm comm, int nfast, in
   plan = fft_3d_create_plan(comm,nfast,nmid,nslow,
                             in_ilo,in_ihi,in_jlo,in_jhi,in_klo,in_khi,
                             out_ilo,out_ihi,out_jlo,out_jhi,out_klo,out_khi,
- scaled,permute,nbuf);
+ scaled,permute,nbuf,0);
#endif
   if (plan == NULL) error->one(FLERR,"Could not create 3d FFT plan");
}

I
guess I'll have to wait for Christian to release his new project...

have a look at the KOKKOS package. but don't hold your breath. it is a
big undertaking and it will take a while to mature. in the meantime
you can try the GPU package.

axel.