Need help installing nvidia drivers (black boot screen instead of desktop)

Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
provanguard
Level 1
Level 1
Posts: 11
Joined: Tue Jun 15, 2021 5:17 pm

Need help installing nvidia drivers (black boot screen instead of desktop)

Post by provanguard »

Hello,
I am having issues with installing nvidia drivers. I need them to be active on my laptop. Every attempt ends with black screen on boot up and need to revert to nouveau drivers. Here are some details from my machine:

Code: Select all

inxi -b
System:
  Host: xyz-mint Kernel: 5.4.0-52-generic x86_64 bits: 64 
  Desktop: Cinnamon 4.6.7 Distro: Linux Mint 20 Ulyana 
Machine:
  Type: Laptop System: LENOVO product: 20J60014MD v: ThinkPad T470p 
  serial: <superuser/root required> 
  Mobo: LENOVO model: 20J60014MD v: SDK0J4xxx WIN 
  serial: <superuser/root required> UEFI: LENOVO v: R0FET53W (1.33 ) 
  date: 07/17/2020 
Battery:
  ID-1: BAT0 charge: 60.7 Wh condition: 62.1/71.3 Wh (87%) 
CPU:
  Quad Core: Intel Core i7-7700HQ type: MT MCP speed: 3441 MHz 
  min/max: 800/3800 MHz 
Graphics:
  Device-1: Intel HD Graphics 630 driver: i915 v: kernel 
  Device-2: NVIDIA GM108M [GeForce 940MX] driver: nouveau v: kernel 
  Display: x11 server: X.Org 1.20.9 driver: modesetting unloaded: fbdev,vesa 
  resolution: 1600x900~60Hz 
  OpenGL: renderer: Mesa Intel HD Graphics 630 (KBL GT2) v: 4.6 Mesa 20.2.6 
Network:
  Device-1: Intel Ethernet I219-V driver: e1000e 
  Device-2: Intel Wireless 8265 / 8275 driver: iwlwifi 
Drives:
  Local Storage: total: 476.94 GiB used: 42.11 GiB (8.8%) 
Info:
  Processes: 273 Uptime: N/A Memory: 31.11 GiB used: 1.79 GiB (5.7%) 
  Shell: bash inxi: 3.0.38 
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
gittiest personITW
Level 12
Level 12
Posts: 4289
Joined: Tue May 28, 2019 4:27 pm

Re: Need help installing nvidia drivers

Post by gittiest personITW »

Welcome to the forums.

It might be worth your while installing the 5.8 kernel.
Do a Timeshift snapshot before doing it.

Do you know how to do both of those things?
provanguard
Level 1
Level 1
Posts: 11
Joined: Tue Jun 15, 2021 5:17 pm

Re: Need help installing nvidia drivers

Post by provanguard »

I have not used this snapshotting tool before, but I should be able to figure it out. I used clonezilla for linux systems.

But most importantly, my assumption is that newer kernels are usually not stable and break things, especially for the nvidia drivers.
Wouldn't a recent patch version of 5.4 kernel be most stable and compatible? Do you have any references to indicate that with 5.8 will just work?
I suspect there could be some issues with the dual graphic card layout and/or missing or wrong configuration settings in some places, which I am oblivious to.

I can provide you with more output from commands you are interested in me running on the machine.
gittiest personITW
Level 12
Level 12
Posts: 4289
Joined: Tue May 28, 2019 4:27 pm

Re: Need help installing nvidia drivers

Post by gittiest personITW »

Timeshift can be thought of as similar to System Restore on Windows.
It is important to either put the snapshots onto a different partition, or if you can, a different drive as if something goes wrong with your main hard drive you can restore quite easily (bear in mind that documents/photos are not backed up with Timeshift), or set the snapshots to be created only manually as there have been many problems where snapshots fill up the system drive causing a problem (this is the only downside - hence the warning).

If you install a different kernel and it doesn't work, you can get back into GRUB just after boot and boot back into your previous kernel. Yes, newer kernels have their upsides and their downsides but sometimes with newer hardware it is worth upgrading.

As with anything make sure your main data (docs/pics) are backed up to external drives that aren't plugged in all the time. At least 2 of them.

