使用VS编译OpenCV编译源代码时候,对Cmake生成的工程文件编译,会出现 nvcc fatal : Unsupported gpu architecture 'compute_11'  问题。原因是CUDA7.5不支持较为古老的显卡版本,因此1.1,2.0,2.1,之类的显卡选项是多余的。

需要更改Cmake GUI对工程的配置,去掉对compute_11的支持

1. 打开cmakelist.txt

CMake的选项中声明 -D CUDA_GENERATION=Kepler

即添加:

if(WIN32 AND NOT MINGW)
add_definitions(-D_VARIADIC_MAX=10)
endif(WIN32 AND NOT MINGW) #此处为添加代码
if(1)
add_definitions( -D_CUDA_GENERATION=Maxwell)

不能消除这种现象,问题没有得到解决。

参考:安装caffe的血泪史

cmake 命令命令安装、用法

cmake常用变量速查手册

linux版本编译OpenCV可能出现的Compute_11问题

对于Maxwell的支持,参考:Vs13+Win7+OpenCV2.4.13+CUDA7.5支持

2.

改正方法:

把CUDA栏目里面,CUDA_ARCH_BIN 项目里面,3.0前面的都去掉,改成如下所示。

之前,

1. 先把CUDA_generation 修改为Auto

2. 打开 sources\cmake 目录,使用文本编辑器编辑OpenCVDetectCUDA.cmake

找到下面一段

  if(NOT DEFINED __cuda_arch_bin)
if(ANDROID)
set(__cuda_arch_bin "3.2")
set(__cuda_arch_ptx "")
else()
if(${CUDA_VERSION} VERSION_LESS "5.0")
set(__cuda_arch_bin "1.1 1.2 1.3 2.0 2.1(2.0) 3.0")
else()
set(__cuda_arch_bin "1.1 1.2 1.3 2.0 2.1 3.0 3.5")
endif()
set(__cuda_arch_ptx "3.0")
endif()
endif()

把第二个1.1  1.2  1.3  2.0 2.1  去掉,修改为

  if(NOT DEFINED __cuda_arch_bin)
if(ANDROID)
set(__cuda_arch_bin "3.2")
set(__cuda_arch_ptx "")
else()
if(${CUDA_VERSION} VERSION_LESS "5.0")
set(__cuda_arch_bin "1.1 1.2 1.3 2.0 2.1(2.0) 3.0")
else()
set(__cuda_arch_bin "3.0 3.5")
endif()
set(__cuda_arch_ptx "3.0")
endif()
endif()

或者直接修改为使用于本机GTX960 显卡的 5.2,

才能把CUDA_ARCH_BIN 的1.1 1.2 1.3 2.0 2.1 去掉,进而解决 nvcc fatal : Unsupported gpu architecture 'compute_11'  问题。

若不能通过编辑选项去掉,应该有其他可行的方法???

则可以编译通过。

nvcc fatal : Unsupported gpu architecture 'compute_11'的更多相关文章

  1. install opencv 2.4.10 with issue :"nvcc fatal : Unsupported gpu architecture 'compute_11'"

    issue: nvcc fatal   : Unsupported gpu architecture 'compute_11'CMake Error at cuda_compile_generated ...

  2. caffe编译问题-nvcc fatal:Unsupported gpu architecture 'compute_20'

    错误描述 nvcc fatal : Unsupported gpu architecture 'compute_20' Makefile:: recipe for target '.build_rel ...

  3. cuda9.0编译caffe报错nvcc fatal : Unsupported gpu architecture 'compute_70'

    Tesla V100 cuda9.0 caffe编译的时候报上述错误,修改方法: CUDA_ARCH := #-gencode arch=compute_20,code=sm_20 \ #-genco ...

  4. Unsupported gpu architecture 'compute_20'

    NVCC src/caffe/layers/reduction_layer.cunvcc fatal   : Unsupported gpu architecture 'compute_20'Make ...

  5. Error when Building GPU docker image for caffe: Unsupported gpu architecture 'compute_60'

    issue: Error when Building GPU docker image for caffe: Unsupported gpu architecture 'compute_60' rea ...

  6. nvcc fatal : Cannot find compiler 'cl.exe' in PATH解决方法

    我在测试安装的deep learning工具theano.按照官网Baby Steps - Algebra一步步输入. >>> import theano.tensor as T & ...

  7. [ZZ] GTX 280 GPU architecture

    http://anandtech.com/show/2549 Now that NVIDIA’s has announced its newest GPU architecture (the GeFo ...

  8. 转 关于nvcc fatal : Value 'sm_20' is not defined for option 'gpu-architecture'的问题

    原文地址: https://blog.csdn.net/Mao_Jonah/article/details/78965827 关于nvcc fatal : Value ‘sm_20’ is not d ...

  9. 5 Things You Should Know About the New Maxwell GPU Architecture

    The introduction this week of NVIDIA’s first-generation “Maxwell” GPUs is a very exciting moment for ...

随机推荐

  1. 198. House Robber(动态规划)

    You are a professional robber planning to rob houses along a street. Each house has a certain amount ...

  2. ganglia3.7.2,web3.7.1安装

    1.准备安装包 ganglia-3.7.2-2.el6.x86_64.rpm ganglia-gmetad-3.7.2-2.el6.x86_64.rpm ganglia-gmond-3.7.2-2.e ...

  3. Java_集合总结

    集合分类 Collection 接口是集合的父类 1.Set 集合 使用内部的排列机制(无序),存入集合的顺序和取出集合的顺序不一致,没有索引,存入集合的元素没有重复 HashSet集合 Linked ...

  4. 【ACM】hdu_1004_Let the Balloon Rise_201308141026-2

    Let the Balloon RiseTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Othe ...

  5. 数学 找规律 Jzzhu and Sequences

    A - Jzzhu and Sequences   Jzzhu has invented a kind of sequences, they meet the following property: ...

  6. [bzoj3192][JLOI2013]删除物品_树状数组_栈

    删除物品 bzoj-3192 JLOI-2013 题目大意:给你n个物品,分成2堆.所有的物品有不同的优先级.我只可以将一堆中的堆顶移动到另一个堆的堆顶.而如果当前物品是全局所有物品中优先级最高的,我 ...

  7. Java对二叉搜索树进行插入、查找、遍历、最大值和最小值的操作

    1.首先,须要一个节点对象的类.这些对象包括数据.数据代表存储的内容,并且还有指向节点的两个子节点的引用 class Node { public int iData; public double dD ...

  8. PHP array_key_exists()

    定义和用法 array_key_exists() 函数判断某个数组中是否存在指定的 key,如果该 key 存在,则返回 true,否则返回 false. 语法 array_key_exists(ke ...

  9. Extjs学习笔记——Ext.data.JsonStore使用说明

    Ext.data.JsonStore继承于Ext.data.Store.使得从远程JSON数据创建stores更为方便的简单辅助类. JsonStore合成了Ext.data.HttpProxy与Ex ...

  10. HDU 5294 Tricks Device(多校2015 最大流+最短路啊)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5294 Problem Description Innocent Wu follows Dumb Zha ...