GROMACS failed to support Nvidia Quadro K4200 GPU

GROMACS version: 2020.4
GROMACS modification: No
Hello dear All,
After Installing GPU enabled version of GROMACS 2020.4 on my HP machine Ubuntu 20.04.1 with Intel® Xeon® CPU E5-2650 v2 @ 2.60GHz × 16 and the following graphic card:
NVIDIA Corporation GK104GL [Quadro K4200]
I got the following error after >> mdrun -s topol.tpr -nb gpu:

> WARNING: The mdrun binary does not include support for the CUDA architecture of the GPU ID #0 (compute capability 3.0) detected during detection. By default, GROMACS supports all architectures of compute capability >= 3.0, so your GPU might be rare, or some architectures were disabled in the build.
Consult the install guide for how to use the GMX_CUDA_TARGET_SM and GMX_CUDA_TARGET_COMPUTE CMake variables to add this architecture. 
WARNING: An error occurred while sanity checking device #0; cudaErrorInvalidDeviceFunction: invalid device function

I was wondering what should be the values for GMX_CUDA_TARGET_SM and GMX_CUDA_TARGET_COMPUTE

I have looked up this question on the web and in the forum but could not find any not-complicated tutorials that I can apply, so I’d appreciate any guidance:

>>nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2020 NVIDIA Corporation
Built on Mon_Nov_30_19:08:53_PST_2020
Cuda compilation tools, release 11.2, V11.2.67
Build cuda_11.2.r11.2/compiler.29373293_0

The content of log file is :

GROMACS version: 2020.4
Verified release checksum is 79c2857291b034542c26e90512b92fd4b184a1c9d6fa59c55f2e24ccf14e7281
Precision: single
Memory model: 64 bit
MPI library: thread_mpi
OpenMP support: enabled (GMX_OPENMP_MAX_THREADS = 64)
GPU support: CUDA
SIMD instructions: AVX_256
FFT library: fftw-3.3.8-sse2-avx-avx2-avx2_128
RDTSCP usage: enabled
TNG support: enabled
Hwloc support: disabled
Tracing support: disabled
C compiler: /usr/bin/cc GNU 9.3.0
C compiler flags: -mavx -fexcess-precision=fast -funroll-all-loops -O3 -DNDEBUG
C++ compiler: /usr/bin/c++ GNU 9.3.0
C++ compiler flags: -mavx -fexcess-precision=fast -funroll-all-loops -fopenmp -O3 -DNDEBUG
CUDA compiler: /usr/local/cuda-11.2/bin/nvcc nvcc: NVIDIA ® Cuda compiler driver;Copyright © 2005-2020 NVIDIA Corporation;Built on Mon_Nov_30_19:08:53_PST_2020;Cuda compilation tools, release 11.2, V11.2.67;Build cuda_11.2.r11.2/compiler.29373293_0
CUDA compiler flags:-gencode;arch=compute_35,code=sm_35;-gencode;arch=compute_37,code=sm_37;-gencode;arch=compute_50,code=sm_50;-gencode;arch=compute_52,code=sm_52;-gencode;arch=compute_60,code=sm_60;-gencode;arch=compute_61,code=sm_61;-gencode;arch=compute_70,code=sm_70;-Wno-deprecated-gpu-targets;-gencode;arch=compute_35,code=compute_35;-gencode;arch=compute_50,code=compute_50;-gencode;arch=compute_52,code=compute_52;-gencode;arch=compute_60,code=compute_60;-gencode;arch=compute_61,code=compute_61;-gencode;arch=compute_70,code=compute_70;-gencode;arch=compute_75,code=compute_75;-gencode;arch=compute_80,code=compute_80;-use_fast_math;-D_FORCE_INLINES;-mavx -fexcess-precision=fast -funroll-all-loops -fopenmp -O3 -DNDEBUG
CUDA driver: 11.20
CUDA runtime: 11.20

Running on 1 node with total 8 cores, 16 logical cores, 0 compatible GPUs
Hardware detected:
CPU info:
Vendor: Intel
Brand: Intel® Xeon® CPU E5-2650 v2 @ 2.60GHz
Family: 6 Model: 62 Stepping: 4
Features: aes apic avx clfsh cmov cx8 cx16 f16c htt intel lahf mmx msr nonstop_tsc pcid pclmuldq pdcm pdpe1gb popcnt pse rdrnd rdtscp sse2 sse3 sse4.1 sse4.2 ssse3 tdt x2apic
Hardware topology: Basic
Sockets, cores, and logical processors:
Socket 0: [ 0 8] [ 1 9] [ 2 10] [ 3 11] [ 4 12] [ 5 13] [ 6 14] [ 7 15]
GPU info:
Number of GPUs detected: 1
#0: N/A, stat: insane

The Quadro K4200 is a compute capability 3.0 GPU, an architecture for which support was discontinued by NVIDIA in CUDa 11. You will need to install an older CUDA version, as far as I recall 10.1 is the last release that supports your GPU.

Cheers,
Szilárd

Thanks Szilárd
I tried to install using cuda 10.1 but it fails to install:
the following error is shown after CMake command:

/usr/local/cuda/bin/…/targets/x86_64-linux/include/crt/host_config.h:138:2: error: #error – unsupported GNU version! gcc versions later than 8 are not supported!
138 | #error – unsupported GNU version! gcc versions later than 8 are not supported!

CMake Error at cmake/gmxManageNvccConfig.cmake:182 (message):
NVCC/C++ compiler combination does not seem to be supported. CUDA
frequently does not support the latest versions of the host compiler, so
you might want to try an earlier C++ compiler version and make sure your
CUDA compiler and driver are as recent as possible.
Call Stack (most recent call first):
cmake/gmxManageGPU.cmake:208 (include)
CMakeLists.txt:578 (gmx_gpu_setup)

I tried gcc-7 for nvcc by:
sudo ln -s /usr/bin/gcc-4.4 /usr/local/cuda/bin/gcc
and then
cmake .. -DGMX_BUILD_OWN_FFTW=ON -DREGRESSIONTEST_DOWNLOAD=ON -DGMX_GPU=on -DGMX_BUILD_MDRUN_ONLY=on -DCMAKE_CXX_COMPILER=gcc-7
but again no luck! --the same error!