0

(CentOS Linux release 7.3;cuda 9.1;GPU:Tesla P100-PCIE)

I've installed Matlab2018a on a server, but when I tried to do this: vl_compilenn('enableGpu', true); I encountered this:

vl_compilenn:   CUDA: MEX config file: 
'/data1/zhangdinghuai/gitrepo/explanatoryGraph/matconvnet-1.0- 
beta24/matlab/src/config/mex_CUDA_glnxa64.xml'
Building with 'nvcc'.
nvcc fatal   : Unsupported gpu architecture 'compute_20'

and

Building with 'nvcc'.
Error using mex
nvcc fatal   : Unsupported gpu architecture 'compute_20'


Error in vl_compilenn>mex_compile (line 529)
mex(mopts{:}) ;

Error in vl_compilenn (line 487)
mex_compile(opts, srcs{i}, objfile, flags.mexcu) ;

I have searched similar questions but none of them works, can anyone give me a hand?

PS:more information about the server is listed below:

[zhangdinghuai@gpu01 2018a]$ lsb_release -a
LSB Version:    :core-4.1-amd64:core-4.1-noarch:cxx-4.1-amd64:cxx-4.1- 
noarch:desktop-4.1-amd64:desktop-4.1-noarch:languages-4.1-amd64:languages-                4.1-noarch:printing-4.1-amd64:printing-4.1-noarch
Distributor ID: CentOS
Description:    CentOS Linux release 7.3.1611 (Core) 
Release:    7.3.1611
Codename:   Core
[zhangdinghuai@gpu01 2018a]$ cat /etc/issue
\S
Kernel \r on an \m

[zhangdinghuai@gpu01 2018a]$ cat /proc/version
Linux version 3.10.0-514.26.1.el7.x86_64 (builder@kbuilder.dev.centos.org) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-11) (GCC) ) #1 SMP Thu Jun 29 16:05:25 UTC 2017
  • 2
    You either need to remove the offending compiler option in the build system (as in the answer below) or use CUDA 8. I would recommend the former option if possible – talonmies May 09 '18 at 07:43

2 Answers2

1

In a similar thread here "nvcc fatal : Unsupported gpu architecture 'compute_20' while cuda 9.1+caffe+openCV 3.4.0 is installed" or at Askububtu , it was recommended to edit the makefile.config and to comment out the -gencode arch=compute_20.

Can you also share the exact kernel version you are using, the exact PCI device with PCI ID and driver versions if there are any. This might give better insight into your environment as well could help to answer further questions.

U880D
  • 8,601
  • 6
  • 24
  • 40
  • I add some information in the question, I am not sure if these're what you need. Besides, actually I've seen that link before, but among all the `makefile.config` s I can find, there is only one file which has similar content as: `NVCCFLAGS_PASS = -D_FORCE_INLINES -gencode=arch=compute_30,code=\"sm_30,compute_30\"`. I tried several times to change or delete the code but none of them works... – Narsil Zhang May 09 '18 at 07:44
  • 1
    @NarsilZhang https://github.com/vlfeat/matconvnet/blob/master/matlab/src/config/mex_CUDA_glnxa64.xml <-- it is right there – talonmies May 09 '18 at 08:00
0

My solution was modifying the file matconvnet/matlab/src/config/mex_CUDA_glnxa64.xml.

Change the line

`NVCCFLAGS="-D_FORCE_INLINES -gencode=arch=compute_20,code=sm_20 -gencode=arch=compute_30,code=&#92;&quot;sm_30,compute_30&#92;&quot; $NVCC_FLAGS"`

into

`NVCCFLAGS="-D_FORCE_INLINES -gencode=arch=compute_20,code=sm_20 -gencode=arch=compute_30,code=&#92;&quot;sm_30,compute_30&#92;&quot; $NVCC_FLAGS"`