Ubuntu 18.04 opening system setting logs me out

I had a look in /var/log/kern.log and noticed nouveau was crashing about the time I tried to open gnome-control-center.

So I installed the latest stable nvidia drivers (I'm using an nvidia graphics card), rebooted and now it works.


When I upgraded to 18.04 same problem happened to me. Ubuntu logs out unexpectedly and even after suspend. I figured out there was something wrong with .Xauthority.

First of all remove .Xauthority and then relogin using

sudo rm -v .Xauthority
sudo service gdm restart

Don't worry system will recreate .Xauthority.