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

相关推荐
bug攻城狮几秒前
彻底禁用 CentOS 7.9 中 vi/vim 的滴滴声
linux·运维·服务器·centos·vim
苹果醋322 分钟前
数据库索引设计:在 MongoDB 中创建高效索引的策略
java·运维·spring boot·mysql·nginx
XMYX-038 分钟前
Linux 物理机如何区分 SSD 与 HDD ——以 DELL PERC H730 Mini 为例
linux·运维
轻松Ai享生活40 分钟前
5 天学习 Linux Kernel 主要原理 | Day 3:内存管理与Swap机制
linux
轻松Ai享生活41 分钟前
QAT 与 GPU 在SHA-1 运算中的优劣
linux
行思理1 小时前
linux 安全与防护,全方向讲解
linux·安全·github
tan180°2 小时前
Boost搜索引擎 查找并去重(3)
linux·c++·后端·搜索引擎
yongui478342 小时前
CentOS系统如何查看当前内存容量
linux·运维·centos
xzq_java2 小时前
CentOS操作系统虚拟机安装以及连接工具下载和远程连接工具远程连接
linux·运维·centos
Sweety丶╮7943 小时前
【Ansible】实施 Ansible Playbook知识点
服务器·云原生·ansible