显卡驱动
N卡驱动
案例:神州笔记本的 Debian13 系统上安装 NVIDIA 显卡驱动
bash
# 安装查看工具
apt install nvidia-detect -y
# 安装必要的编译工具和内核头文件
apt update
apt install -y build-essential gcc make dkms
apt install -y linux-headers-$(uname -r)
# 图形化界面,终端不需要
# apt install -y xorg-server-dev xserver-xorg-devbash
# 查看显卡型号
root ➜ ~ lspci | grep -i vga
00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09)
01:00.0 VGA compatible controller: NVIDIA Corporation GF108M [GeForce GT 540M] (rev a1)
root ➜ ~ nvidia-detect
Detected NVIDIA GPUs:
01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GF108M [GeForce GT 540M] [10de:0df4] (rev a1)
Checking card: NVIDIA Corporation GF108M [GeForce GT 540M] (rev a1)
Your card is only supported by the 390 legacy drivers series, which is only available up to bullseye.
➜ ~bash
# 创建黑名单文件
cat > /etc/modprobe.d/blacklist-nouveau.conf << EOF
blacklist nouveau
blacklist lbm-nouveau
options nouveau modeset=0
alias nouveau off
alias lbm-nouveau off
EOF
# 更新 initramfs
update-initramfs -u
# 重启进入文本模式(重要!)
sync;sync;sync;rebootbash
# 切换到运行级别 3
init 3
# 下载源码包
# 去 https://www.nvidia.cn/drivers/ 官网,选择对应的驱动下载并上传到服务器,使用url直接下载会失败
# 给安装文件执行权限
root ➜ ~ chmod +x NVIDIA-Linux-x86_64-390.157.run
# 运行安装程序
# 由于版本兼容性问题,在Debian13安装失败
root ➜ ~ ./NVIDIA-Linux-x86_64-390.157.run