Re: [AMBER] amber22 installation error

From: Scott Brozell via AMBER <amber.ambermd.org>
Date: Wed, 27 Dec 2023 20:40:38 -0500

Hi,

On Wed, Dec 27, 2023 at 02:48:52PM +0530, Dulal Mondal via AMBER wrote:
> I am trying to install amber22 in cuda. I do the following steps.
>
> module load module load compiler/gcc/8.3.0 compiler/cmake/3.15.4
> compiler/cuda/11.2
>
> I edit the run cmake file.
>
> Assume this is Linux:
>
> cmake $AMBER_PREFIX/amber22_src \
> -DCMAKE_INSTALL_PREFIX=$AMBER_PREFIX/amber22 \
> -DCOMPILER=GNU -DUSE_CONDA_LIBS=TRUE -DFORCE_INTERNAL_LIBS=arpack \
> -DMPI=FALSE -DCUDA=TRUE -DINSTALL_TESTS=TRUE \
> -DDOWNLOAD_MINICONDA=FALSE \
> 2>&1 | tee cmake.log
> make install.
>
> But after 82 %, the installation is stopped.
>
> r/pbsa.cuda_generated_cusp_LinearSolvers.cu.o
> [ 83%] Building NVCC (Device) object
> AmberTools/src/pbsa/CMakeFiles/pbsa.cuda.dir/pbsa.cuda_generated_cusparse_LinearSolvers.cu.o
> /home/21cy91r03/amber22_src/AmberTools/src/pbsa/cusparse_LinearSolvers.cu(82):
> error: identifier "CUSPARSE_SPMV_ALG_DEFAULT" is undefined

Thanks for the report. This appears to be a bug in
AmberTools/src/pbsa/cusparse_LinearSolvers.cu

A simple workaround would be to use a different cuda version as
only exactly 11.2 is affected. Below describes a workaround for
version 11.2.

According to web searching CUSPARSE_SPMV_ALG_DEFAULT is valid for cuda
11.3 or later. While it appears that CUSPARSE_VERSION should be used to
determine the appropriate name, an easy workaround may be this change
in 5(!) places:

#if __CUDACC_VER_MAJOR__ == 11 && __CUDACC_VER_MINOR__ < 2
->
#if __CUDACC_VER_MAJOR__ == 11 && __CUDACC_VER_MINOR__ <= 2

Here is the full git diff:
===
diff --git a/AmberTools/src/pbsa/cusparse_LinearSolvers.cu b/AmberTools/src/pbsa/cusparse_LinearSolvers.cu
index f551833..a47372c 100644
--- a/AmberTools/src/pbsa/cusparse_LinearSolvers.cu
+++ b/AmberTools/src/pbsa/cusparse_LinearSolvers.cu
.. -76,7 +76,7 .. extern "C" void cusparse_cg_wrapper_(float *x, float *b, int *I, int *J, float *
     cusparseSpMV_bufferSize(cusparseHandle, CUSPARSE_OPERATION_NON_TRANSPOSE,
                             &constONE, descr_A, descr_p, &constZERO, descr_q,
                             CUDA_R_32F,
-#if __CUDACC_VER_MAJOR__ == 11 && __CUDACC_VER_MINOR__ < 2
+#if __CUDACC_VER_MAJOR__ == 11 && __CUDACC_VER_MINOR__ <= 2
                             CUSPARSE_MV_ALG_DEFAULT,
 #else
                             CUSPARSE_SPMV_ALG_DEFAULT,
.. -112,7 +112,7 .. extern "C" void cusparse_cg_wrapper_(float *x, float *b, int *I, int *J, float *
         cusparseSpMV(cusparseHandle, CUSPARSE_OPERATION_NON_TRANSPOSE,
                      &constONE, descr_A, descr_p, &constZERO, descr_q,
                      CUDA_R_32F,
-#if __CUDACC_VER_MAJOR__ == 11 && __CUDACC_VER_MINOR__ < 2
+#if __CUDACC_VER_MAJOR__ == 11 && __CUDACC_VER_MINOR__ <= 2
                      CUSPARSE_MV_ALG_DEFAULT,
 #else
                      CUSPARSE_SPMV_ALG_DEFAULT,
.. -230,7 +230,7 .. extern "C" void cusparse_bicg_wrapper_(float *x, float *b, int *I, int *J, float
     cusparseSpMV_bufferSize(cusparseHandle, CUSPARSE_OPERATION_NON_TRANSPOSE,
                             &one, descr_A, descr_p, &zero, descr_q,
                             CUDA_R_32F,
-#if __CUDACC_VER_MAJOR__ == 11 && __CUDACC_VER_MINOR__ < 2
+#if __CUDACC_VER_MAJOR__ == 11 && __CUDACC_VER_MINOR__ <= 2
                             CUSPARSE_MV_ALG_DEFAULT,
 #else
                             CUSPARSE_SPMV_ALG_DEFAULT,
.. -265,7 +265,7 .. extern "C" void cusparse_bicg_wrapper_(float *x, float *b, int *I, int *J, float
         cusparseSpMV(cusparseHandle, CUSPARSE_OPERATION_NON_TRANSPOSE,
                      &one, descr_A, descr_p, &zero, descr_q,
                      CUDA_R_32F,
-#if __CUDACC_VER_MAJOR__ == 11 && __CUDACC_VER_MINOR__ < 2
+#if __CUDACC_VER_MAJOR__ == 11 && __CUDACC_VER_MINOR__ <= 2
                      CUSPARSE_MV_ALG_DEFAULT,
 #else
                      CUSPARSE_SPMV_ALG_DEFAULT,
.. -284,7 +284,7 .. extern "C" void cusparse_bicg_wrapper_(float *x, float *b, int *I, int *J, float
         cusparseSpMV(cusparseHandle, CUSPARSE_OPERATION_NON_TRANSPOSE,
                      &one, descr_A, descr_r, &zero, descr_t,
                      CUDA_R_32F,
-#if __CUDACC_VER_MAJOR__ == 11 && __CUDACC_VER_MINOR__ < 2
+#if __CUDACC_VER_MAJOR__ == 11 && __CUDACC_VER_MINOR__ <= 2
                      CUSPARSE_MV_ALG_DEFAULT,
 #else
                      CUSPARSE_SPMV_ALG_DEFAULT,
===

scott


_______________________________________________
AMBER mailing list
AMBER.ambermd.org
http://lists.ambermd.org/mailman/listinfo/amber
Received on Wed Dec 27 2023 - 18:00:02 PST
Custom Search