sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt install [driver_name]
sudo ubuntu-drivers autoinstall
2) you may have to uninstall all nvidia drivers first
dpkg -l | grep -i nvidia
sudo apt-get remove --purge '^nvidia-.*'
sudo apt-get install ubuntu-desktop
3) Disable nvidia-drm modeset option
I discovered that prime-select writes a configuration file which causes the problem. It enables the nvidia-drm modeset option. You can simply undo the change made by prime-select by commenting out this option. It will not be reset, because prime-select only writes this file when it does not exist yet."
Open the file in your favorite editor (vim, nano, gedit, etc.).
sudo nano /lib/modprobe.d/nvidia-kms.conf And comment out the the nvidia-drm modeset option.
# This file was generated by nvidia-prime # Set value to 0 to disable modesetting # options nvidia-drm modeset=1