nvcc fatal : Unsupported gpu architecture 'compute_20'
    11 views (last 30 days)
  
       Show older comments
    
Please help me. I want compile MatConvNet with GPU. Windows10 + nvidia quadro p400 + matlab2017b + cuda10 + visual studio 2017. But there is an error, it tells me this:
nvcc fatal : Unsupported gpu architecture 'compute_20'
How can I fix this error?
vl_compilenn:  CUDA: MEX config file: 'C:\Program Files\MATLAB\R2017b\toolbox\distcomp\gpu\extern\src\mex\win64\mex_CUDA_win64.xml'
  nvcc fatal   : Unsupported gpu architecture 'compute_20' 
  Error using vl_compilenn>nvcc_compile (line 540)
  Command "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0\bin\nvcc" -c
  "D:\MATLAB\GAN\dcgan-matconvnet-master\matconvnet-1.0-beta24\matlab\src\bits\data.cu" -DNDEBUG
  -DENABLE_GPU -DENABLE_DOUBLE -D__SSSE3__ -gencode=arch=compute_20,code=\"sm_20,compute_20\"
  -gencode=arch=compute_30,code=\"sm_30,compute_30\" -I"C:\Program
  Files\MATLAB\R2017b\extern\include" -I"C:\Program
  Files\MATLAB\R2017b\toolbox\distcomp\gpu\extern\include"
  -gencode=arch=compute_20,code=\"sm_20,compute_20\"
  -gencode=arch=compute_30,code=\"sm_30,compute_30\" -O3 -Xcompiler /MD --compiler-bindir
  "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\bin" -o
  "D:\MATLAB\GAN\dcgan-matconvnet-master\matconvnet-1.0-beta24\matlab\mex\.build\bits\data.obj"
  failed.
12 Comments
  Priyanka Bharadwaj
 on 29 Oct 2019
				I tried that and now the error still persists 
opts.defCudaArch      = [...
  '-gencode=arch=compute_61,code=\"sm_61,compute_61\" ' '-gencode=arch=compute_62,code=\"sm_62,compute_62\" ' '-gencode=arch=compute_30,code=\"sm_30,compute_30\"'];
Error using mex
nvcc fatal   : Unsupported gpu architecture 'compute_20'
Answers (1)
  Joss Knight
    
 on 6 Oct 2018
        Strictly speaking, for R2017b you need to be using an older version of the CUDA toolkit. MATLAB is expecting you to be using a version which still supports Fermi architecture.
The easiest fix when calling MEX or MEXCUDA is probably to set the NVCCFLAGS variable directly for your Pascal card:
mexcuda NVCCFLAGS="-gencode=arch=compute_60,code=sm_60" ...
but I'm not quite sure how MEX is invoked by the MatConvNet compiler.
1 Comment
  Priyanka Bharadwaj
 on 29 Oct 2019
				Hi  I did modify 
opts.defCudaArch      = [...
  '-gencode=arch=compute_61,code=\"sm_61,compute_61\" ' '-gencode=arch=compute_62,code=\"sm_62,compute_62\" ' '-gencode=arch=compute_30,code=\"sm_30,compute_30\"'];
aloong with modifying the 
mexcuda NVCCFLAGS="-gencode=arch=compute_60,code=sm_60" ...
But I still get the following error. Could you please suggest me how to rectify this. I am using matlab2019b along with Cuda 8.0 on ubuntu 16.04
nvcc fatal   : Unsupported gpu architecture 'compute_20'
See Also
Categories
				Find more on Get Started with GPU Coder in Help Center and File Exchange
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


