0、 Preliminary preparation
Disable the secure boot of the BIOS, that is, disable it. If it is not closed, installing the graphics card driver using a third-party source will not work after installation.
1、 Disable nouveau
1、 Create a file, if you haven’t downloaded the vim editor, just change vim to gedit
$ sudo vim /etc/modprobe.d/blacklist-nouveau.conf
2、 Insert the following content in the file to add nouveau to the blacklist, which is not enabled by default
blacklist nouveau
options nouveau modeset=0
3、 Enter the following command to make the disable effective and then restart
$ sudo update-initramfs -u
$ sudo reboot
4、 Verify after restart
lsmod | grep nouveau
If there is no response after pressing Enter, then disable successfully
2、 Install graphics driver
First completely uninstall the graphics driver installed before:
Uninstall the ppa source file:
$ sudo apt-get remove --purge nvidia*
Runfile source file uninstall:
$ sudo ./NVIDIA-Linux-x86_64-384.59.run --uninstall
Now introduce the easiest installation method-ppa source driver installation
Query the most suitable graphics card driver version for the computer
ubuntu-drivers devices
As shown in the figure, the best graphics driver version for my computer is nvidia-driver-435
Then use the command line to install
$ sudo add-apt-repository ppa:graphics-drivers/ppa
$ sudo apt-get update
$ sudo apt-get install nvidia-driver-435 #The number here should correspond to the version number queried above
$ sudo apt-get install mesa-common-dev
Note: If you have not disabled secure boot before, you will be prompted to set a password during the installation process, and you need to enter the password verification to disable secure boot when restarting. A blue screen will appear after restarting. At this time, you cannot directly select continue, but press the button , Select Enroll MOK, after confirming, select continue in the next option, then enter the password set during driver installation, and turn on the computer.
Restart after installation
$ sudo reboot
Verify in terminal after restart
$ nvidia-smi
If the GPU list appears, the installation is successful