If you need more details on how to get this to work, post back.
Post back with the result anyway as it might help someone else with the same problem/hardware.
provanguard
Level 1
Level 1
Posts: 11
Joined: Tue Jun 15, 2021 5:17 pm

Re: Need help installing nvidia drivers

Post by provanguard »

If you don't mind, I would like some details of how to get the nvidia driver to install and work properly with any 5.4 version of the kernel. This was the kernel version with which Mint 20 was released. Nvidia drivers worked right after the initial installation. With subsequent recommended updates (kernel, packages) the nvidia drivers got broken.

Can you help? Can we focus on the details that need to be in place for this to work?

Update: Any nvidia driver version higher or equal to 440 is fine for me. But the newer the better.
gittiest personITW
Level 12
Level 12
Posts: 4289
Joined: Tue May 28, 2019 4:27 pm

Re: Need help installing nvidia drivers (black boot screen instead of desktop)

Post by gittiest personITW »

I am sure someone on this forum who has more experience with nvidia drivers will pitch in.
provanguard
Level 1
Level 1
Posts: 11
Joined: Tue Jun 15, 2021 5:17 pm

Re: Need help installing nvidia drivers (black boot screen instead of desktop)

Post by provanguard »

Hence, I still need help on this issue.
Anyone on the forum who knows how to correctly install and configure the nvidia driver on a laptop with intel and nvidia graphic cards, on Mint 20?
User avatar
roblm
Level 15
Level 15
Posts: 5939
Joined: Sun Feb 24, 2013 2:41 pm

Re: Need help installing nvidia drivers (black boot screen instead of desktop)

Post by roblm »

You need to install the Nvidia driver again and then post the output of this command:

Code: Select all

inxi -Gx; echo +; lspci -nnk | grep -EA3 "3D|VGA"; echo +; ls /lib/modprobe.d/; echo +; dpkg -l | grep nvidia; echo +; mokutil --sb-state
provanguard
Level 1
Level 1
Posts: 11
Joined: Tue Jun 15, 2021 5:17 pm

Re: Need help installing nvidia drivers (black boot screen instead of desktop)

Post by provanguard »

I would like to try that. But...
When I install the nvidia driver, using the Driver Manager window, and reboot the PC, I never get back to desktop, because something is broken. In what mode should I execute the above command? Is it recovery mode of the same kernel version as the one where nvidia was installed?
User avatar
roblm
Level 15
Level 15
Posts: 5939
Joined: Sun Feb 24, 2013 2:41 pm

Re: Need help installing nvidia drivers (black boot screen instead of desktop)

Post by roblm »

Oops! You mentioned that in your first post. At the black screen, try pressing Ctrl+Alt+F1 to enter virtual console tty1. Use this command:

Code: Select all

{ inxi -Gx; lspci -nnk | grep -EA3 "3D|VGA"; ls /lib/modprobe.d/; dpkg -l | grep nvidia; } > log.txt
This will create a file named log.txt in your Home directory.
Remove the Nvidia driver. When you get to the desktop, use this command to open the log.txt file and post it’s contents: cat log.txt

Also, post the output of mokutil --sb-state

If you can't enter tty1, then select Advanced options > Recovery Mode at the GRUB boot menu. If no menu shows, then hold down the Shift key while starting, or keep tapping it, or tap the Esc key. In the menu, select “root - drop to root shell prompt ” and press ENTER. Press ENTER again.

Use this command to change the file permissions to read and write: mount -o remount,rw /
provanguard
Level 1
Level 1
Posts: 11
Joined: Tue Jun 15, 2021 5:17 pm

Re: Need help installing nvidia drivers (black boot screen instead of desktop)

Post by provanguard »

Thank you for very detail instructions. I hope you can tell what's wrong by looking at the outputs:

Code: Select all

Graphics:  Device-1: Intel HD Graphics 630 vendor: Lenovo driver: i915 v: kernel bus ID: 00:02.0 
           Device-2: NVIDIA GM108M [GeForce 940MX] vendor: Lenovo driver: nvidia v: 460.80 bus ID: 02:00.0 
           Display: server: X.org 1.20.9 driver: nvidia tty: 320x90 
           Message: Advanced graphics data unavailable in console. Try -G --display 
