Though this is a common problem, none of the online solutions worked for me.
What I did:
- Fresh install of Ubuntu 16.04 (System76 Oryx Pro)
- Installed NVIDIA drivers (Tried, 390, 387, 384, system76-default drivers). I tried the .run file as well as the apt-get install nvidia-current (In separate installation attempts)
- I installed the driver virtually after disabling lightdm. After installation I login and it fails.
List of things I tried that didn't work:
1) Moved .Xauthority to .Xauthority.bak and logging in..
2) Created a blacklist file with the content, /etc/modprobe.d/blacklist-nouveau.conf, with the content : blacklist nouveau options nouveau modeset=0
3) Killed Xserver before installing NVIDIA
4) lsmod | grep nvidia , doesn't show nouveau, which means that nouveau isn't running causing a conflict.
5) I updated the linux kernel image to the latest (4.13.0-45-generic). I also tried an older 4.4.0-128-generic image. Both didn't work
6) Uninstalled lightdm, and installed gdm, didn't work.