How I Fixed the “No Signal” External Monitor Issue on Ubuntu with NVIDIA 580
this whole thing started because i wanted to use OBS properly with NVENC. i was originally on the NVIDIA 535 driver, but after running into OBS/NVENC compatibility issues, i moved to the 595 driver because that was the newer driver branch and OBS was working with it. the problem was that after moving to 595, my external Acer monitor started randomly losing signal, not just after suspend, but sometimes after a normal reboot or even a complete shutdown and power-on. what made it more annoying was that Ubuntu still detected the monitor through xrandr, applications were still opening on the external display, and OBS could even capture the screen, but the actual monitor would just show no signal.
after trying the usual display configuration stuff and going through NVIDIA forums and other reports, it looked more like a driver issue than an X11 or HDMI configuration problem, especially because the problem was happening across boot, reboot and suspend. i decided to move away from 595 and test the 580 branch instead. first i checked what versions Ubuntu actually had available with apt-cache policy nvidia-driver-580, then installed the current Ubuntu 24.04 package with sudo apt install nvidia-driver-580-open. in my case the version that got installed was 580.178.04, and after installing it i rebuilt the initramfs with sudo update-initramfs -u -k all and rebooted.
after the reboot, nvidia-smi was working normally again and the driver showed 580.178.04, and more importantly the external monitor started getting a signal automatically after a cold boot, reboot and suspend/resume. i tested all three because the original problem wasn't limited to suspend, and so far the 580 driver has fixed the whole thing for me. if you're running into something similar, you can first check the available driver versions with apt-cache policy nvidia-driver-580 and then install it using sudo apt install nvidia-driver-580-open; after that, verify the installed version with nvidia-smi and modinfo nvidia | grep -E '^(version|filename):'. if Secure Boot is getting in the way of loading the NVIDIA module on your machine, you'll also need to deal with that before nvidia-smi can work.