Completely solve the problem that after installing the graphics card driver, Ubuntu cannot enter the graphical interface, black screen, and the cursor in the upper left corner flickers when booting

As we all know, the GUI of the Linux system does not get along well with the NVIDIA graphics card, and there will be various problems when installing the driver, which is very frustrating. After many students installed the graphics card driver on the Ubuntu physical machine equipped with NVIDIA graphics card, they restarted the computer and found that they could not enter the graphical interface. The specific performance is that the system is black screen, and the cursor is constantly blinking in the upper left corner of the screen. There are many reasons for this situation, and the essence is basically the problem that the graphical interface cannot be loaded.

Since the CPU of most computers is equipped with a core display, the author introduces a solution for computers equipped with NVIDIA independent display and intel core display. The intel core display is used as a display device for the graphical interface, and the NVIDIA independent display is only used as a calculation (CUDA) devices, so as to bypass a series of incompatibility and incompatibility problems with GNOME, LightDM and other desktop environments caused by NVIDIA graphics drivers. After all, as long as we can use CUDA, we don't know how to use graphics cards to play games.

The first step is to force shutdown and restart the computer to enter recovery mode or press Ctrl+ Alt+ F2to enter the console (tty)

The second step is to check all the graphics cards of the computer and check whether they have intel core graphics

lspci | grep VGA

According to the output information, it can be seen that the computer is indeed equipped with an integrated graphics card from Intel.

00:02.0 VGA compatible controller: Intel Corporation UHD Graphics 630 (Mobile)
01:00.0 VGA compatible controller: NVIDIA Corporation TU117M [GeForce GTX 1650 Mobile / Max-Q] (rev a1)

The beginning of each line of output is a serial number, which is the BusID of this device, which needs to be remembered and will be used later.

Check again whether the NVIDIA graphics card driver is installed successfully. This tutorial is only for the case that the NVIDIA driver is installed successfully but cannot be used for graphical interface display.

nvidia-smi

Check if CUDA is available

nvcc -V
>>> import torch
>>> torch.cuda.is_available()
True

The third step is to modify the configuration file of the desktop system Xserver /etc/X11xorg.conf,

sudo vim /etc/X11xorg.conf

Add the configuration information of the intel graphics driver at the end of the text

Section "Device"
    Identifier     "Device1"
    Driver         "intel"
    VendorName     "Intel Corporation"
    BusID          "PCI:0:2:0"
EndSection

Among them, Sectionit is used to specify the beginning of a device configuration segment, and the field named Devicerepresents a graphics device.

IdentifierIt is the identifier of the device, which can be chosen arbitrarily, as long as it does not have the same name as the existing one.

DriverUsed to tell Xserver where to load the driver of the device, VendorNameindicating the manufacturer of the device.

BusIDIndicates the BusID of the device, obtained by the above lspcicommand.

Then modify the graphics device in the screen configuration section to intel core display, and set Devicethe value of the attribute to the device identifier of the intel core display.

Section "Screen"
    Identifier     "Screen0"
    Device         "Device1"
    Monitor        "Monitor0"
    DefaultDepth    24
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

Step 4 Save and exit, restart the computer

sudo reboot

The fifth step has successfully entered the desktop, and there is no problem under normal circumstances. If the screen is torn, you need to modify the configuration section of the intel core display in the Xserver configuration file of the desktop system again, and add three options

Section "Device"
    Identifier     "Device1"
    Driver         "intel"
    VendorName     "Intel Corporation"
    Option         "TripleBuffer" "true"
    Option         "TearFree"     "true"
    Option         "DRI"          "false"
    BusID          "PCI:0:2:0"
EndSection

TripleBufferand TearFreeare used to turn on triple buffering and enable TearFree to reduce screen tearing, and DRIthe option is to turn off the underlying direct rendering function to solve some compatibility issues related to DRI.

After the configuration is complete, restart the LightDM service

sudo service lightdm restart

Supongo que te gusta

Origin blog.csdn.net/iBenzene/article/details/130818216
Recomendado
Clasificación