Ubuntu 22.04 kernel 6.5.0-27 - Stuck on splash Screen after installing driver 565

My goals are to leverage DeepStream, GXF, TensorRT, and all the new stuff for robotics.

I am getting stuck on the Splash screen when installing the driver 565 for the RTX 4090 on Ubuntu 22.04. Below is a detailed step by step on how to install it.

The Driver 550 works but doesnt support what I need, the 560 doesnt work at all, and the 565 I had limited success and recently installs doesnt work at all.

Distribution Kernel Default GCC GLIBC
Ubuntu 22.04.z (z <= 4) LTS 6.5.0-27 12.3.0 2.35

The latest kernel version is 6.8.0-51 (at least at the moment)
You can verify by running the following command:

uname -r

Should output something like:

kernel 6.8.0-51-generic

Make sure you have secure boot disabled:

mokutil --sb-state

PART 1
Install GCC version 12.3.0
Step 1 - gcc-12 should already be installed, but if it isn’t, you can install it or reinstall it by running:

sudo apt-get install -y -qq gcc-12

or

sudo apt install --reinstall gcc-12

Step 2 - Show the location of the packages

dpkg -L <package name>
dpkg -L gcc-12

Step 3 - update the link for gcc to go to the gcc-12 binary

sudo ln -s -f /usr/bin/gcc-12 /usr/bin/gcc

Verify the version:

gcc --version

PART 2
Install GLIBC 2.35
Check the current GLIBC version

ldd --version

PART 3
Installing kernel 6.5.0-27

Step 1 - List the available images and headers, …

sudo apt list linux*-6.5.0-27-generic* | grep -v 'nvidia\|tools' 

Step 2 - Use the package manager to install

sudo apt install -y linux-headers-6.5.0-27-generic linux-image-6.5.0-27-generic linux-modules-6.5.0-27-generic linux-modules-extra-6.5.0-27-generic

Step 3 - prevent them from being updated

sudo apt-mark hold linux-headers-6.5.0-27-generic linux-image-6.5.0-27-generic linux-modules-6.5.0-27-generic linux-modules-extra-6.5.0-27-generic

PART 4
Rollback Kernel to 6.5.0-27
Step 1 - Run update Grub to list all available kernels:

sudo update-grub

Step 2 - Run the following command to get the exact line to use in /etc/default/grub:

grep 'menuentry \|submenu ' /boot/grub/grub.cfg | cut -f2 -d "'"

Step 3 - Change the GRUB_DEFAULT option in /etc/default/grub from

GRUB_DEFAULT=0
# Change to
GRUB_DEFAULT="Advanced options for Ubuntu>Ubuntu, with Linux 6.5.0-41-generic"

Step 4 - Update Grub again:

sudo update-grub

Step 5 - Reboot the machine to start using the new kernel:

sudo reboot now

Step 6 - Verify the current kernel:

uname -r

PART 5
Installing X11 and removing Nouveau
Needless to say that we must get rid of that heresy called Wayland, nouveau must go as well.

Show if a Service is Active or Inactive

systemctl show -p ActiveState --value x11-common

Make sure Wayland is disabled

sudo vim /etc/gdm3/custom.config

Uncomment this line

WaylandEnable=false

Make sure nouveau is disabled

lsmod | grep nouveau

If you see an output like this

nouveau              1949696  0
mxm_wmi                16384  1 nouveau
video                  49152  1 nouveau
i2c_algo_bit           16384  2 mgag200,nouveau
ttm                   106496  2 drm_vram_helper,nouveau
drm_kms_helper        184320  4 mgag200,nouveau
drm                   491520  6 drm_kms_helper,drm_vram_helper,mgag200,ttm,nouveau
wmi                    32768  5 wmi_bmof,dell_smbios,dell_wmi_descriptor,mxm_wmi,nouveau

Then run the following to disable Nouveau

cat <<EOF | sudo tee /etc/modprobe.d/blacklist-nouveau.conf
blacklist nouveau
options nouveau modeset=0
EOF

Regenerate the kernel initramfs:

sudo update-initramfs -u

Now Reboot

sudo reboot now

Part 6
Downloading and Installing Nvidia Drivers
You get the whatever drivers are for you GPU

You can double check

lspci |grep -E "VGA|3D"

Appendix A. Supported NVIDIA GPU Products

https://download.nvidia.com/XFree86/Linux-x86_64/550.90.07/README/supportedchips.html

chmod 755 NVIDIA-Linux-x86_64-560.35.03.run

Needless to say u should go into TTY and stop your GDM service before running the following:

sudo ./NVIDIA-Linux-x86_64-560.35.03.run --no-cc-version-check

Stop GDM

sudo service gdm stop
sudo service lightdm stop
sudo pkill -9 Xorg