flash-attn安装失败

  安装大模型相关环境时,碰到了flash-attn无法安装的问题,看来看去,原来是系统的gcc、g++版本过低。通过以下链接升级centos默认的gcc版本到9:CentOS升级gcc到高版本(全部版本详细过程)

yum -y install centos-release-scl scl-utils
yum -y install devtoolset-9-gcc devtoolset-9-gcc-c++ devtoolset-9-binutils 
scl enable devtoolset-9 bash
# 需要注意的是scl命令启用只是临时的,退出shell或重启就会恢复原系统gcc版本。
# 如果要长期使用gcc 9.3的话,需要在/etc/profile或者~/.bashrc中添加
echo "source /opt/rh/devtoolset-9/enable" >>/etc/profile 
需要说明的是scl源失效了,按上面的命令找不到devtoolset,手工建一个源,然后再yum install。
[centos-sclo-sclo]
name=CentOS-7 - SCLo sclo
baseurl=https://mirrors.aliyun.com/centos/7/sclo/x86_64/sclo/
# mirrorlist=http://mirrorlist.centos.org?arch=$basearch&release=7&repo=sclo-sclo
gpgcheck=0
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-SCLo

 gcc --version查看gcc版本。

posted @ 2024-05-29 16:41  badwood  阅读(377)  评论(0编辑  收藏  举报
Badwood's Blog