如何在 Debian 10 Buster Linux 上安装 Nvidia 驱动程序
在本文中,您将了解如何从标准 Debian 存储库在 Debian 10 Buster 上安装 Nvidia 驱动程序。如果由于某种原因从标准 Debian 存储库安装 Nvidia 驱动程序失败,或者您只是想安装更多最新的 Nvidia 驱动程序,本教程还将解释如何安装直接从 Nvidia 下载的官方 Nvidia 驱动程序。 com 网站。
要在其他 Linux 发行版上安装 Nvidia 驱动程序,请遵循我们的 Nvidia Linux 驱动程序指南。
在本教程中您将学习:
如何检测您的 nvidia 卡型号
如何从标准 Debian 存储库安装 Nvidia 驱动程序
如何从 Nvidia 官方软件包安装 Nvidia 驱动程序
如何禁用 nouveau 驱动程序
如何安装 Nvidia 驱动程序先决条件
Debian 10 Buster GNU/Linux 上安装的 Nvidia 驱动程序
如何使用 Debian 存储库安装 NVIDIA 驱动程序分步说明
启用
non-free
和contrib
存储库。以管理用户身份打开
/etc/apt/sources.list
并添加non-free
存储库。例如更改存储库定义:FROM: deb http://ftp.au.debian.org/debian/ buster main TO: deb-src http://ftp.au.debian.org/debian/ buster main non-free contrib
准备好后,使用以下命令更新存储库索引文件:
# apt update
通过执行以下命令来安装
nvidia-detect
实用程序:# apt -y install nvidia-detect
检测您的 Nvidia 卡型号和建议的 Nvidia 驱动程序。为此,请执行上面安装的
nvidia-detect
命令。例如:# nvidia-detect Detected NVIDIA GPUs: 01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GP106 [GeForce GTX 1060 6GB] [10de:1c03] (rev a1) Checking card: NVIDIA Corporation GP106 [GeForce GTX 1060 6GB] (rev a1) Your card is supported by the default drivers and legacy driver series 390. It is recommended to install the nvidia-driver package.
按照上一步的建议安装推荐的驱动程序:
# apt install nvidia-driver
全做完了。重新启动您的 Debian 10 Buster Linux 机器:
# systemctl reboot
如何使用 nvidia.com 官方软件包安装 NVIDIA 驱动程序分步说明
通过执行以下命令来安装
nvidia-detect
实用程序:# apt -y install nvidia-detect
检测您的 Nvidia 卡型号和建议的 Nvidia 驱动程序。为此,请执行上面安装的
nvidia-detect
命令。例如:# nvidia-detect Detected NVIDIA GPUs: 01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GP106 [GeForce GTX 1060 6GB] [10de:1c03] (rev a1) Checking card: NVIDIA Corporation GP106 [GeForce GTX 1060 6GB] (rev a1) Your card is supported by the default drivers and legacy driver series 390. It is recommended to install the nvidia-driver package.
从Nvidia.com官方网站下载推荐的Nvidia源码包。按照上一步的建议,搜索与驱动程序编号相匹配的软件包名称。将下载的文件保存到您的主目录中:
$ ls NVIDIA-Linux-x86_64-390.116.run NVIDIA-Linux-x86_64-390.116.run
安装Nvidia驱动编译必备条件:
# apt -y install linux-headers-$(uname -r) build-essential libglvnd-dev pkg-config
# echo blacklist nouveau > /etc/modprobe.d/blacklist-nvidia-nouveau.conf
重新启动到多用户运行级别。这将在重新启动后禁用 GUI 用户:
# systemctl set-default multi-user.target # systemctl reboot
以管理用户身份打开 /etc/apt/sources.list
并添加 non-free
和 contrib
存储库。例如更改存储库定义:
FROM:
deb http://ftp.au.debian.org/debian/ buster main
TO:
deb-src http://ftp.au.debian.org/debian/ buster main non-free contrib
准备好后,使用以下命令更新存储库索引文件:
# apt update
注意
根据您下载的驱动程序版本,以下命令可能会有所不同。修改以下命令以适合之前下载的驱动程序文件名。
# bash NVIDIA-Linux-x86_64-390.116.run
在安装过程中,您可能会被问到以下一组问题:
The CC version check failed:
The kernel was built with gcc version 8.2.0 (Debian 8.2.0-14), but the current compiler version is cc (Debian 8.3.0-2) 8.3.0.
This may lead to subtle problems; if you are not certain whether the mismatched compiler will be compatible with your kernel, you may wish to abort installation, set the CC environment variable to the name of the compiler used to compile your kernel, and restart installation.
Ignore CC version check Abort installation
Install NVIDIA's 32-bit compatibility libraries?
Yes No
An incomplete installation of libglvnd was found. Do you want to install a full copy of libglvnd? This will overwrite any existing libglvnd libraries.
Don't install libglvnd files Install and overwrite existing filesort installation. Abort installation.
Would you like to run the nvidia-xconfig utility to automatically update your X configuration file so that the NVIDIA X driver will be used when you restart X? Any pre-existing X configuration file will be backed up.
Yes No
# systemctl set-default graphical.target
# systemctl reboot