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对不上,但是有一些风险,这里不做推荐

相关推荐
π大星星️1 小时前
Jenkins 工作流程
运维·jenkins
Juicedata2 小时前
JuiceFS v1.3-Beta2:集成 Apache Ranger,实现更精细化的权限控制
运维·人工智能·ai
IT成长日记2 小时前
05【Linux经典命令】Linux 用户管理全面指南:从基础到高级操作
linux·运维·服务器·用户管理·命令
小鱼小鱼.oO5 小时前
阿里云服务器安装nginx并配置前端资源路径(前后端部署到一台服务器并成功访问)
服务器·nginx·阿里云
资讯第一线6 小时前
Windows系统工具:WinToolsPlus 之 SQL Server Suspect/质疑/置疑/可疑/单用户等 修复
运维
惊起白鸽4506 小时前
LVS负载均衡
运维·负载均衡·lvs
Sapphire~8 小时前
Linux-07 ubuntu 的 chrome 启动不了
linux·chrome·ubuntu
伤不起bb8 小时前
NoSQL 之 Redis 配置与优化
linux·运维·数据库·redis·nosql
广东数字化转型8 小时前
nginx怎么使用nginx-rtmp-module模块实现直播间功能
linux·运维·nginx
love530love8 小时前
【笔记】在 MSYS2(MINGW64)中正确安装 Rust
运维·开发语言·人工智能·windows·笔记·python·rust