Black screen post installation of nvidia RTX 4050 drivers on ubuntu 22.04.4

I have recently installed ubutnu22.04.4 in a dual boot setup with Windows on Dell XPS 16 9640. I didn’t install nvidia drivers during the installation setup and only did minimal setup. I was able to boot and login normally during the first run. I updates the sources and upgraded all the packages.

$ uname -a
Linux loki 6.5.0-35-generic #35~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue May  7 09:00:52 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
$ uname -r
6.5.0-35-generic

Since the machine has NVIDIA GeForce RTX 4050 Laptop GPU, I decided to install the required drivers.

$ lspci
00:00.0 Host bridge: Intel Corporation Device 7d01 (rev 04)
00:01.0 PCI bridge: Intel Corporation Device 7ecc (rev 10)
00:02.0 VGA compatible controller: Intel Corporation Device 7d55 (rev 08)
00:04.0 Signal processing controller: Intel Corporation Device 7d03 (rev 04)
00:05.0 Multimedia controller: Intel Corporation Device 7d19 (rev 04)
00:06.0 PCI bridge: Intel Corporation Device 7e4d (rev 20)
00:06.2 PCI bridge: Intel Corporation Device 7ecb (rev 10)
00:07.0 PCI bridge: Intel Corporation Device 7ec4 (rev 10)
00:07.1 PCI bridge: Intel Corporation Device 7ec5 (rev 10)
00:07.3 PCI bridge: Intel Corporation Device 7ec7 (rev 10)
00:08.0 System peripheral: Intel Corporation Device 7e4c (rev 20)
00:0a.0 Signal processing controller: Intel Corporation Device 7d0d (rev 01)
00:0b.0 Processing accelerators: Intel Corporation Device 7d1d (rev 04)
00:0d.0 USB controller: Intel Corporation Device 7ec0 (rev 10)
00:0d.2 USB controller: Intel Corporation Device 7ec2 (rev 10)
00:0d.3 USB controller: Intel Corporation Device 7ec3 (rev 10)
00:12.0 Serial controller: Intel Corporation Device 7e45 (rev 20)
00:14.0 USB controller: Intel Corporation Device 7e7d (rev 20)
00:14.2 RAM memory: Intel Corporation Device 7e7f (rev 20)
00:15.0 Serial bus controller: Intel Corporation Device 7e78 (rev 20)
00:15.2 Serial bus controller: Intel Corporation Device 7e7a (rev 20)
00:16.0 Communication controller: Intel Corporation Device 7e70 (rev 20)
00:19.0 Serial bus controller: Intel Corporation Device 7e50 (rev 20)
00:19.1 Serial bus controller: Intel Corporation Device 7e51 (rev 20)
00:1c.0 PCI bridge: Intel Corporation Device 7e38 (rev 20)
00:1f.0 ISA bridge: Intel Corporation Device 7e02 (rev 20)
00:1f.3 Audio device: Intel Corporation Device 7e28 (rev 20)
00:1f.4 SMBus: Intel Corporation Device 7e22 (rev 20)
00:1f.5 Serial bus controller: Intel Corporation Device 7e23 (rev 20)
01:00.0 3D controller: NVIDIA Corporation Device 28a1 (rev a1)
02:00.0 Non-Volatile memory controller: SK hynix Device 1d59 (rev 03)
03:00.0 Network controller: Intel Corporation Device 272b (rev 1a)
ac:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. RTS5260 PCI Express Card Reader (rev 01)

$ nvidia-detector 
nvidia-driver-545

$ ubuntu-drivers list
nvidia-driver-535, (kernel modules provided by linux-modules-nvidia-535-generic-hwe-22.04)
nvidia-driver-535-server-open, (kernel modules provided by linux-modules-nvidia-535-server-open-generic-hwe-22.04)
nvidia-driver-545, (kernel modules provided by nvidia-dkms-545)
nvidia-driver-535-server, (kernel modules provided by linux-modules-nvidia-535-server-generic-hwe-22.04)
nvidia-driver-545-open, (kernel modules provided by nvidia-dkms-545-open)
nvidia-driver-535-open, (kernel modules provided by linux-modules-nvidia-535-open-generic-hwe-22.04)

Installed drivers using ubuntu-drivers autoinstall command which installs nvidia-driver-535. Post installation before the boot I was able to validate running nvidia-smi

