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

相关推荐
鸠摩智首席音效师24 分钟前
如何使用 docker exec 在容器中运行命令 ?
运维·docker·容器
似水এ᭄往昔1 小时前
【Linux】自动化构建-make/Makefile
linux·运维·服务器·ubuntu
顶点多余1 小时前
Linux“信号“从硬件到软件详解
linux·运维·服务器
勘察加熊人2 小时前
ai飞卢小说自动化处理工作流获得提问素材
运维·自动化
瀚高PG实验室2 小时前
rpm包安装报错:cannot open Packages index using db5 - Cannot allocate memory (12)
linux·运维·服务器·瀚高数据库
云计算老刘2 小时前
2. DNS 服务器
运维
水星灭绝2 小时前
win11+wsl2+docker
运维·docker·容器
追风少年王大爷丶3 小时前
nginx 配置无域名访问拒绝
运维·服务器·nginx
AI+程序员在路上3 小时前
嵌入式软件技术大全
linux·开发语言·arm开发·单片机
black方块cxy3 小时前
实现一个输入框多个ip以逗号分隔最多20组,且ip不能重复
java·服务器·前端