nvcc fatal : Unsupported gpu architecture 'compute_20
Solution 1:
As for me, I had to comment out the -gencode arch=compute_20
in Makefile.config
:
CUDA_ARCH := -gencode arch=compute_30,code=sm_30 \
-gencode arch=compute_35,code=sm_35 \
-gencode arch=compute_50,code=sm_50
I stopped at 50
because CUDA's deviceQuery
showed me Capability Major/Minor version number
:
/usr/local/cuda/samples/bin/x86_64/linux/release/deviceQuery Starting...
CUDA Device Query (Runtime API) version (CUDART static linking)
Detected 1 CUDA Capable device(s)
Device 0: "GeForce GTX 960M"
CUDA Driver Version / Runtime Version 9.0 / 9.0
CUDA Capability Major/Minor version number: 5.0
Total amount of global memory: 4044 MBytes (4240965632 bytes)
( 5) Multiprocessors, (128) CUDA Cores/MP: 640 CUDA Cores
GPU Max Clock rate: 1176 MHz (1.18 GHz)
....
Then compilation and tests went well.
Solution 2:
I had the same issue this morning. After installing CUDA and cuDNN, restart was required (as suggested here https://groups.google.com/forum/#!topic/caffe-users/WDOD3E04Avg), so that CMake properly detected set variables. So just make sure CUDA and cuDNN are properly installed and restart your system. If you still get the error, you might have a GPU that only supports compute capability 2.0, so I guess you could try CUDA 8.0 which supports it. You can check your GPU here: https://developer.nvidia.com/cuda-gpus
I can confirm that the tests were run successfully on my PC with CUDA 9.0 and cuDNN 7.0.2 enabled. After restart, the GPU architecture was automatically set to sm_50. I have a GTX 750 Ti, which according to documentation supports CUDA 5.0. So the configuration seems correct now! Here is the command for testing:
make runtest
If you get any errors while compiling the tests, you may try:
make runtest clean
This example also worked for me and it's more than 7x faster (60 seconds) than with OpenBLAS with 8 CPU cores (450 seconds)!
./examples/mnist/train_lenet.sh
Solution 3:
I also had this issue on my Jetson TX2, when installing NVcaffe (running make -j4
).
The instructions in the nvidia jetson forum, here, say to replace:
-gencode arch=compute_61,code=sm_61
with
-gencode arch=compute_62,code=sm_62
in makefile.config
. However, that line was not in my config file since, following the instructions, I pulled caffe-0.15, which doesn't contain that line. So in the end, what worked for me was replacing the following in my config file:
CUDA_ARCH := -gencode arch=compute_20,code=sm_20 \
-gencode arch=compute_20,code=sm_21 \
-gencode arch=compute_30,code=sm_30 \
-gencode arch=compute_35,code=sm_35 \
-gencode arch=compute_50,code=sm_50 \
-gencode arch=compute_50,code=compute_50
with
CUDA_ARCH := -gencode arch=compute_50,code=sm_50 \
-gencode arch=compute_52,code=sm_52 \
-gencode arch=compute_60,code=sm_60 \
-gencode arch=compute_62,code=sm_62 \
-gencode arch=compute_61,code=compute_61