$ nvidia-smi
Wed Jun  5 16:53:37 2024       
+---------------------------------------------------------------------------------------+
| NVIDIA-SMI 535.171.04             Driver Version: 535.171.04   CUDA Version: 12.2     |
|-----------------------------------------+----------------------+----------------------+
| GPU  Name                 Persistence-M | Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp   Perf          Pwr:Usage/Cap |         Memory-Usage | GPU-Util  Compute M. |
|                                         |                      |               MIG M. |
|=========================================+======================+======================|
|   0  NVIDIA GeForce RTX 4050 ...    Off | 00000000:01:00.0 Off |                  N/A |
| N/A   38C    P8               2W /  40W |      0MiB /  6141MiB |      0%      Default |
|                                         |                      |                  N/A |
+-----------------------------------------+----------------------+----------------------+
                                                                                         
+---------------------------------------------------------------------------------------+
| Processes:                                                                            |
|  GPU   GI   CI        PID   Type   Process name                            GPU Memory |
|        ID   ID                                                             Usage      |
|=======================================================================================|
|  No running processes found                                                           |
+---------------------------------------------------------------------------------------+

Post nvidia driver installation when system rebooted, post grub menu it get stuck on the black screen with _ blinking. I logged into cli by Alt+ctrl+F1/F2/F6 and tried to debug the problem but since I its my first time installing it, I was bit unsure about the next steps. I managed to run nvidia-bug-report and attached the result to this topic.
nvidia-bug-report.log.gz (374.5 KB)

Only after purging the installed drivers I was able to boot the machine normally.

Additionally I’ve tried

  • Install different versions of drivers(535/545/550) - same result - stuck in black screen.
  • Install graphic drivers manually by downloading from Nvidia. - same result - stuck in black screen.
  • disable nouveau from by modifying modprobe.d/blacklist / updating the GRUB_CMDLINE_LINUX_DEFAULT="nouveau.blacklist=1" in the /etc/default/grub

I am setting this up for the first time so please let me know if I’m making any noobie mistake.

The issue isn’t the nvidia gpu, it’s the only device working. The real issue is the intel cpu, igpu, sound, webcam. For this you will need the latest kernel and firmware. Ubuntu 22.04 is too old, won’t work. Please reinstall using 24.04, then add the liquorix ppa to get the latest kernel. For sound and webcam, please see this thread: https://forums.developer.nvidia.com/t/xps16-ubuntu-24-04-nvidia-ha-not-working/293380/4?u=generix

You can try this to get the Intel GPU working in 22.04, but as generix said, you really should have installed 24.04 for a laptop this new:

echo "options i915 force_probe=7d55" | sudo tee -a /etc/modprobe.d/i915.conf
sudo update-pciids && sudo update-initramfs -u -k all

The firmware packages for 22.04 are quite old, so I doubt this will work at all without greater effort.

Ubuntu 22.04 should have the Meteor Lake firmware: Bug #2036697 “i915: Update DMC, GuC, HuC fw for Meteor Lake” : Bugs : linux-firmware package : Ubuntu

Thank you for the feedback @generix & @7ob5qqd7m. I’ve already tried 24.04 in the past and had no troubles installing graphic drivers. I just wanted to try 22.04.4 for certain softwares which are build and suppose to run on specific version.

With a lot of struggle I made it

irei te passar o passo a passo do que fiz

primeiro desinstalei todos os driver no modo recuperação no grub

sudo apt remove --purge nvidia*

logo depois

instalei o nvidia-settings

“sudo apt install nvidia-settings”

Importante (não instale os driver nvidia ainda)

agora instale somente o driver gráfico intel no meu caso.

“sudo add-apt-repository ppa:oibaf/graphics-drivers”

“sudo apt update && sudo apt upgrade -y”

“sudo reboot”

depois instale
“sudo apt install mesa-utils”

depois forcei o driver intel no wayland

“sudo nano /etc/default/grub”

localize a linha que começa com “GRUB_CMDLINE_LINUX_DEFAULT”

e adicione: i915.modeset=1

vai ficar assim: "GRUB_CMDLINE_LINUX_DEFAULT=“quiet splash i915.modeset=1”

depois salve e saia e use o comando

“sudo update-grub”

“sudo reboot”

nesse ponto você pode verificar se está reconhecendo sua placa de vídeo integrada

com esse comando

"lspci -k | grep -EA3 ‘VGA|3D’
glxinfo | grep “OpenGL renderer”

Now let’s install the nvidia driver
“sudo ubuntu-drivers autoinstall”
“sudo reboot”

Now we’ll be back

“sudo nano /etc/default/grub”

Locate the line that starts with “GRUB_CMDLINE_LINUX_DEFAULT”

Change to
"GRUB_CMDLINE_LINUX_DEFAULT=“quiet splash nvidia-drm.modeset=1"”
Save and exit

“sudo update-grub”

“sudo reboot”

after
“Sudo Prime-Select Nvidia”
“sudo reboot”