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

相关推荐
Felven10 小时前
stress-ng 与 fio 性能测试工具使用指南
linux·测试工具·fio·stress-ng
XiaoMaqqqq11 小时前
市面上正规的IP驱动产业新场景新工具哪家强
运维·python·网络协议·tcp/ip
huainingning11 小时前
RJ SW Console口忘记密码处理方法
linux·运维·服务器
布裘11 小时前
【银河麒麟】桌面系统循环登录,无法进入桌面?
linux·运维·服务器
慧都小项11 小时前
程序到了Linux才出错?用CLion把调试接到目标环境
linux·运维·服务器
Lsetea12 小时前
OpenSSL verify报unhandled critical extension:error 34与关键扩展排查
运维·https·ssl证书·openssl·证书链
guo_wen_qiang12 小时前
docker的备份与迁移
运维·docker·容器
Ruiery13 小时前
Linux 6.6内核内存管理深度解析(一):物理内存初始化 — memblock 怎么把内存交给 buddy
linux·运维·服务器
2401_8685347814 小时前
无线网络规划设计
服务器·网络
库拉镜像AI牛牛14 小时前
短剧内容自动化生产:知漫剧工作室落地教程
大数据·服务器·前端·人工智能·语音识别