Installing CUDA corrupts Ubuntu Nvidia display drivers

Had Ubuntu running with nvidia-driver-430 on a 4K monitor.

Installed CUDA 10.1, finished installation, everything looks great.

Rebooted the machine and now I’m stuck with “Unknown monitor” at 1024x768.

Is there any way to undo the damage or is my Ubuntu installation ruined?

OK: better news…

  1. I switched from nvidia-driver-430 to the stock Ubuntu display driver in “Software & Updates / Additional Drivers”, and rebooted.

  2. I ran the uninstaller script:

sudo /usr/local/cuda-10.1/bin/cuda-uninstaller

Selected all checkboxes and successfully uninstalled, then rebooted (probably not necessary).

  1. Switched from stock display driver back to nvidia-driver-430 and rebooted

4K is working again!

I guess the driver gets confused if CUDA 10.1 is installed, but it doesn’t actually get corrupted.

BTW this is running with an RTX 2060 and an LG 4K monitor.