The recommended suggestions did not work for me.
OP mentioned that they reinstalled the system. This is fine for most things, but we are on LTS for a reason and a reinstall was not an option for me.
It seemed like the reinstall fixed the issue rather than the accepted answer.
System details
OS: 22.04.1
Kernel: 5.15.0-46-generic
GPU: Nvidia 3080
Symptoms
Like OP I also ran a standard install and fell back to 1024 resolution.
I did not change drivers
I was not given a kernel update
I also tried to change to older drivers 510
and then back to my recommended driver 515
but without any success.
I did not reinstall the os.
The problem
Starts with ubuntu-drivers
The UI for 'Additional drivers' runs this command ubuntu-drivers autoinstall
This returns an error [to be reported].
Traceback (most recent call last):
File "/usr/bin/ubuntu-drivers", line 513, in <module>
greet()
File "/usr/lib/python3/dist-packages/click/core.py", line 1128, in __call__
return self.main(*args, **kwargs)
File "/usr/lib/python3/dist-packages/click/core.py", line 1053, in main
rv = self.invoke(ctx)
File "/usr/lib/python3/dist-packages/click/core.py", line 1659, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/lib/python3/dist-packages/click/core.py", line 1395, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/lib/python3/dist-packages/click/core.py", line 754, in invoke
return __callback(*args, **kwargs)
File "/usr/lib/python3/dist-packages/click/decorators.py", line 84, in new_func
return ctx.invoke(f, obj, *args, **kwargs)
File "/usr/lib/python3/dist-packages/click/core.py", line 754, in invoke
return __callback(*args, **kwargs)
File "/usr/bin/ubuntu-drivers", line 432, in autoinstall
command_install(config)
File "/usr/bin/ubuntu-drivers", line 187, in command_install
UbuntuDrivers.detect.nvidia_desktop_pre_installation_hook(to_install)
File "/usr/lib/python3/dist-packages/UbuntuDrivers/detect.py", line 839, in nvidia_desktop_pre_installation_hook
with_nvidia_kms = version >= 470
UnboundLocalError: local variable 'version' referenced before assignment
The solution
What worked for me was a purging of the nvidia packages and a manual purge of the drivers and a manual driver install.
sudo apt-get remove --purge '^nvidia-.*'
sudo apt-get install ubuntu-desktop
sudo apt-get --purge remove "*cublas*" "cuda*"
sudo apt-get --purge remove "*nvidia*"
sudo add-apt-repository --remove ppa:graphics-drivers/ppa
sudo rm /etc/X11/xorg.conf
sudo apt autoremove
sudo reboot
Then installed my recommended nvidia drivers after checking the official recommenedations here https://www.nvidia.com/Download/index.aspx
For my card the recommended driver is 515 so
sudo apt install nvidia-driver-515
Those instructions came from this other helpful post NVIDIA RTX 3080 GPU not working with Ubuntu 20.04, Kernel 5.8.0-50-generic