【matconvnet】故障排除:Error using mex nvcc fatal : Unsupported gpu architecture 'compute_52'
来源:互联网 发布:网络教育统考不通过率 编辑:程序博客网 时间:2024/06/03 12:33
在matlab中编译matconvnet的时候出现了“Error using mex nvcc fatal : Unsupported gpu architecture 'compute_52'”这个错误,怎么办呢?
环境:ubuntu 14.04,matlab2014a, 师兄们装好了cuda之类的东西,之前用着都没问题。
然后我新下载了一个matconvnet,1.7版的,要编译一个GPU版本。
然后就是vl_compilenn里面的enableGPU改成true之类的。
一运行,果断报错。
Error using mex nvcc fatal : Unsupported gpu architecture 'compute_52'
就是说nvcc不支持compute_52
上网查了一下,
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Long Name Short Name Description
--gpu-architecture arch -arch
Specify the name of the class of NVIDIA virtual GPU architecture for which the CUDA input files must be compiled.
With the exception as described for the shorthand below, the architecture specified with this option must be a virtual architecture (such as compute_20). Normally, this option alone does not trigger assembly of the generated PTX for a real architecture (that is the role of nvcc option --gpu-code, see below); rather, its purpose is to control preprocessing and compilation of the input to PTX.
For convenience, in case of simple nvcc compilations, the following shorthand is supported. If no value for option --gpu-code is specified, then the value of this option defaults to the value of --gpu-architecture. In this situation, as only exception to the description above, the value specified for --gpu-architecture may be a real architecture (such as a sm_20), in which case nvcc uses the specified real architecture and its closest virtual architecture as effective architecture values. For example, nvcc --gpu-architecture=sm_20 is equivalent to nvcc --gpu-architecture=compute_20 --gpu-code=sm_20,compute_20.
See Virtual Architecture Feature List for the list of supported virtual architectures and GPU Feature List for the list of supported real architectures.
Read more at: http://docs.nvidia.com/cuda/cuda-compiler-driver-nvcc/index.html#ixzz3xCfVDAF9
Follow us: @GPUComputing on Twitter | NVIDIA on Facebook
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
matlab也提示了那个xml文件有问题,我改了一下,把里面的--gpu-architecture=compute_20 --gpu-code=sm_20,compute_20中的20改成了52.
然并卵
看网上的那段提示似乎是要在terminal里面输入nvcc --gpu-architecture=compute_20 --gpu-code=sm_20,compute_20之类的:
结果呢?
nvcc --gpu-architecture=compute_52 --gpu-code=sm_52,compute_52
nvcc fatal : Value 'compute_52' is not defined for option 'gpu-architecture'
nvcc --gpu-architecture=sm_50
nvcc fatal : No input files specified; use option --help for more information
哎哎哎,等等,这里貌似说的是没有输入文件啊!意思就是这个“50”的值是允许的!!!
突然想起来貌似师兄也提过这个“计算能力”要取整数之类的。
但是vl_compilenn是在matlab里运行的啊,没有显示地调用nvcc,怎么改变这个参数啊?
读代码。。。
发现这个“arch”是在这里确定的:
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
function cudaArch = get_cuda_arch(opts)
% --------------------------------------------------------------------
opts.verbose && fprintf('%s:\tCUDA: determining GPU compute capability (use the ''CudaArch'' option to override)\n', mfilename);
try
gpu_device = gpuDevice();
arch_code = strrep(gpu_device.ComputeCapability, '.', '');
cudaArch = ...
sprintf('-gencode=arch=compute_%s,code=\\\"sm_%s,compute_%s\\\" ', ...
arch_code, arch_code, arch_code) ;
catch
opts.verbose && fprintf(['%s:\tCUDA: cannot determine the capabilities of the installed GPU;' ...
'falling back to default\n'], mfilename);
cudaArch = opts.defCudaArch;
end
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
我们已经知道了我们的计算能力是52,跟我们最近的,nvcc又支持的,是50.
于是乎,简单粗暴地强行让cudaArch为50即可。
运行了一下这段代码看cudaArch的格式。
最终得到解决方案:
在这句代码下面:
cudaArch = ...
sprintf('-gencode=arch=compute_%s,code=\\\"sm_%s,compute_%s\\\" ', ...
arch_code, arch_code, arch_code) ;
直接加一句:
cudaArch ='-gencode=arch=compute_50,code=\"sm_50,compute_50\" ';
强行让cudaArch等于我们想要的值即可。
- 【matconvnet】故障排除:Error using mex nvcc fatal : Unsupported gpu architecture 'compute_52'
- 【matconvnet】故障排除:Error using mex nvcc fatal : Unsupported gpu architecture 'compute_52'
- nvcc fatal : Unsupported gpu architecture 'compute_11'
- Caffe-GPU编译问题:nvcc fatal : Unsupported gpu architecture 'compute_20'
- ubuntu14.04编译opencv-2.4.9出现“nvcc fatal : Unsupported gpu architecture 'compute_11'”错误
- Unsupported gpu architecture 'compute_11'解决方法
- Unsupported gpu architecture 'compute_11'解决方法
- Unsupported gpu architecture 'compute_11'解决方法
- Unsupported gpu architecture 'compute_11'解决方法
- Unsupported gpu architecture 'compute_*'2017解决方法
- MATLAB安装matconvnet toolbox时的故障排除技巧
- Fatal error: Unsupported operand types108
- fatal error C1189: #error : "No Target Architecture"
- fatal error C1189: #error : "No Target Architecture"
- OpenCV安装教程及错误:Unsupported gpu architecture 'compute_11' 解决方法
- fatal error LNK1168 错误如何排除
- 【MatConvNet】配置GPU
- 编译GPU版本Matconvnet
- Android:RelativeLayout 属性
- 不兼容结构的协调——适配器模式(二):算法库适配器模式解决方案
- Tomcat 启动报错:host-manager does not exist or is not a readable directory
- 干掉头疼的finished with non-zero exit value 2
- Docker网络详解及pipework源码解读与实践
- 【matconvnet】故障排除:Error using mex nvcc fatal : Unsupported gpu architecture 'compute_52'
- UIView常见属性方法
- Junit测试含有‘启动新线程’这一操作的方法时瞬间结束的问题
- MySQL MERGE存储引擎 简介
- 《JAVA与模式》之模板方法模式
- 可行性分析
- Android进阶——双击,三击和多击的实现
- 多表查询
- MySQL存储引擎总结