Problems install CUDA 10.2 and 11.0 mix up

I am having a significant issue getting my CUDA installation to work. I have had it previously working and have created a bit of a mess and don’t know how to resolve it.

Most recently I have been trying to reinstall CUDA 10.2. I previously had this version installed, however, through changing some settings a ubuntu update was carried out, this entered into an infinite login loop. Following this I carried out an uninstallment process using purge as per nvidia guidance. Then tried install CUDA 11.0. Unfortunately, this didn’t work. Did another purge. Tried to install CUDA 10.2. Now when installing 10.2 the system is still downloading and installing the 11.0 packages and dependencies. The whole system seems to be cross contaminated.

Running nvidia-smi returns - NVIDIA-SMI has failed because it couldn’t communicate with NVIDIA drivers. Make sure the latest NVIDIA driver is installed and running.

When running nvcc --version at the cmdline - nvcc: command not found. Is returned…

I have two GeForce GTX Titan X GPUs in my system and running ubuntu 16.04 LTS with gcc-9 compiler.

My login screen is back to infinite looping. I have been trying to resolve the issue for 3 days and no luck. As you can guess I am relatively inexperienced using linux which isn’t helpful. Any guidance would be much appreciated.