00:02.0 VGA compatible controller [0300]: Intel Corporation HD Graphics 630 [8086:591b] (rev 04)
	Subsystem: Lenovo HD Graphics 630 [17aa:505e]
	Kernel driver in use: i915
	Kernel modules: i915
--
02:00.0 3D controller [0302]: NVIDIA Corporation GM108M [GeForce 940MX] [10de:134d] (rev a2)
	Subsystem: Lenovo GM108M [GeForce 940MX] [17aa:5050]
	Kernel driver in use: nvidia
	Kernel modules: nvidiafb, nouveau, nvidia_drm, nvidia
aliases.conf
blacklist_linux_5.4.0-26-generic.conf
blacklist_linux_5.4.0-52-generic.conf
fbdev-blacklist.conf
nvidia-graphics-drivers.conf
systemd.conf
ii  libnvidia-cfg1-460:amd64                                    460.80-0ubuntu0.20.04.2                                     amd64        NVIDIA binary OpenGL/GLX configuration library
ii  libnvidia-common-440                                        450.119.03-0ubuntu0.20.04.1                                 all          Transitional package for libnvidia-common-450
ii  libnvidia-common-450                                        460.80-0ubuntu0.20.04.2                                     all          Transitional package for libnvidia-common-460
ii  libnvidia-common-460                                        460.80-0ubuntu0.20.04.2                                     all          Shared files used by the NVIDIA libraries
ii  libnvidia-compute-440:i386                                  450.119.03-0ubuntu0.20.04.1                                 i386         Transitional package for libnvidia-compute-450
rc  libnvidia-compute-450:amd64                                 460.80-0ubuntu0.20.04.2                                     amd64        Transitional package for libnvidia-compute-460
ii  libnvidia-compute-450:i386                                  460.80-0ubuntu0.20.04.2                                     i386         Transitional package for libnvidia-compute-460
ii  libnvidia-compute-460:amd64                                 460.80-0ubuntu0.20.04.2                                     amd64        NVIDIA libcompute package
ii  libnvidia-compute-460:i386                                  460.80-0ubuntu0.20.04.2                                     i386         NVIDIA libcompute package
ii  libnvidia-decode-440:i386                                   450.119.03-0ubuntu0.20.04.1                                 i386         Transitional package for libnvidia-decode-450
ii  libnvidia-decode-450:i386                                   460.80-0ubuntu0.20.04.2                                     i386         Transitional package for libnvidia-decode-460
ii  libnvidia-decode-460:amd64                                  460.80-0ubuntu0.20.04.2                                     amd64        NVIDIA Video Decoding runtime libraries
ii  libnvidia-decode-460:i386                                   460.80-0ubuntu0.20.04.2                                     i386         NVIDIA Video Decoding runtime libraries
ii  libnvidia-encode-440:i386                                   450.119.03-0ubuntu0.20.04.1                                 i386         Transitional package for libnvidia-encode-450
ii  libnvidia-encode-450:i386                                   460.80-0ubuntu0.20.04.2                                     i386         Transitional package for libnvidia-encode-460
ii  libnvidia-encode-460:amd64                                  460.80-0ubuntu0.20.04.2                                     amd64        NVENC Video Encoding runtime library
ii  libnvidia-encode-460:i386                                   460.80-0ubuntu0.20.04.2                                     i386         NVENC Video Encoding runtime library
ii  libnvidia-extra-460:amd64                                   460.80-0ubuntu0.20.04.2                                     amd64        Extra libraries for the NVIDIA driver
ii  libnvidia-fbc1-440:i386                                     450.119.03-0ubuntu0.20.04.1                                 i386         Transitional package for libnvidia-fbc1-450
ii  libnvidia-fbc1-450:i386                                     460.80-0ubuntu0.20.04.2                                     i386         Transitional package for libnvidia-fbc1-460
ii  libnvidia-fbc1-460:amd64                                    460.80-0ubuntu0.20.04.2                                     amd64        NVIDIA OpenGL-based Framebuffer Capture runtime library
ii  libnvidia-fbc1-460:i386                                     460.80-0ubuntu0.20.04.2                                     i386         NVIDIA OpenGL-based Framebuffer Capture runtime library
ii  libnvidia-gl-440:i386                                       450.119.03-0ubuntu0.20.04.1                                 i386         Transitional package for libnvidia-gl-450
ii  libnvidia-gl-450:i386                                       460.80-0ubuntu0.20.04.2                                     i386         Transitional package for libnvidia-gl-460
ii  libnvidia-gl-460:amd64                                      460.80-0ubuntu0.20.04.2                                     amd64        NVIDIA OpenGL/GLX/EGL/GLES GLVND libraries and Vulkan ICD
ii  libnvidia-gl-460:i386                                       460.80-0ubuntu0.20.04.2                                     i386         NVIDIA OpenGL/GLX/EGL/GLES GLVND libraries and Vulkan ICD
ii  libnvidia-ifr1-440:i386                                     450.119.03-0ubuntu0.20.04.1                                 i386         Transitional package for libnvidia-ifr1-450
ii  libnvidia-ifr1-450:i386                                     460.80-0ubuntu0.20.04.2                                     i386         Transitional package for libnvidia-ifr1-460
ii  libnvidia-ifr1-460:amd64                                    460.80-0ubuntu0.20.04.2                                     amd64        NVIDIA OpenGL-based Inband Frame Readback runtime library
ii  libnvidia-ifr1-460:i386                                     460.80-0ubuntu0.20.04.2                                     i386         NVIDIA OpenGL-based Inband Frame Readback runtime library
rc  nvidia-compute-utils-440                                    440.100-0ubuntu0.20.04.1                                    amd64        NVIDIA compute utilities
rc  nvidia-compute-utils-450                                    450.66-0ubuntu0.20.04.1                                     amd64        NVIDIA compute utilities
ii  nvidia-compute-utils-460                                    460.80-0ubuntu0.20.04.2                                     amd64        NVIDIA compute utilities
rc  nvidia-dkms-440                                             440.100-0ubuntu0.20.04.1                                    amd64        NVIDIA DKMS package
rc  nvidia-dkms-450                                             450.66-0ubuntu0.20.04.1                                     amd64        NVIDIA DKMS package
ii  nvidia-dkms-460                                             460.80-0ubuntu0.20.04.2                                     amd64        NVIDIA DKMS package
ii  nvidia-driver-460                                           460.80-0ubuntu0.20.04.2                                     amd64        NVIDIA driver metapackage
rc  nvidia-kernel-common-440                                    440.100-0ubuntu0.20.04.1                                    amd64        Shared files used with the kernel module
rc  nvidia-kernel-common-450                                    450.66-0ubuntu0.20.04.1                                     amd64        Shared files used with the kernel module
ii  nvidia-kernel-common-460                                    460.80-0ubuntu0.20.04.2                                     amd64        Shared files used with the kernel module
ii  nvidia-kernel-source-460                                    460.80-0ubuntu0.20.04.2                                     amd64        NVIDIA kernel source package
ii  nvidia-prime                                                0.8.16~0.20.04.1                                            all          Tools to enable NVIDIA's Prime
ii  nvidia-prime-applet                                         1.2.7                                                       all          An applet for NVIDIA Prime
ii  nvidia-settings                                             460.73.01-0ubuntu0.20.04.1                                  amd64        Tool for configuring the NVIDIA graphics driver
ii  nvidia-utils-460                                            460.80-0ubuntu0.20.04.2                                     amd64        NVIDIA driver support binaries
ii  screen-resolution-extra                                     0.18build1                                                  all          Extension for the nvidia-settings control panel
ii  xserver-xorg-video-nvidia-460                               460.80-0ubuntu0.20.04.2                                     amd64        NVIDIA binary Xorg driver

