本文来自微信公众号「萌动的红日」,关注后可第一时间收到推送
打开原文 · 去微信公众号阅读

飞牛fnOS系统安装NVIDIA老旧显卡驱动

一台闲置的联想电脑主机,配置特别低了,安装了fnOS飞牛的系统,但是显卡感觉一直没有起作用。主要是显卡太旧了,GeForce GT420,商店里也没有对应的驱动,我们来手动安装一下驱动。
因为在飞牛的相册里,AI识别有了GPU好像速度能快点,这拉胯的显卡也不知道能不能起到作用,但是还是先把驱动安装上看看吧。
应用中心里,安装了这两个实测都是不管用,先卸载了
接下来手动安装,需要打开ssh功能,在系统设置-SSH中启用22端口
启用后打开cmd,输入以下代码连接服务器,账号默认是admin,可以用自己的账号,ip地址改成自己的服务器地址,输入yes确认后,继续输入密码连接成功:
ssh admin@172.16.13.251
可以看到后台的提示信息
我们打开网址:https://www.nvidia.com/en-us/drivers/unix/,点击Archive,
找到390版本的驱动
在NVIDIA-Linux-x86_64-390.157.run上右键点击,然后复制链接,应该是下边这种类型的
https://download.nvidia.com/XFree86/Linux-x86_64/390.157/NVIDIA-Linux-x86_64-390.157.run

回到终端,输入命令,然后回车,开始下载驱动文件
wget https://download.nvidia.com/XFree86/Linux-x86_64/390.157/NVIDIA-Linux-x86_64-390.157.run
给文件添加执行权限,切换到root用户,并运行安装命令,注意需要用root用户执行安装,否则会报错
chmod +X NVIDIA-Linux-x86_64-390.157.run
需要切换到root用户执行安装,否则会报错,像下边这样
切换到root用户之前,需要先设置root密码,
# 执行以下命令,按提示输入新的 root 密码(输入时密码不显示,按回车确认) admin@HOMEFN:~sudo passwd root[sudo] password for admin:New password:Retype new password:passwd: password updated successfully验证:设置完成后,可通过 su - root 命令切换到 root 账户,测试密码是否生效。
切换到root用户进行安装之前,这里还有一大难题,就是安装cc不然还会报错,像这样
由于系统默认没有软件源,我们需要进行配置,按照下边的命令运行,注意先切换到root用户
admin@HOMEFN:~$ su - rootPassword:
cat > /etc/apt/sources.list << EOFdeb https://mirrors.aliyun.com/debian/ bookworm main contrib non-free non-free-firmwaredeb-src https://mirrors.aliyun.com/debian/ bookworm main contrib non-free non-free-firmware
deb https://mirrors.aliyun.com/debian/ bookworm-updates main contrib non-free non-free-firmwaredeb-src https://mirrors.aliyun.com/debian/ bookworm-updates main contrib non-free non-free-firmware
deb https://mirrors.aliyun.com/debian/ bookworm-backports main contrib non-free non-free-firmwaredeb-src https://mirrors.aliyun.com/debian/ bookworm-backports main contrib non-free non-free-firmware
deb https://mirrors.aliyun.com/debian-security/ bookworm-security main contrib non-free non-free-firmwaredeb-src https://mirrors.aliyun.com/debian-security/ bookworm-security main contrib non-free non-free-firmwareEOF
apt update
这样就可以安装gcc了,按y确认
root@HOMEFN:~# apt-get install gccReading package lists... DoneBuilding dependency tree... DoneReading state information... DoneThe following packages were automatically installed and are no longer required:  libclang-cpp14 libigc1 libigdfcl1 libllvmspirvlib14 libopencl-clang14Use 'apt autoremove' to remove them.The following additional packages will be installed:  binutils binutils-common binutils-x86-64-linux-gnu cpp cpp-12 gcc-12 gcc-12-base libasan8 libatomic1 libbinutils  libc-bin libc-l10n libcc1-0 libctf-nobfd0 libctf0 libgcc-12-dev libgcc-s1 libgfortran5 libgomp1 libgprofng0 libisl23  libitm1 liblsan0 libmpc3 libmpfr6 libquadmath0 libstdc++6 libtsan2 libubsan1Suggested packages:  binutils-doc cpp-doc gcc-12-locales cpp-12-doc gcc-multilib autoconf automake libtool flex bison gdb gcc-doc  gcc-12-multilib gcc-12-docThe following NEW packages will be installed:  binutils binutils-common binutils-x86-64-linux-gnu cpp cpp-12 gcc gcc-12 libasan8 libatomic1 libbinutils libcc1-0  libctf-nobfd0 libctf0 libgcc-12-dev libgprofng0 libisl23 libitm1 liblsan0 libmpc3 libmpfr6 libtsan2 libubsan1The following packages will be upgraded:  gcc-12-base libc-bin libc-l10n libgcc-s1 libgfortran5 libgomp1 libquadmath0 libstdc++68 upgraded, 22 newly installed, 0 to remove and 174 not upgraded.Need to get 48.7 MB of archives.After this operation, 180 MB of additional disk space will be used.Do you want to continue? [Y/n]

显示这样,表示安装成功

输入命令进行测试,显示这样表示安装成功。

root@HOMEFN:~# gcc --versiongcc (Debian 12.2.0-14+deb12u1) 12.2.0Copyright (C) 2022 Free Software Foundation, Inc.This is free software; see the source for copying conditions.  There is NOwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

接下来运行安装命令

root@HOMEFN:~# sh /home/admin/NVIDIA-Linux-x86_64-390.157.run

看样子要安装成功了
结果弹出来安装失败。
看了一下日志,真的是失败了, NVIDIA 390.157 驱动太老了,飞牛较新的 Linux 内核(6.12.18)上编译失败。
问了一下AI,原因
解决方案对我来说不适用,如果你的显卡比这个新,可以按照这个思路来试试,也行能成功。
方案一:

❌ 不推荐:强行打补丁修复 390 驱动

虽然社区有人为旧驱动打过适配新内核的补丁(如 nvidia-legacy-patches),但:

  • 390 系列已停止官方支持
  • 内核 6.12 太新,几乎没有现成补丁可用
  • 即使修好 get_user_pages_remote,还可能有其他 API 变更(如 vm_insert_pageioremap 等)。
方案二:

升级显卡或使用开源驱动

  • NVIDIA 390 系列驱动仅支持 Fermi (GF1xx) 和部分 Kepler (GK10x) 架构
  • 如果你的显卡是 GeForce 400/500/600/700 系列早期型号(如 GTX 480、GTX 560、GTX 650 等),那么它确实只能用 390 驱动


最终关键结论NVIDIA 390 驱动不支持 Linux 内核 6.x,这是设计限制,不是配置问题,后续只能换一个高点的显卡了,因为飞牛的Linux内核不可能降级了。


关注「萌动的红日」

每天一点正能量,陪你迎接每一个萌动的红日。关注公众号,第一时间阅读最新文章。

本文内容已在公众号首发,点击下方按钮可跳转微信原文

打开原文 · 去微信公众号阅读

原文链接:在微信公众号中阅读

上一篇微信/QQ/TIM防撤回补丁,可以查看对方撤回的消息 下一篇插上 U 盘自动备份?这款神器 USBCopyer 帮你搞定!
← 返回文章列表
关注公众号