CUDA编译.cu文件报错unsupported GNU version! gcc versions later than 10 are not supported! The nvcc flag '-allow-unsupported-compiler' can be used to override this version check;
最近使用cuda11.3编译.cu文件,报错:
#error -- unsupported GNU version! gcc versions later than 10 are not supported! The nvcc flag '-allow-unsupported-compiler' can be used to override this version check; however, using an unsupported host compiler may cause compilation failure or incorrect run time execution. Use at your own risk.
详细信息:
(base) devil@hp:/tmp$ nvcc ./y.cu -o stream_legacy
In file included from /usr/local/cuda-11.3/bin/../targets/x86_64-linux/include/cuda_runtime.h:83,
from <command-line>:
/usr/local/cuda-11.3/bin/../targets/x86_64-linux/include/crt/host_config.h:139:2: error: #error -- unsupported GNU version! gcc versions later than 10 are not supported! The nvcc flag '-allow-unsupported-compiler' can be used to override this version check; however, using an unsupported host compiler may cause compilation failure or incorrect run time execution. Use at your own risk.
139 | #error -- unsupported GNU version! gcc versions later than 10 are not supported! The nvcc flag '-allow-unsupported-compiler' can be used to override this version check; however, using an unsupported host compiler may cause compilation failure or incorrect run time execution. Use at your own risk.
| ^~~~~
在网上查找相关问题,判断为gcc版本过高,与cuda的nvcc不兼容,查看本机的gcc版本:
gcc -v

安装版本10的gcc和g++:
sudo apt-get install gcc-10
sudo apt-get install g++-10
为nvcc编译器指定特定版本的gcc:
由于linux中可以有多个版本的gcc和g++,我们可以为系统默认的gcc和g++指定特定的默认版本,但是对于cuda的nvcc来说有更方便的方法,那就是nvcc会优先读取自身路径下的gcc然后如果没有再读取系统默认路径下的gcc,因此我们只需要为nvcc设置特定版本gcc的软连接即可:
sudo ln -s /usr/bin/gcc-10 /usr/local/cuda/bin/gcc

