Ubuntu 22.04 with RTX 4090 unable to boot with 5xx drivers

After installing any 5xx version of Nvidia drivers Ubuntu 22.04 freezes with a gray screen during booting.

I tested multiple versions - at least 520,530 and 535 on a fresh install.

I also tried Ubuntu 23.04 where the installation can be made only with the safe graphics option or the screen will freeze. It had the same behavior as 22.04 once Nvidia drivers were installed.

I also tried Pop OS where the installer froze and CentOS Stream 9 which installed and froze with gray screen at boot after installing the drivers.

I attached the diagnose information after booting in recovery mode.

The last time I used Ubuntu was a few months ago when the drivers were around 460 and didn’t have this problem. The computer is working without any issues in Windows.

nvidia-bug-report.log.gz (471.2 KB)

I had this problem with nvidia drivers for years. Try blacklisting nuoveau in the kernel params. Smash esc during boot(after POST) and if you are in grub press e. Add this line:
GRUB_CMDLINE_LINUX_DEFAULT="nouveau.modeset=0"
Try to see if it works.

Thanks for the suggestion.

I added the option at the end of config (see attachment) and it still froze while booting.

Nouveau drivers are working for me - at low resolution but I can boot with them. The OS fails to boot once I install Nvidia drivers.

I’m very sorry I gave bad advice. I basically mixed up editing the grub file with editing in the bootloader.
After pressing e add to the parameter to the end of the line what starts with linux, usually looks like this(your screen is cutoff):
linux /boot/vmlinuz-5-19... root=UUID=XXXX rw and add nouveau.modeset=0
Or if you can boot into safe mode, you can edit the /etc/default/grub where you will find the line starting with GRUB_CMDLINE_LINUX_DEFAULT

No need to be sorry. Any advice or idea is appreciated.

I already spent a few evenings trying to debug it before posting :)

I add the option not to load nouveau drivers and it still freezes.

This is what I had in grub and I also executed update-grub before rebooting.

GRUB_CMDLINE_LINUX_DEFAULT=“quiet splash nouveau.modeset=0”

I captured a new bug report after reboot.

nvidia-bug-report_1.log.gz (311.7 KB)

I went again through the bug report which gave me an idea.

The video card is using 2 of the HDMI ports and is connect to display + TV. The logs mentioned it chose a 'default" display. I removed the cable connecting to TV, leaving only the one for the display, and it booted.

Now the question is how do I force the driver to start with a particular display?

Thats great you have a lead. I figured it would boot on the connected display by default. Never thought that such a trivial problem can cause this, on a “supported” distro like ubuntu.
Have you tried using all the ports once? Maybe there is something that confuses the driver when multiple displays are connected instead of one during boot.

I don’t have 4 displays to use all the ports at once :D

Two are common for a development machine and it still doesn’t work with more than one.

If I boot with 2 and get to the screen where it stops it’s enough to remove one of the cables and the boot process completes.

I tried by connecting the second one after booting and set the display mode to “single display” with default being the one I want to use. There was no change and it failed to boot after restart

I build in for a few days a new 4090 on my KDE Neon (Ubuntu 22.04), works here out of the box. Here my config, maybe it can help you:

Kernel 5.19.0-45-generic
Nvidia Driver from Ubunturepository 530.41.03 (installed with “ubuntu-drivers” via CLI"

Xorg:

cat /etc/X11/xorg.conf.d/20-nvidia.conf                                                                                                           130 ↵
Section "OutputClass"
    Identifier  "nvidia"
    MatchDriver "nvidia-drm"
    Driver      "nvidia"
    Option "TripleBuffer" "True"
    Option "AllowEmptyInitialConfiguration"
    ModulePath "/usr/lib/x86_64-linux-gnu/nvidia/xorg"
    Option "metamodes" "5120x1440 { ForceFullCompositionPipeline = On }"
EndSection

Maybe it works with 2 displays but not when you have one display one TV.

My Xorg configuration is in /etc/X11/xorg.conf and very similar with yours.

I found a solution that seems to work.

I launched nvidia-settings from terminal, disabled the TV and tried to save to the X configuration file. That was completely broken by failing to merge the new configuration with the existing one. There is a show preview option from where I exported the configuration and manually appended to the existing one.

The reboot is now working and the setting to disable the TV was lost. It’s all looking good.

This is the additional configuration

# nvidia-settings:  version 510.47.03

Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0" 0 0
    InputDevice    "Keyboard0" "CoreKeyboard"
    InputDevice    "Mouse0" "CorePointer"
    Option         "Xinerama" "0"
EndSection

Section "Files"
EndSection

Section "InputDevice"
    # generated from default
    Identifier     "Mouse0"
    Driver         "mouse"
    Option         "Protocol" "auto"
    Option         "Device" "/dev/psaux"
    Option         "Emulate3Buttons" "no"
    Option         "ZAxisMapping" "4 5"
EndSection

Section "InputDevice"
    # generated from default
    Identifier     "Keyboard0"
    Driver         "kbd"
EndSection

Section "Monitor"
    # HorizSync source: edid, VertRefresh source: edid
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "Dell AW3423DWF"
    HorizSync       285.0 - 285.0
    VertRefresh     48.0 - 165.0
    Option         "DPMS"
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "NVIDIA GeForce RTX 4090"
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    Option         "Stereo" "0"
    Option         "nvidiaXineramaInfoOrder" "DFP-3"
    Option         "metamodes" "DP-2: nvidia-auto-select +0+0"
    Option         "SLI" "Off"
    Option         "MultiGPU" "Off"
    Option         "BaseMosaic" "off"
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection