Fix Ubuntu Black screen With blinking Underscore (Nvidia)

Note: This post is specifically for Ubuntu installations using Nvidia GPU.

If you have an Nvidia GPU, and recently updated to Wayland, an Ubuntu version that defaults to wayland, or updated/installed new nvidia drivers and now your gdm wont start, there is a good chance your nvidia drivers are broken.

Try following these steps to fully uninstall, then reinstall nvidia drivers.

Use Ctrl + Alt + F3-6 to enter a command line shell. Login using your user credentials, then do the following:

1) Uninstall all nvidia packages.

sudo apt remove --purge '*nvidia*'
sudo apt autoremove
sudo apt clean
sudo reboot now

2) You should now have GDM loaded, and have a display output with the default, but slow, nouveau driver. Log in, open a terminal and run the following: dpkg -l | grep nvidia. This should not output any packages. If it does, use apt to remove them. If you had to remove any package in this step, restart your computer once again.

3) Run nvidia-detector to find the recommended nvidia driver version, then run sudo ubuntu-drivers list to reload the available drivers. Open the program Additional Drivers in Ubuntu, and install the proprietary, non open-kernel version that matches the one output by nvidia-detector.

4) Restart your computer one last time. If if the login menu appears, the Nvidia driver was correctly loaded. To verify this, login and open a terminal, and run nvidia-smi. This command should output output information regarding the driver, your nvidia GPU, and other miscellaneous information.