Reputation: 11
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
Upvotes: 1
Views: 7483
Reputation: 2391
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.
Upvotes: 1
Reputation: 11
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()
Upvotes: 1
Reputation: 2264
The 'compute_20', 'sm_20', and 'sm_21' architectures are deprecated in CUDA 8 & 9
Resolution
Upvotes: 1