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

相关推荐
lihao lihao16 小时前
软硬链接
linux·运维·服务器
TOWE technology16 小时前
智能安防监控系统如何做好防雷?——视频信号SPD综合应用方案解析
运维·服务器·防雷产品·信号保护·信号防雷·spd
楼田莉子16 小时前
Docker学习:Docker介绍及其架构介绍
运维·后端·学习·docker·容器·架构
雪度娃娃16 小时前
存储器层次结构——磁盘硬盘存储
服务器·网络·数据库·计算机组成原理
YY&DS16 小时前
Qt 嵌入 CEF 在 Linux 下必须设置 `QT_XCB_GL_INTEGRATION=xcb_egl才能加载网页
linux·开发语言·qt
辰风沐阳16 小时前
ThinkPHP8.1 + think-swoole 4.1 使用指南(保姆级教程)
linux·后端·swoole
大明者省17 小时前
IIS 端口绑定正常访问的原理说明与常见误区澄清
运维·服务器·笔记
tedcloud12317 小时前
ai-engineering-from-scratch部署教程:从零搭建AI应用环境
服务器·前端·人工智能·系统架构·edge
mounter62517 小时前
迈向硬件级无缝热升级:Linux 内核 VFIO 与 IOMMU 持久化技术的演进之路
linux·服务器·内存管理·kernel
晚风吹红霞17 小时前
Linux软件包管理器详解 —— yum与apt的使用及软件生态
linux·运维·服务器