Ubuntu20.04 Install Nvidia Graphics Driver Tutorial

1. Disable nouveau

1. Create a file. If you have not downloaded the vim editor , just replace vim with gedit

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

2. Insert the following content into the file and 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 take effect and restart

sudo update-initramfs -u
sudo reboot

4. Verify after reboot

lsmod | grep nouveau

If there is no response after the carriage return, the disable is successful

2. Install the graphics card driver

First completely uninstall the previously installed graphics driver :

ppa source file uninstall:

$ sudo apt-get remove --purge nvidia*

Runfile source file uninstall:

$ sudo ./NVIDIA-Linux-x86_64-384.59.run --uninstall

Now introduce the simplest installation method - ppa source driver installation

Query the most suitable graphics card driver version for your computer

ubuntu-drivers devices

As shown in the picture, the best graphics driver version of my computer is nvidia-driver-525

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-525 #此处数字要对应上面查询到的版本号
sudo apt-get install mesa-common-dev

Note: If the secure boot has not been disabled before, a password will be prompted during the installation process. When restarting, you need to enter the password verification to disable the secure boot. After restarting, a blue screen will appear. At this time, you cannot directly select continue, but press the button , select Enroll MOK, select continue in the next option after confirmation, then enter the password set when installing the driver, and start the machine.

Reboot after installation is complete

sudo reboot

After restarting, verify in the terminal

nvidia-smi

If the GPU list appears, the installation is successful

 

Guess you like

Origin blog.csdn.net/ytusdc/article/details/132381217