Fix Blank Screen Nvidia Optimus Laptop Linux and Cuda
--
Checklist
I assumed that you got your laptop running and the only thing left is installing Nvidia video driver to perform more advance tasks such as playing video games and parallel processing. Simply, the checklist is knowing your video graphic card and which driver version suits it. For example, my laptop graphic card is Nvidia 720M which has a compute capability of 2.x Fermi. Therefore, the highest Nvidia driver version that supports is 390s and finally the highest cuda version is 8.0 where higher versions are not supported.
Restore Default
This section is for those who have tried and failed and neeeded to restore the default installation. If you think you do not need this section, go ahead and do so. Still, starting here will be using full terminal in administrator mode and not GUI. If you messed up bad, try pressing ctrl+alt+f2 (try all f1-f12 until you are presented with a terminal). The concept is find all the Nvidia, Cuda, Primus, Bumblebee, and any packages that you just installed and uninstall them and finally reinstall Nouveau. Here I use aptitude to see the packages.
sudo su
apt install aptitude
aptitude search nvidia
aptitude search cuda
aptitude search bumblebee
aptitude search primus
Uninstall all of them one by one or try the following command line and if the following command does not work then uninstall them one by one.
apt-get purge 'nvidia.*'
apt-get purge 'cuda.*'
apt-get purge 'bumblebee.*'
apt-get purge…