Install NVIDIA on ubuntu18.04

Foreword: For the newly installed ubuntu system, the specific dual-system installation process can be viewed here
and recorded for the specific process of driver installation, so that you can see it next time.

1. Reference articles

1. Three ways to install graphics card driver on ubuntu
2. Install NVIDIA graphics card driver on Ubuntu 18.04

2. Specific process

1. https://www.nvidia.cn/geforce/drivers/ Choose to download according to your own needs.

The picture below is some of my version information:
this is my own needI downloaded: NVIDIA-Linux-x86_64-435.21.run (I put it under /home/tcy/)

Link: https://pan.baidu.com/s/1Xyu-vAs40fQnPJLmggf5uw Password: u71h

Self-pickup if necessary.

2. Disable nouveau

  • sudo gedit /etc/modprobe.d/blacklist-nouveau.conf
  • Add the following:
blacklist nouveau
options nouveau modeset=0

Save it.

  • sudo update-initramfs -u

3. Restart, use lsmod | grep nouveauto confirm whether nouveau is disabled (should have no output)

4、

  • Press Ctrl + Alt + F3 (F1~F6 can be tried, mine is F3) to enter x-server
  • Enter user name, password (keypad is not available)
  • sudo service lightdm stop
    At this time, it prompts Failed to stop lightdm.service: Unit lightdm.service not loaded.
    Solution: sudo apt install lightdm
    After the installation is complete, select lightdm and enter again:sudo service lightdm stop

5. Install the driver

sudo chmod a+x NVIDIA-Linux-x86_64-435.21.run
sudo /home/tcy/NVIDIA-Linux-x86_64-435.21.run -no-opengl-files

(1) error:

ERROR: Unable to find the development tool `cc` in your path;

Solution:
Refer to installing the gcc compiler in Ubuntu and how to use it

  • First exit x-server:
    sudo service lightdm start
    then Ctrl+Alt+F7.
sudo apt-get update 
sudo install build-essential
  • Check gcc version
gcc --version

Then enter x-server to install.

Note:
Choose yes when asked whether to use xconfig.

6. Whether the test is successful

nvidia-smi

insert image description here

nvidia-settings

Guess you like

Origin blog.csdn.net/qq_42622871/article/details/109705701