I am also encountering the same problem with CUDA runtime displaying N/A in GROMACS 2021. The features are reported as follows:
GROMACS version: 2021
Verified release checksum is 3e06a5865d6ff726fc417dea8d55afd37ac3cbb94c02c54c76d7a881c49c5dd8
Precision: mixed
Memory model: 64 bit
MPI library: MPI
OpenMP support: enabled (GMX_OPENMP_MAX_THREADS = 64)
GPU support: CUDA
SIMD instructions: AVX2_256
FFT library: fftw-3.3.8-sse2-avx2-avx2_128
RDTSCP usage: enabled
TNG support: enabled
Hwloc support: disabled
Tracing support: disabled
C compiler: /software/apps/spack/a1/linux-centos7-x86_64/gcc-7.4.0/openmpi-3.1.4-tnwn4bppp3ju5hgzzsxatqmca5e2y37z/bin/mpicc GNU 7.4.0
C compiler flags: -mavx2 -mfma -Wno-missing-field-initializers -fexcess-precision=fast -funroll-all-loops -O3 -DNDEBUG
C++ compiler: /software/apps/spack/a1/linux-centos7-x86_64/gcc-7.4.0/openmpi-3.1.4-tnwn4bppp3ju5hgzzsxatqmca5e2y37z/bin/mpic++ GNU 7.4.0
C++ compiler flags: -mavx2 -mfma -Wno-missing-field-initializers -fexcess-precision=fast -funroll-all-loops -fopenmp -O3 -DNDEBUG
CUDA compiler: /software/apps/spack/a1/linux-centos7-x86_64/gcc-7.4.0/cuda-9.2.88-2xswg4vvkmx2ejx5himkniauy3tslp3k/bin/nvcc nvcc: NVIDIA (R) Cuda compiler driver;Copyright (c) 2005-2018 NVIDIA Corporation;Built on Wed_Apr_11_23:16:29_CDT_2018;Cuda compilation tools, release 9.2, V9.2.88
CUDA compiler flags:-std=c++14;-gencode;arch=compute_37,code=sm_37;-gencode;arch=compute_37,code=compute_37;-use_fast_math;;-mavx2 -mfma -Wno-missing-field-initializers -fexcess-precision=fast -funroll-all-loops -fopenmp -O3 -DNDEBUG
CUDA driver: 9.20
CUDA runtime: N/A
If I run ldd
on my gmx_api
binary, I find the following:
libcudart.so.9.2 => /software/apps/spack/a1/linux-centos7-x86_64/gcc-7.4.0/cuda-9.2.88-2xswg4vvkmx2ejx5himkniauy3tslp3k/lib64/libcudart.so.9.2 (0x00002ad40ffa2000)
libcufft.so.9.2 => /software/apps/spack/a1/linux-centos7-x86_64/gcc-7.4.0/cuda-9.2.88-2xswg4vvkmx2ejx5himkniauy3tslp3k/lib64/libcufft.so.9.2 (0x00002ad41020c000)
Moreover, if I check the symbols offered by libcudart.so.9.2
, using nm -gDC
, - both cudaDriverGetVersion
and cudaRuntimeGetVersion
are offered.
I compiled a short *.cu
script as suggested in a previous post about GROMACS 2020.4:
#include <cuda.h>
#include <stdio.h>
int main(int argc, char** argv) {
int cuda_driver = 0, cuda_runtime = 0;
if (cudaDriverGetVersion(&cuda_driver) != cudaSuccess)
{
printf("N/A");
}
printf("%d.%d\n", cuda_driver / 1000, cuda_driver % 100);
if (cudaRuntimeGetVersion(&cuda_runtime) != cudaSuccess)
{
printf("N/A");
}
printf("%d.%d\n", cuda_runtime / 1000, cuda_runtime % 100);
return 0;
}
The result of this script on the compilation node results in the following:
10.20
9.20
Any advice or suggestions to troubleshoot would be appreciated.
*Update:
I thought it would be worth mentioning a few additional observations for anyone else encountering similar issues:
-
I am unable to successfully compile an MPI version of GROMACS 2021 without using mpicc/mpic++
. Specifically, the code associated with gmxapi
in GROMACS 2021 does not compile without mpicc/mpic++
. I tried using multiple versions of gcc/g++
between 7.4 - 9.2 and got a compilation error every time. I tried different versions of CUDA (e.g. 9.2, 10.1) together with mpicc/mpic++
, which results in a compilation without any build errors (e.g., as above), but with an incorrect CUDA driver and runtime detection.
-
I am able to successfully build a non-MPI gmxapi
-enabled version of GROMACS 2021 (-DGMX_MPI=off
) with gcc/g++
instead of mpicc/mpic++
. This version of GROMACS 2021 correctly identifies the CUDA driver and runtime versions (as shown below; I also used an updated CUDA version here).
GROMACS version: 2021
Verified release checksum is 3e06a5865d6ff726fc417dea8d55afd37ac3cbb94c02c54c76d7a881c49c5dd8
Precision: mixed
Memory model: 64 bit
MPI library: thread_mpi
OpenMP support: enabled (GMX_OPENMP_MAX_THREADS = 64)
GPU support: CUDA
SIMD instructions: AVX2_256
FFT library: fftw-3.3.8-sse2-avx2-avx2_128
RDTSCP usage: enabled
TNG support: enabled
Hwloc support: disabled
Tracing support: disabled
C compiler: /software/apps/spack/a1/linux-centos7-x86_64/gcc-4.8.5/gcc-7.4.0-4kdemuwlzds2ofpkkz7yytgi7kyojuvz/bin/gcc GNU 7.4.0
C compiler flags: -mavx2 -mfma -Wno-missing-field-initializers -fexcess-precision=fast -funroll-all-loops -O3 -DNDEBUG
C++ compiler: /software/apps/spack/a1/linux-centos7-x86_64/gcc-4.8.5/gcc-7.4.0-4kdemuwlzds2ofpkkz7yytgi7kyojuvz/bin/g++ GNU 7.4.0
C++ compiler flags: -mavx2 -mfma -Wno-missing-field-initializers -fexcess-precision=fast -funroll-all-loops -fopenmp -O3 -DNDEBUG
CUDA compiler: /software/apps/spack/a02/linux-centos7-haswell/gcc-7.4.0/cuda-10.2.89-ggwihui3ko3ewjmhsqb5dtghageu3cjo/bin/nvcc nvcc: NVIDIA (R) Cuda compiler driver;Copyright (c) 2005-2019 NVIDIA Corporation;Built on Wed_Oct_23_19:24:38_PDT_2019;Cuda compilation tools, release 10.2, V10.2.89
CUDA compiler flags:-std=c++14;-gencode;arch=compute_37,code=sm_37;-gencode;arch=compute_37,code=compute_37;-use_fast_math;;-mavx2 -mfma -Wno-missing-field-initializers -fexcess-precision=fast -funroll-all-loops -fopenmp -O3 -DNDEBUG
CUDA driver: 10.20
CUDA runtime: 10.20
- I tried to compile GROMACS 2020.6 with the same configuration as the failed build above, using
mpicc/mpic++
. The resulting CUDA driver and runtime output is the same (9.20, N/A). However, with GROMACS 2020.6, I found that gmxapi
can be compiled without error using gcc/g++
. Doing so results in a successful MPI build of GROMACS 2020.6 for me with CUDA driver and runtime correctly detected (as shown below).
GROMACS version: 2020.6
Verified release checksum is 2f568d8884e039acbc6b68722432516e0628be00c847969b7c905c8b53ef826f
Precision: single
Memory model: 64 bit
MPI library: MPI
OpenMP support: enabled (GMX_OPENMP_MAX_THREADS = 64)
GPU support: CUDA
SIMD instructions: AVX2_256
FFT library: fftw-3.3.8-sse2-avx2-avx2_128
RDTSCP usage: enabled
TNG support: enabled
Hwloc support: hwloc-1.11.8
Tracing support: disabled
C compiler: /software/apps/compilers/gcc/6.4.0/bin/gcc GNU 6.4.0
C compiler flags: -mavx2 -mfma -fexcess-precision=fast -funroll-all-loops -O3 -DNDEBUG
C++ compiler: /software/apps/compilers/gcc/6.4.0/bin/g++ GNU 6.4.0
C++ compiler flags: -mavx2 -mfma -fexcess-precision=fast -funroll-all-loops -fopenmp -O3 -DNDEBUG
CUDA compiler: /software/apps/cuda/9.2/bin/nvcc nvcc: NVIDIA (R) Cuda compiler driver;Copyright (c) 2005-2018 NVIDIA Corporation;Built on Tue_Jun_12_23:07:04_CDT_2018;Cuda compilation tools, release 9.2, V9.2.148
CUDA compiler flags:-gencode;arch=compute_37,code=sm_37;-gencode;arch=compute_37,code=compute_37;-use_fast_math;;-mavx2 -mfma -fexcess-precision=fast -funroll-all-loops -fopenmp -O3 -DNDEBUG
CUDA driver: 10.20
CUDA runtime: 9.20