如何通过使用官网的包安装nvidia驱动程序

启用non-free存储库。

以管理员身份,打开“/etc/apt/sources.list”,并添加non-freecontrib存储库。

例如,更改存储库定义:

将
deb http://ftp.au.debian.org/debian/buster main
改成
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.

注意这里建议的NVIDIA驱动程序号是“390”。

从官方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

禁用默认的nouveau驱动程序:

# echo blacklist nouveau > /etc/modprobe.d/blacklist-nvidia-nouveau.conf

重新启动到多用户runlevel。重新启动后会禁用GUI用户:

# systemctl set-default multi-user.target
# systemctl reboot

通过终端或者TTY以root用户身份登录,执行下面的命令安装nvidia驱动程序:

# 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

使系统启动到GUI:

# systemctl set-default graphical.target

重启Debian 10系统

# systemctl reboot

如何使用Debian存储库安装NVIDIA驱动程序

启用non-freecontrib的“存储库”。

打开 /etc/apt/sources.list并添加 non-free存储库。

例如,更改存储库定义:

将
deb http://ftp.au.debian.org/debian/buster main
改为
deb-src http://ftp.au.debian.org/debian/buster main non-free contrib

使用以下命令更新存储库索引文件:

# apt update

安装nvidia-detect实用程序:

# apt -y install nvidia-detect

检测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服务器

# systemctl reboot
如何在Debian 10 Buster Linux上安装NVIDIA驱动程序
日期:2020-07-07 20:56:23 来源:oir作者:oir