Ubuntu 18.04 sad (failed) experience of installing NVIDIA driver and solutions (successful system replacement)

Keywords: Linux Ubuntu slam nvidia

Problem Description:
The NVIDIA driver is installed in ubuntu 18.04 system. NVIDIA SMI can output GPU graphics card information, but after sudo reboot, the screen is black and cannot enter the graphical interface, so it cannot be turned on. After entering the tty interface and deleting the NVIDIA driver, you can successfully enter the ubuntu system.

But the driver still needs to be installed. If ZED2 binocular camera only uses CPU, it can only obtain the binocular information of the camera (that is, it can be used as an ordinary camera). The official slam and depth information processing functions cannot be realized.

Therefore, the sad and time-consuming process of stepping on the pit and burying the pit was started.

Ubuntu 18.04 installation process of NVIDIA driver:
1) Installation method
It's easy to find on the Internet, so I won't elaborate. To sum up, there are three types:
The specific methods can be seen https://blog.csdn.net/wf19930209/article/details/81877822

  • Install from ubuntu standard warehouse. Using ubuntu drives Autoinstall is actually apt get install
    NVIDIA drivers XXX, but the version does not need to be specified. It is recommended to directly install the system. This method does not need to manually prohibit nouveau and exit the graphical interface; it's fine too
ubuntu-drivers devices//Check the nvidia drivers recommended by the system
sudo apt install nvidia-driver-XXX //Install the recommended driver
  • Install from PPA source. Add the PPA source, then apt get install NVIDIA drivers XXX, the others are the same as above;
  • Use the official installer. The most orthodox installation method, the main difference is that this method needs to manually prohibit nouveau and exit the graphical interface;

I have tried all three methods, and only the. run installation method can be installed successfully.

2) Problems encountered and solutions tried

Question:
The NVIDIA driver is installed in ubuntu 18.04 system. NVIDIA SMI can output GPU graphics card information, but after sudo reboot, the screen is black and cannot enter the graphical interface, so it cannot be turned on. After entering the tty interface and deleting the NVIDIA driver, you can successfully enter the ubuntu system.

There are two possible reasons for speculation:

Desktop and nvidia Drive incompatibility;
Kernel and nvidia Drive incompatibility;

Tried solutions:

  • Uninstall nvidia driver to solve the black screen problem;
sudo apt-get purge nvidia-*
Then enter nvidia-smi,If the driver information is not displayed, it indicates that the uninstallation is successful, and if it can be output GPU Information, then
sudo /usr/bin/nvidia-uninstall
 OK, and then enter nvidia-smi Check for success
  • Try using the official installer and adding the – no opengl files parameter. It is based on a conflict mentioned by nvidia officials, that is, the opengl library of nvidia driver overwrites the original opengl library, resulting in incompatibility of gnome desktop. Result failed;
  • Try to apply the driver version to all current graphics card models from 390 to 440. The reason is that Ubuntu 16.04 cannot install an excessively high version of the driver, otherwise the kernel will be incompatible. Result failed;
  • Try switching gdm3 to lightdm. The reason is that gdm3 is incompatible with the drive. Result failed;
  • Try to use the official installer and add the – add this kernel parameter. The reason is that the kernel interface mentioned in a blog is incompatible, but the blog originally installed the driver, which is incompatible due to the kernel upgrade. There is no relevant installation in the system. There should be no difference between directly installing and adding this parameter. Result failed;
  • No attempt has been made to reinstall the system to reduce it to 16.04 or increase it to 20.04;
  • No attempt has been made to change the desktop to a 2D desktop, such as KDE;

decision:
After basically trying the whole network solution again and still failed, I decided to reinstall the system and upgrade the system to Ubuntu 20.04 with the idea of letting go. Facts have proved that nothing can not be solved by giving up&~&

resolvent:
Upgrade the system to Ubuntu 20.04

Nvidia driver installation method:

Installing lightdm Desktop Services

sudo apt install -y lightdm

install

ubuntu-drivers devices//Check the nvidia drivers recommended by the system
sudo apt install nvidia-driver-470 //Install the recommended driver
~$ ubuntu-drivers devices
WARNING:root:_pkg_get_support nvidia-driver-390: package has invalid Support Legacyheader, cannot determine support level
== /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0 ==
modalias : pci:v000010DEd00001381sv000010DEsd00001065bc03sc00i00
vendor   : NVIDIA Corporation
model    : GM107 [GeForce GTX 750]
driver   : nvidia-driver-460-server - distro non-free
driver   : nvidia-driver-390 - distro non-free
driver   : nvidia-driver-418-server - distro non-free
driver   : nvidia-driver-470 - distro non-free recommended
driver   : nvidia-driver-450-server - distro non-free
driver   : nvidia-driver-460 - distro non-free
driver   : nvidia-driver-470-server - distro non-free
driver   : nvidia-340 - distro non-free
driver   : xserver-xorg-video-nouveau - distro free builtin

To view nvidia drivers:

nvidia-smi

If the following contents are displayed, the installation is successful. You can see the model of our graphics card. Mine is GeForce GTX 750, including the size of the video memory.

nvidia-settings

If this interface appears, you can see NVIDIA Driver Version: 470.74, which means NVIDIA setting is installed normally.

It's that simple, so when it comes to conflict with the system, reinstalling the system may be the fastest and most worry-free way.

Posted by breadcom on Tue, 02 Nov 2021 11:03:25 -0700