Problem with CUDA 9.x on Ubuntu 16.04

Hello World :smile:
This is my condition and problem:
(my computer is ASUS N552VW with NVIDIA GEFORCE GTX 960M)

  1. boot and install a Ubuntu 16.04 [successfully]
  2. update my new OS [successfully]
  3. using these commands to install cuda according to my flies and versions (CUDA 9)
    2.0 $ sudo dpkg -i cuda-repo-.deb [successfully]
    2.1 $ sudo apt-key add /var/cuda-repo-/ [successfully]
    2.2 $ sudo apt-get update [successfully]
    2.3 $ sudo apt-get install cuda [successfully]
  4. reboot [successfully]
  5. Problem: after system boots, i don’t have any GUI to login! just gnu/linux console comes up. when i try to startx or restart lightdm/gdm console print that it can’t find display

This looks (to me) like a problem with the nvidia driver for your GPU. It happened to me the first time when I setup my computer, then recently (two days ago) when I updated Python3 and installed cuda-9.0. Any of the two may be the root cause of the problem - either a python change can make huge problems with Ubuntu programs you had no idea they were using python, or a nvidia driver change (by the cuda install) can give a GUI problem after reboot.

To fix the GUI : google sudo apt purge nvidia* # to remove the nvidia driver, and get back to nouveau.

With the GUI : check that your system is okay (update first the versions of Python2 and Python3), check the “install cuda checklist” (Pre-installation actions in Installation Guide Linux :: CUDA Toolkit Documentation ).

Hope this helps.

Why my story may help you :

Yesterday, I installed from scratch cuda-9.0, cuDNN-7.0, tensorflow with VirtualEnv, and tested all variations (python2 and CPU, python3 and CPU, python2 and GPU, python3 and GPU).

The day before yesterday, I had changed a symlink python3 → python3.5 into python3 → python3.6, which was a major mistake as important Ubuntu programs rely on this python3 → python3.5 symlink. And I was struggling, just like you are today, with no GUI at boot (lightdm ok, but Unity can’t start, and nor gnome-desktop nor i3 helped as alternatives).

Installing cuda-9.0 automatically changed the nvidia driver for my GTX 970 from nvidia-375 to nvidia-384.