Code: Select all

SecureBoot disabled
User avatar
roblm
Level 15
Level 15
Posts: 5939
Joined: Sun Feb 24, 2013 2:41 pm

Re: Need help installing nvidia drivers (black boot screen instead of desktop)

Post by roblm »

Try this easy method first. It is usually used to correct a problem with the Nvidia driver not loading after an installation, but in two recent topics, it corrected a black screen after Nvidia driver installation problem in laptops, but they did not have hybrid graphics.

viewtopic.php?p=1895521#p1895521
provanguard
Level 1
Level 1
Posts: 11
Joined: Tue Jun 15, 2021 5:17 pm

Re: Need help installing nvidia drivers (black boot screen instead of desktop)

Post by provanguard »

I just tried that method of adding these 3 lines, but it did not help. The output from the command you provided earlier was identical.

Code: Select all

nvidia 
nvidia-drm
nvidia-modeset
I did not do this step:

Code: Select all

sudo update-initramfs -u
Is it possible that something fails with relation to this step when using standard installation, due to fx small size of the boot partition? I have dual boot with Windows, and I suspect the boot partition is reused.
User avatar
roblm
Level 15
Level 15
Posts: 5939
Joined: Sun Feb 24, 2013 2:41 pm

Re: Need help installing nvidia drivers (black boot screen instead of desktop)

