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

相关推荐
Dola_Pan13 分钟前
Linux标准IO(五)-I/O缓冲详解
linux·运维·服务器
TeYiToKu17 分钟前
笔记整理—内核!启动!—linux应用编程、网络编程部分(6)随机数与proc文件系统
linux·c语言·arm开发·笔记·嵌入式硬件
程序猿进阶21 分钟前
定时任务上云改造方案
java·服务器·网络·数据库·性能优化·定时任务·上云
Richardlygo23 分钟前
(华为配置)防火墙双机热备+BFD联动故障切换实验报告
运维·网络安全
cocosum1 小时前
Centos 7 搭建Samba
linux·运维·服务器·centos
SilentCodeY1 小时前
docker build前耗时太长,不明所以
运维·docker·容器·镜像·dockerfile
zhyhgx1 小时前
数据链路层之以太网
linux·运维·网络·网络协议·tcp/ip
因缘而起11 小时前
【Linux】当前进展
linux·运维·服务器
小安运维日记1 小时前
Linux云计算 |【第四阶段】PROJECT2-DAY2
linux·运维·云计算
三雷科技2 小时前
C++在线开发环境搭建(WEBIDE)
服务器·开发语言·c++·code-server