External monitor issues

The external monitor is not being recognized at all. I’ve been all over this and other forums, and have gotten the external monitor to be recognized, but never usable. I could see the mouse on a black screen. My laptop main screen always works just fine. I also see the issue with the nvidia-smi command not communicating with the NVIDIA driver. Currently running nvidia-driver-470 in Ubuntu 18.04. The uname -r output is 5.4.0-80-generic. The nvidia bug report log is also attached.
nvidia-bug-report.log.gz (182.8 KB)

I’ve tried a lot of different items on many forums with no luck. Any thoughts appreciated, thanks.

I found a solution. Running a
sudo apt purge nvidia-drivers-*
brought monitor back to being seen by the OS, but still not used right. The issue is that I had set the default gcc to be 5.5. I finally noticed that during installation of the nvidia-driver-470 (in my case) was running into an error building the kernel modules. I found here

that gcc must be version 7. So I set the gcc with
sudo update-alternatives --config gcc
to gcc-7, reinstalled the nvidia-driver-470, restarted, and all is well again.