Bootstrap

ubuntu20.04安装Nvidia显卡驱动

1、更新软件列表和安装必要软件、依赖(必须)

sudo apt-get update      #更新软件列表
sudo apt-get install g++
sudo apt-get install gcc
sudo apt-get install make```

2、禁用nouveau

创建文件并插入内容:

$ sudo vim /etc/modprobe.d/blacklist-nouveau.conf

在文件末尾添加如下内容:

blacklist nouveau
options nouveau modeset=0

生效并重启

sudo update-initramfs -u   #更新系统
sudo reboot

验证是否禁用成功

lsmod | grep nouveau

如果没有任何输出,则说明禁用成功

3,安装驱动

下载驱动网址:
https://www.nvidia.com/en-us/drivers/

sudo sh NVIDIA-Linux-x86_64-550.144.03.run –no-opengl-files –no-x-check –no-nouveau-check

参数详细解释:

–no-opengl-files 只安装驱动文件,不安装OpenGL文件。这个参数最重要

–no-x-check 安装驱动时不检查X服务

–no-nouveau-check 安装驱动时不检查nouveau

安装时遇到的选项:

1.If you plan to no longer use the NVIDIA deriver, you should make sure that no X screens are configured to use the NVIDIA X driver X driver in your X configuration file. If you used nvidia-xconfig to configure X, it may have created  a backup of your original configuration. Would you like to run 'nvidia-xconfig --restore-original-backup' to attempt restoration of the original X configuration file?

no

2.Would you like to run the nvidia-xconfig utility to automatically updata your X onfiguration 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

3.Would you like to register the kernel module souces with DKMS? This will allow DKMS to automatically build a new module, if you install a different kernel later?
no

验证安装成功

nvidia-smi
;