This is a Desktop machine with AMD 5900X so no second GPU. Nothing unusual about the setup of my system apart from the GPU being water cooled.
It has been working on Ubuntu for a couple of months until today the screen resolution became back to 1024*768 (4k monitor). The same issue happened twice before and I was able to get it back just by randomly searching online and doing random things. But not this time. I have both Ubuntu and Windows 11 installed, and Grub. The only change was that I got Windows 11 updated (not like major update, just small system automatic update). It still works perfectly fine on Windows as of now.
The Nvidia Driver is not working. Tried many solutions including:
It is related to boot option.
Disabled CSM support for UEFI.
Disabled Secure Boot.
Reinstall with sudo apt install nvidia-driver-520
sudo prime-select nvidia
It boots with 4k resolution now, but the framerate is trash. And Nvidia driver is still not loading. sudo modprobe nvidia fails.
I then tried to remove all nvidia packages, use the .run file from Linux x64 (AMD64/EM64T) Display Driver | 515.65.01 | Linux 64-bit | NVIDIA.
It tells me that kernel header does not exist.
I might have done something crazy in kernel source. So my uname -r gives 5.4.0-131-generic.
Make sure there are linux-headers-220.127.116.11 and linux-headers-5.4.0-131-generic BOTH of them in /usr/src.
If not, do sudo apt install for BOTH of them. I’ve been using
sudo apt install linux-headers-uname -r
from every other posts. But that’s not enough.
After the .run file finishes, it auto reboots and everything is working fine!
Finally, I turned back on CSM support and secure boot. It still works.