Post by roblm »

When you get the black screen, use these commands to upload the Xorg.0.log & dmesg log to terminal.com pastebin:

Code: Select all

cat /var/log/Xorg.0.log | nc termbin.com 9999 
dmesg -T | nc termbin.com 9999
Copy the URL addresses and post them when you get back to the desktop.

If you have to enter Recovery Mode, then you must enable networking first in the menu.
User avatar
SMG
Level 25
Level 25
Posts: 31324
Joined: Sun Jul 26, 2020 6:15 pm
Location: USA

Re: Need help installing nvidia drivers

Post by SMG »

provanguard wrote: Wed Jun 16, 2021 3:24 amWouldn't a recent patch version of 5.4 kernel be most stable and compatible?
Your inxi information indicates you are running Kernel: 5.4.0-52-generic while the most recent version available is 5.4.0-74.

There have been recent updates to the Nvidia driver files available through Driver Manager. If you are not running the most recent patched version of the 5.4 kernel, perhaps that might be a reason there is an issue.
Image
A woman typing on a laptop with LM20.3 Cinnamon.
provanguard
Level 1
Level 1
Posts: 11
Joined: Tue Jun 15, 2021 5:17 pm

Re: Need help installing nvidia drivers (black boot screen instead of desktop)

Post by provanguard »

Here are the requested results:

Kernel: 5.4.0-52-generic:

nvidia-driver-390 (390.143-0ubuntu0.20.04.1):
https://termbin.com/ddna
https://termbin.com/5sfo

nvidia-driver-460 (460.80-0ubuntu0.20.04.2):
https://termbin.com/lwb5
https://termbin.com/v1xd

Kernel: 5.4.0-74-generic:

nvidia-driver-460 (460.80-0ubuntu0.20.04.2):
https://termbin.com/ffal
https://termbin.com/932f

All results are from installing the nvidia drivers using the Mint Driver Manager window. 460 is the currently recommended driver.
User avatar
roblm
Level 15
Level 15
Posts: 5939
Joined: Sun Feb 24, 2013 2:41 pm

Re: Need help installing nvidia drivers (black boot screen instead of desktop)

Post by roblm »

Remove the xorg.conf file: sudo rm /etc/X11/xorg.conf
provanguard
Level 1
Level 1
Posts: 11
Joined: Tue Jun 15, 2021 5:17 pm

Re: Need help installing nvidia drivers (black boot screen instead of desktop)

Post by provanguard »

BOOM! Desktop loaded :)

nvidia-smi is loading and showing card details. I hope this can last for couple of months at least :D
provanguard
Level 1
Level 1
Posts: 11
Joined: Tue Jun 15, 2021 5:17 pm

Re: Need help installing nvidia drivers (black boot screen instead of desktop)

Post by provanguard »

Can I ask what removing of this file did to make it work?
User avatar
roblm
Level 15
Level 15
Posts: 5939
Joined: Sun Feb 24, 2013 2:41 pm

Re: Need help installing nvidia drivers (black boot screen instead of desktop)

Post by roblm »

provanguard wrote: Wed Jun 16, 2021 4:36 pm Can I ask what removing of this file did to make it work?
On your Optimus-based laptop, the Intel GPU is driven by the modesetting driver and the Nvidia GPU by the Nvidia driver. Both need to be loaded when using Nvidia Performance mode or On-Demand mode. In Intel Power Saving mode, only the modesetting driver is loaded. The logs show only the Nvidia driver loading, and that often happens when there is an xorg.conf file. That file, when created, is usually configured for a desktop system with only Nvidia graphics and commands the system to use only the Nvidia driver.
Locked

Return to “Graphics Cards & Monitors”