0

Problem

I want to install nvidia driver in my laptop. My laptop is always stuck on blackscreen after installing nvidia driver and executing reboot. I have tried tried different approaches and many nvidia driver versions. However, the problem is always here.

My ubuntu18.04 has two kernel 5.4.0-122 and 5.4.0-117. I installed nvidia driver by software update. Then the output is normal after executing nvidia-smi. But when I reboot my laptop, a probelm appearred. If I choose 5.4.0-122 kernel, the laptop will be stuck in black screen. If I choose 5.4.0-117 kernel, NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running will appear in shell after executing nvidia-smi.

I will describe below some key information about my laptop. Hope someone could help me with this perplexing problem. Thanks!

My laptop information

  • sudo lshw -class video
 *-display UNCLAIMED
       description: 3D controller
       product: GP107M [GeForce GTX 1050 Mobile]
       vendor: NVIDIA Corporation
       physical id: 0
       bus info: pci@0000:01:00.0
       version: a1
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress bus_master cap_list
       configuration: latency=0
       resources: memory:de000000-deffffff memory:c0000000-cfffffff memory:d0000000-d1ffffff ioport:e000(size=128) memory:df000000-df07ffff
  *-display
       description: VGA compatible controller
       product: Intel Corporation
       vendor: Intel Corporation
       physical id: 2
       bus info: pci@0000:00:02.0
       version: 04
       width: 64 bits
       clock: 33MHz
       capabilities: pciexpress msi pm vga_controller bus_master cap_list rom
       configuration: driver=i915 latency=0
       resources: irq:131 memory:dd000000-ddffffff memory:b0000000-bfffffff ioport:f000(size=64) memory:c0000-dffff

Installation approaches

Preparation before installation

Disable secure boot and disable the system's own Nouveau graphics card driver

Installation

Add ppa source

Open Software Update --> Additional Programs --> Click on one of the drivers to install it --> Finish the installation --> reboot In addition, I tried nvidia-driver-515, nvidia-driver-510, nvidia-driver-470, nvidia-driver-418 and nvidia-driver-390.

Problem solution

I have tried Fixing Ubuntu Freezing at Boot Time, but it does not work.

  • 3
    Search this site for documentation on how to install Nvidia drivers. You don't need any PPAs to get any of those drivers youi mentioned (515 is the "tested' one you should use). You biggest task at this point is cleaning out whatever you did and starting clean. – ubfan1 Jul 04 '22 at 15:17
  • 1
    And after cleaning up, install the driver properly and disable Secure Boot in UEFI. – ChanganAuto Jul 04 '22 at 15:59
  • I tried How to install Nvidia driver in Ubuntu 18.04. My laptop is stuck on balck screen now. By the way, I disabled Secure Boot in UEFI at the beginning and I always clean out whatever I installed before trying a new dirver. – ZhiHeng Feng Jul 05 '22 at 02:11
  • @ubfan1 I choose a lower version of the kernel 5.4.0-117-generic, then I can enter my latptop. But the output after executing nvidia-smi is: NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running. I found a similar question Ubuntu 18.04.3 LTS kernel 5.0.0-25-generic nvidia driver 440 not working with graphics card model GP107M GeForce GTX 1050 Mobile – ZhiHeng Feng Jul 05 '22 at 03:02
  • lsmod is a command, not ls mod . I think you should see the nouveau driver listed. Haven't run 18.04 in awhile, but was running the 5.4 kernel on 20.04 with the 510 driver until recently (before the 515 driver was available). Pretty sure no PPA should be necessary. You will need the linux-headers for your kernel to build the nvidia driver. update-drivers or the "software and updates" icon/additional drivers tab should offer the nvidia drivers, select the latest "tested" one. Remove any "nomodeset" you might have added in /etc/default/grub then reboot. – ubfan1 Jul 05 '22 at 04:44
  • The output is normal after executing nvidia-smi. But when I reboot my laptop, there is still the problem. If I choose 5.4.0-122 kernel, the laptop will be stuck in black screen. If I choose 5.4.0-117 kernel, NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running will appear again after after executing nvidia-smi. – ZhiHeng Feng Jul 05 '22 at 16:21
  • @karel Thanks a lot, but the problem above still exists. I prepare to install ubuntu20.04. – ZhiHeng Feng Jul 06 '22 at 07:43
  • @ubfan1, thanks for your help. I will reinstall my OS. If it does work, I will update my question and make a conclusion. – ZhiHeng Feng Jul 06 '22 at 07:46
  • @ZhiHengFeng The most important thing to remember if you reinstall the OS is the let sudo ubuntu-drivers autoinstall automatically choose the correct graphics drivers for you so that everything will work right. – karel Jul 06 '22 at 07:52

1 Answers1

0

I reinsatll my OS from ubuntu18.04 to ubuntu20.04. The thing become simple. I install nvidia driver just from the "software and updates/additional drivers" and select the latest "tested" one. It works!