NVIDIA 驱动程序安装指南
-
卸载现有的 NVIDIA 驱动程序:
bashsudo apt-get purge nvidia*
-
添加 NVIDIA PPA:
bashsudo add-apt-repository ppa:graphics-drivers/ppa sudo apt-get update
-
安装推荐的 NVIDIA 驱动程序:
bashsudo ubuntu-drivers devices sudo apt-get install nvidia-driver-560
bash== /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0 == modalias : pci:v000010DEd000028A0sv00001D05sd00001295bc03sc00i00 vendor : NVIDIA Corporation driver : nvidia-driver-560 - third-party non-free recommended driver : nvidia-driver-550-open - third-party non-free driver : nvidia-driver-535-server - distro non-free driver : nvidia-driver-545 - third-party non-free driver : nvidia-driver-535 - distro non-free driver : nvidia-driver-545-open - third-party non-free driver : nvidia-driver-535-open - distro non-free driver : nvidia-driver-550 - third-party non-free driver : nvidia-driver-560-open - third-party non-free driver : nvidia-driver-535-server-open - distro non-free driver : xserver-xorg-video-nouveau - distro free builtin
-
重启系统:
bashsudo reboot
-
检查 NVIDIA 驱动程序是否正确安装:
bashnvidia-smi
如果问题仍然存在,请确保你的系统已经禁用了 Nouveau 驱动程序,并且内核模块已经正确加载。你可以通过以下步骤来禁用 Nouveau 驱动程序:
-
创建或编辑
/etc/modprobe.d/blacklist-nouveau.conf
文件:bashsudo nano /etc.modprobe.d/blacklist-nouveau.conf
-
添加以下内容:
plaintextblacklist nouveau options nouveau modeset=0
-
更新 initramfs:
bashsudo update-initramfs -u
-
重启系统:
bashsudo reboot
重启后,再次尝试运行 nvidia-smi
以检查驱动程序是否正常工作。
切换 Intel 和 NVIDIA 显示
你可以使用 prime-select
工具在 Intel 和 NVIDIA 显示之间进行切换:
-
切换到 NVIDIA 显示:
bashsudo prime-select nvidia sudo reboot
-
切换到 Intel 显示:
bashsudo prime-select intel sudo reboot
使用以上命令可以在需要时切换显卡,以便在性能和电池寿命之间取得平衡。