check the authority of .Xauthority under home, if it is root
sudo chown abc:abc .Xauthority
And then follow these steps to reinstall the long lived branch version nvidia drivers 375
https://askubuntu.com/questions/223501/ubuntu-gets-stuck-in-a-login-loop?noredirect=1&lq=1