当前位置: 首页 > news >正文

error -- unsupported GNU version gcc later than 10 are not supported;(gcc、g++)

服务器跑dit时编译flash-atten以及pytorch的cuda版本检查出错,分别报错题目以及如下:

想了下是系统找不到编译器

subprocess.CalledProcessError: Command '['which', 'c++']' returned non-zero exit status 1.

备案,以后有人要用12我还得换回来

方案一:更改gcc和gcc+的版本

没有合适的版本的话需要root权限指定版本安装

安装好以后设置优先级如下:

查看两种编译器版本号:

gcc -v

g++ -v

设置两种编译器多版本优先级:

sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 40

xym@try2019-Super-Server:/usr/bin$ sudo update-alternatives --config gcc
There are 2 choices for the alternative gcc (providing /usr/bin/gcc).

  Selection    Path             Priority   Status
------------------------------------------------------------
  0            /usr/bin/gcc-12   50        auto mode
* 1            /usr/bin/gcc-11   40        manual mode
  2            /usr/bin/gcc-12   50        manual mode

Press <enter> to keep the current choice[*], or type selection number: 

g++ -v

Command 'g++' not found, but can be installed with:
apt install g++

sudo update-alternatives --config g++

------------------------------------------------------------
  0            /usr/bin/g++-12   50        auto mode
* 1            /usr/bin/g++-11   40        manual mode
  2            /usr/bin/g++-12   50        manual mode

Press <enter> to keep the current choice[*], or type selection number: 

方案二:

重新安装cuda-toolkit,因为它的版本和cuda对不上,但是有一些风险,这里不做推荐


http://www.mrgr.cn/news/33621.html

相关文章:

  • 条件编译及头文件包含
  • DAY78服务攻防-数据库安全RedisCouchDBH2database未授权访问CVE 漏洞
  • ModbusTCP通讯错误的排查
  • 数据处理与统计分析篇-day08-apply()自定义函数与分组操作
  • 【掘金量化使用技巧】用日线合成长周期k线
  • golang学习笔记8-运算符与输入
  • 使用Okhttp-服务器不支持缓存的解决办法
  • 百度智能云API调用
  • AI大模型基础概念
  • AD19基础应用技巧:交叉选择/跳转到器件/镜像粘贴/元器件矩形区域排列/选择过滤器/捕捉对象等设置
  • 插件化换肤的优缺点分别是什么
  • 【练习16】求最小公倍数
  • kindle云端同步
  • 项目扩展四:交换机和队列的特性完善【自动删除与队列独占的实现】
  • Java是怎么处理死锁的
  • hive-拉链表
  • LeetCode讲解篇之238. 除自身以外数组的乘积
  • torch模型量化方法总结
  • HarmonyOS元服务与卡片
  • Spring AOP - 配置文件方式实现