I cannot boot Ubuntu 22.04 after installing latest Nvidia driver

My OS is Ubuntu 22.04.2, kernel version is 6.1.0-1009-oem (I tried the default 5.19.0-40-generic and result is the same). I turned off Secure Boot in UEFI. If I select Nvidia driver using the sudo prime-select nvidia command, then I can only enter the terminal in recovery mode using Ctrl + Alt + F2, otherwise the system boots only to the black screen with the Ubuntu logo and the boot circle does not spin. dkms status and nvidia-smi commands show no problems

I have already tried the following methods:
disabling security boot
reinstalling driver 530 and reboot
installing the driver by different methods (Software & updates, .run file, terminal command)
installing nvidia-dkms-530
installing previous version of the driver
installing new version of kernel
commands sudo update-initramfs -u and sudo apt install linux-headers-$(uname -r)
removing blacklist nvidiafb line from /etc/modprobe.d/blacklist-framebuffer.conf

nvidia-bug-report.log (8.0 MB)

There seems to be something wrong with your intel igpu. Please use the liquorix ppa to update to latest kernel, remove the nvidia driver, reboot and provide a dmesg output.

I removed the nvidia driver and updated the kernel via liquorix ppa, dmesg output in the attachment
dmesg.txt (82.8 KB)

The igpu seems to work fine now, please install the 530 driver using Software&Updates now.

I installed the 530 driver (not open one) and rebooted the system and I still can’t boot. Secure Boot is disabled. I believe the problem is in the graphics mode that I can choose in the BIOS. I have Lenovo Legion 5i Pro laptop and I can choose between Dynamic Graphics and Discrete Graphics, and in the Discrete Graphics mode I can boot the system. Dynamic Graphics allows to switch between GPUs without rebooting, and since I use two systems, I’d like to keep this feature on Windows. is it possible to fix this for Ubuntu? I have attached the log of nvidia-bug-report.sh
nvidia-bug-report.log (7.6 MB)

Please delete /etc/X11/xorg.conf

I deleted /etc/X11/xorg.conf, still cannot boot in Dynamic Graphics mode. nvidia-bug-report.sh output the attachment
nvidia-bug-report.log (7.6 MB)

Can you switch to a vt when in dynamic mode and not in recovery?

No, i can’t open any terminal, I can only see some kind of log

Can you ssh into the system from another computer to create a log?

I was having similar issues, for me a driver downgrade to 470 fixed the problem.

apt list '*nvidia-driver*'
sudo apt-get purge '*nvidia*'
sudo apt install nvidia-driver-470

I connected via ssh from another computer and ran nvidia-bug-report.sh while in dynamic mode, the log in attachment
nvidia-bug-report.log (7.8 MB)

The dmesg looks fine, no errors, drivers functional. Since no X session gets started, maybe a defunct wayland session is running.
Please try disabling wayland in gdm config or check journalctl over ssh what gnome-shell is doing.

I’ve already disabled wayland before, I attach the latest journalctl output
journalctl.txt (260.2 KB)

systemd tells it started gdm but gdm does exactly nothing, not even issueing an error. No idea what’s going on. Does a dowgrade to driver 525 work?

Downgrade of the drivers didn’t help, I guess I’ll just use discrete graphics mode for Ubuntu. Using iGPU (Intel GPU in my case) in dynamic mode is also an option