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

相关推荐
敲上瘾32 分钟前
Linux系统cgroups资源精细化控制基础
linux·测试工具·docker·压力测试·cgroups
起个昵称吧1 小时前
线程相关编程、线程间通信、互斥锁
linux·算法
sunflower_w1 小时前
linux I2C核心、总线与设备驱动
linux·运维·服务器
myzzb2 小时前
基于uiautomation的自动化流程RPA开源开发演示
运维·python·学习·算法·自动化·rpa
Ronin3052 小时前
【Linux系统】进程间通信:System V IPC——共享内存
linux·服务器·system v 共享内存
网硕互联的小客服3 小时前
Apache 如何支持SHTML(SSI)的配置方法
运维·服务器·网络·windows·php
基于python的毕设3 小时前
C语言栈的实现
linux·c语言·ubuntu
落日漫游4 小时前
K8s核心组件全解析
运维·docker·运维开发
luoqice4 小时前
linux下找到指定目录下最新日期log文件
linux·算法
林开落L4 小时前
库的制作与原理
linux·开发语言·动静态库·库的制作