禁用 nouveau 驱动
检查是否加载 nouveau 驱动
lsmod |grep -i nouveau
修改/lib/modprobe.d/dist-blacklist.conf
文件,
如果是不想使用 Nvidia 显卡做视频输出,需要注释 blacklist nvidiafb
段。
最后新增字段:
blacklist nouveau
options nouveau modeset=0
vim /lib/modprobe.d/dist-blacklist.conf
#
# Listing a module here prevents the hotplug scripts from loading it.
# Usually that'd be so that some other driver will bind it instead,
# no matter which driver happens to get probed first. Sometimes user
# mode tools can also control driver binding.
#
# Syntax: see modprobe.conf(5).
#
# watchdog drivers
blacklist i8xx_tco
# framebuffer drivers
blacklist aty128fb
blacklist atyfb
blacklist radeonfb
blacklist i810fb
blacklist cirrusfb
blacklist intelfb
blacklist kyrofb
blacklist i2c-matroxfb
blacklist hgafb
#blacklist nvidiafb
blacklist rivafb
blacklist savagefb
blacklist sstfb
blacklist neofb
blacklist tridentfb
blacklist tdfxfb
blacklist virgefb
blacklist vga16fb
blacklist viafb
# ISDN - see bugs 154799, 159068
blacklist hisax
blacklist hisax_fcpcipnp
# sound drivers
blacklist snd-pcsp
# I/O dynamic configuration support for s390x (bz #563228)
blacklist chsc_sch
blacklist nouveau
options nouveau modeset=0
initramfs 重构
#镜像备份
sudo mv /boot/initramfs-Suname -r).img /boot/initramfs-Suname -r).imq.bak
#镜像重构,以下命令二选一即可
sudo dracut /boot/initramfs-$(uname -r).img $(uname -r)
sudo dracut --force
#需要重启
reboot
安装驱动:
./NVIDIA-Linux-x86_64-535.54.03.run
卸载驱动:
./NVIDIA-Linux-x86_64-535.54.03.run --uninstall
查看驱动和 GPU 信息:
nvidia-smi
[root@localhost ~]# nvidia-smi
Wed Jul 26 03:30:04 2023
+---------------------------------------------------------------------------------------+
| NVIDIA-SMI 535.54.03 Driver Version: 535.54.03 CUDA Version: 12.2 |
|-----------------------------------------+----------------------+----------------------+
| GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|=========================================+======================+======================|
| 0 NVIDIA GeForce RTX 3090 Off | 00000000:38:00.0 Off | N/A |
| 30% 29C P8 6W / 350W | 12MiB / 24576MiB | 0% Default |
| | | N/A |
+-----------------------------------------+----------------------+----------------------+
| 1 NVIDIA GeForce RTX 3090 Off | 00000000:A8:00.0 Off | N/A |
| 30% 28C P8 12W / 350W | 12MiB / 24576MiB | 0% Default |
| | | N/A |
+-----------------------------------------+----------------------+----------------------+
+---------------------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=======================================================================================|
| 0 N/A N/A 8129 G /usr/libexec/Xorg 4MiB |
| 1 N/A N/A 8129 G /usr/libexec/Xorg 4MiB |
+---------------------------------------------------------------------------------------+