1

I have a problem while installing GROMACS-5.1.2. The error says that gpu architecture 'compute_20' is not supported. I have CUDA 9.0, g++4.9.3, and GTX1080 gpu. What should I do now? what's the problem?

[  0%] Built target fftwBuild    
[  1%] Building NVCC (Device) object src/gromacs/CMakeFiles/libgromacs.dir/gmxlib/cuda_tools/./libgromacs_generated_copyrite_gpu.cu.o    
nvcc fatal   : Unsupported gpu architecture 'compute_20'    
CMake Error at libgromacs_generated_copyrite_gpu.cu.o.cmake:208 (message):
Error generating      
/opt/gromacs/build-gromacs/src/gromacs/CMakeFiles/libgromacs.dir/gmxlib/cuda_tools/./libgromacs_generated_copyrite_gpu.cu.o

src/gromacs/CMakeFiles/libgromacs.dir/build.make:55: recipe for target 'src/gromacs/CMakeFiles/libgromacs.dir/gmxlib/cuda_tools/./libgromacs_generated_copyrite_gpu.cu.o' failed    
make[2]: *** [src/gromacs/CMakeFiles/libgromacs.dir/gmxlib/cuda_tools/./libgromacs_generated_copyrite_gpu.cu.o] Error 1
CMakeFiles/Makefile2:1938: recipe for target 'src/gromacs/CMakeFiles/libgromacs.dir/all' failed    
make[1]: *** [src/gromacs/CMakeFiles/libgromacs.dir/all] Error 2    
Makefile:143: recipe for target 'all' failed
make: *** [all] Error 2
1
  • 4
    compute_20 is not supported with CUDA 9. Modify your makefile or CMakeLists.txt to remove references to cc2.x GPUs. Commented Nov 6, 2017 at 3:17

3 Answers 3

1

The 'compute_20', 'sm_20', and 'sm_21' architectures are deprecated in CUDA 8 & 9

Resolution

  1. Change to a compatible CUDA version
  2. Modify your CMake file to remove these deprecated architectures
1
  • 2
    Actually, support for sm_2x was deprecated in CUDA 8 (see deprecation messages printed by the tool chain), and support was then removed in CUDA 9.
    – njuffa
    Commented Feb 22, 2018 at 18:41
1

Modification of the file gromacs-5.1.2/cmake/gmxManageNvccConfig.cmake can solve your problem (lines 184 to 227):

# First add flags that trigger SASS (binary) code generation for physical arch
if(CUDA_VERSION VERSION_LESS "9.00") # < 9.0
    list (APPEND GMX_CUDA_NVCC_GENCODE_FLAGS "-gencode;arch=compute_20,code=sm_20")
endif()
if(NOT CUDA_VERSION VERSION_LESS "4.2") # >= 4.2
    list (APPEND GMX_CUDA_NVCC_GENCODE_FLAGS "-gencode;arch=compute_30,code=sm_30")
endif()
if(NOT CUDA_VERSION VERSION_LESS "5.0") # >= 5.0
    list (APPEND GMX_CUDA_NVCC_GENCODE_FLAGS "-gencode;arch=compute_35,code=sm_35")
endif()
if(NOT CUDA_VERSION VERSION_LESS "6.5") # >= 6.5
    list (APPEND GMX_CUDA_NVCC_GENCODE_FLAGS "-gencode;arch=compute_37,code=sm_37")
    list (APPEND GMX_CUDA_NVCC_GENCODE_FLAGS "-gencode;arch=compute_50,code=sm_50")
endif()
if(NOT CUDA_VERSION VERSION_LESS "7.0") # >= 7.0
    list (APPEND GMX_CUDA_NVCC_GENCODE_FLAGS "-gencode;arch=compute_52,code=sm_52")
endif()
if(NOT CUDA_VERSION VERSION_LESS "8.0") # >= 8.0
    list (APPEND GMX_CUDA_NVCC_GENCODE_FLAGS "-gencode;arch=compute_60,code=sm_60")
    list (APPEND GMX_CUDA_NVCC_GENCODE_FLAGS "-gencode;arch=compute_61,code=sm_61")
endif()
if(NOT CUDA_VERSION VERSION_LESS "9.0") # >= 9.0
    list (APPEND GMX_CUDA_NVCC_GENCODE_FLAGS "-gencode;arch=compute_70,code=sm_70")
endif()

# Next add flags that trigger PTX code generation for the newest supported virtual arch
# that's useful to JIT to future architectures
if(CUDA_VERSION VERSION_LESS "4.2")
    list (APPEND GMX_CUDA_NVCC_GENCODE_FLAGS "-gencode;arch=compute_20,code=compute_20")
elseif(CUDA_VERSION VERSION_LESS "5.0")
    list (APPEND GMX_CUDA_NVCC_GENCODE_FLAGS "-gencode;arch=compute_30,code=compute_30")
elseif(CUDA_VERSION VERSION_LESS "6.5")
    list (APPEND GMX_CUDA_NVCC_GENCODE_FLAGS "-gencode;arch=compute_35,code=compute_35")
elseif(CUDA_VERSION VERSION_LESS "7.0")
    list (APPEND GMX_CUDA_NVCC_GENCODE_FLAGS "-gencode;arch=compute_50,code=compute_50")
elseif(CUDA_VERSION VERSION_LESS "8.0")
    list (APPEND GMX_CUDA_NVCC_GENCODE_FLAGS "-gencode;arch=compute_52,code=compute_52")
elseif(CUDA_VERSION VERSION_LESS "9.0")
    list (APPEND GMX_CUDA_NVCC_GENCODE_FLAGS "-gencode;arch=compute_60,code=compute_60")
    list (APPEND GMX_CUDA_NVCC_GENCODE_FLAGS "-gencode;arch=compute_61,code=compute_61")
else() # version >= 9.0
    list (APPEND GMX_CUDA_NVCC_GENCODE_FLAGS "-gencode;arch=compute_70,code=compute_70")
endif()

endif()

1

I fixed a similar issue for gromacs 5.1.5 using:

# compile the deviceQuery utility:
cd /usr/local/cuda/samples/1_Utilities/deviceQuery
sudo make

# use it:
/usr/local/cuda/samples/bin/x86_64/linux/release/deviceQuery
# gives output like CUDA Capability Major/Minor version number:    6.0

# modify build:
rm CMakeCache.txt
cmake <args> DGMX_CUDA_TARGET_COMPUTE=compute_60

hat-tip to Matthieu for pointing to deviceQuery and gromacs devs for writing decent installation docs.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.