============================================================
参考:
https://blog.csdn.net/qq_28660035/article/details/78703095
https://zhuanlan.zhihu.com/p/518431589
https://blog.csdn.net/qq_45779334/article/details/123169473
CUDA编译.cu文件报错unsupported GNU version! gcc versions later than 10 are not supported! The nvcc flag '-allow-unsupported-compiler' can be used to override this version check;的更多相关文章
- linux下编译make文件报错“/bin/bash^M: 坏的解释器,使用grep快速定位代码位置
一.linux下编译make文件报错“/bin/bash^M: 坏的解释器 参考文章:http://blog.csdn.net/liuqiyao_01/article/details/41542101 ...
- 解决 linux下编译make文件报错“/bin/bash^M: 坏的解释器:没有那个文件或目录” 问题
PS背景:我在公司做sdk 的pc端开发,所以经常会在win下编译通过之后跑到linux下再运行一次已确保能支持多平台. 今儿在win下跑完一程序,然后放到linux下跑的时候,我用指令: [plai ...
- iOS编译Unity3d文件报错 Permission denied
最近在尝试Unity3d的使用,毕竟Unity可以很好的编译出iOS代码,只用我们正常进行打包就好了. 这里遇到了个问题,分享一下. Archive快结束的时候,报了三个错误,类似于 /Users/s ...
- 解决Linux下编译.sh文件报错 “[: XXXX: unexpected operator”
本人经常在Linux通过编译 .sh文件来生成工程,之前一直都没问题,代码一直都没变,但是今天编译的时候,却提示错误:
- 解决Linux下编译.sh文件报错 unexpected operator Syntax error: word unexpected
执行一个脚本 发现报语法错误,但是在其他机器上运行都没有问题 唯一的区别就是 一个是centos机器 报错的是ubuntu 网上搜索了一下 因为Ubuntu默认的sh是连接到dash的,又因为da ...
- Qt打开外部程序和文件夹需要注意的细节(Qt调用VC写的动态库,VC需要用C的方式输出函数,否则MinGW32编译过程会报错)
下午写程序中遇到几个小细节,需要在这里记录一下. ? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 QProcess *process = new QProcess(this ...
- webRTC中回声消除(AEC)模块编译时aec_rdft.c文件报错:
webRTC中回声消除(AEC)模块编译时aec_rdft.c文件报错. 原因是: 局部变量ip跟全局变量冲突的问题,可以将局部变量重新命名一下,就可以通过编译了. aec_rdft.c修改以后文件代 ...
- caffe:编译时提示:unsupported GNU version! gcc versions later than 4.9 are not supported!
NVCC src/caffe/solvers/adam_solver.cuIn file included from /usr/local/cuda/include/cuda_runtime.h:76 ...
- 【python】python读取文件报错UnicodeDecodeError: 'gbk' codec can't decode byte 0xac in position 2: illegal multibyte sequence
python读取文件报错UnicodeDecodeError: 'gbk' codec can't decode byte 0xac in position 2: illegal multibyte ...
- maven的pom.xml文件报错问题
第一次用 Spring Starter Project 创建一个Spring应用时,POM 文件报错: Project build error: Non-resolvable parent POM f ...
随机推荐
- 解锁LLMs的“思考”能力:Chain-of-Thought(CoT) 技术推动复杂推理的新发展
解锁LLMs的"思考"能力:Chain-of-Thought(CoT) 技术推动复杂推理的新发展 1.简介 Chain-of-Thought(CoT)是一种改进的Prompt技术, ...
- 《最新出炉》系列入门篇-Python+Playwright自动化测试-51- 字符串操作 - 上篇
1.简介 在日常的自动化测试工作中进行断言的时候,我们可能经常遇到的场景.从一个字符串中找出一组数字或者其中的某些关键字,而不是将这一串字符串作为结果进行断言.这个时候就需要我们对字符串进行操作,宏哥 ...
- hive第二课:Hive3.1.2分区与排序以及分桶(内置函数)
Hive3.1.2分区与排序(内置函数) 1.Hive分区(十分重要!!) 分区的目的:避免全表扫描,加快查询速度! 在大数据中,最常见的一种思想就是分治,我们可以把大的文件切割划分成一个个的小的文件 ...
- vim 中代码的折叠和打开
# vim 中代码的折叠和打开 reference: vim中代码的折叠和打开(有删改) https://www.cnblogs.com/xuxm2007/archive/2011/11/10/224 ...
- 基于Mock.js,使用C#生成模拟数据
获取某前端框架, 使用 Mock.js 生成模拟数据, 想要对api进行改造,并且保留原始数据,需要使用C# 重写后端api 的数据 模拟的内容: Random.guid() uuid: '@uuid ...
- 三层交换机vlan间路由
sw1: [Huawei]vlan batch 10 20 [Huawei]int e0/0/1 [Huawei-Ethernet0/0/1]port link-type access [Huawei ...
- SpringBoot 整合EasyExcel 获取动态Excel列名
导读 最近负责消息网关,里面有个短信模板导入功能,因为不同模板编号对应不同参数,导入后的数据定时发送,涉及到Excel中列名不固定问题,于是想根据列名+值,组合成一个大JSON,具体代码如下. 引入依 ...
- Mac VMware Fusion 11.5 虚拟机带密钥
虚拟机 链接: https://pan.baidu.com/s/19V20p5ZV-1U5lFNHrotLgw 密码: rdun CentOS 6.5 链接: https://pan.baidu.co ...
- 如何优雅地使用Mybatis逆向工程生成类
文/朱季谦 1.环境:SpringBoot 2.在pom.xml文件里引入相关依赖: 1 <plugin> 2 <groupId>org.mybatis.generator&l ...
- 容器技术Docker知识精讲【形成知识体系篇】
作者的经验分享,包括很多实战过程和总结,为着手系统化学习Docker容器的朋友提供. 环境要求 Linux操作系统(Centos),建议在虚拟机VMware或VirtualBox下安装Centos D ...