I added the graphics-drivers PPA and installed the 415 driver, but it seemed that in doing so my 940MX was no longer being utilised. So, I attempted to revert to the 390. I made the mistake of removing the PPA before switching away, though. When I tried to switch back to the 390 driver, Ubuntu spat out an error - I can't remember the exact message, though I believe it mentioned something not being found in cache.

After restarting my system, the boot process got stuck on a screen flooded with countless "Starting NVIDIA persistence daemon" and "Stopping NVIDIA persistence daemon" messages. To get the system to boot, I had to enter recovery mode and use prime-select intel. If I use the Nouveau driver the system can boot, but my laptop doesn't seem to use my GPU.

Running nvidia-smi produces the following:

NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running.

I followed the advice here, but it unfortunately didn't help. I've attempted to remove any remnants that the 415 driver may have left behind. Initially I looked this thread, but regarding the page linked by it the directory /usr/local/cuda-X.Y does not exist (as in, theres no cuda-related directory), and the link /usr/bin/nvidia-uninstall points to nvidia-installer, but that doesn't exist. So, I removed the packages as recommended in accordance with this answer. I then set the driver to NVIDIA's 390 in the software settings, so it re-installed everything. Still, restarting with the NVIDIA GPU selected stops me from being able to boot.

The result of dpkg -l | grep nvidia at the time of writing is the following: