Comment 95 for bug 1705369

gdm3 and nvidia binary drivers don't work together yet. Maybe 18.04 although there's not much evidence that anyone who knows how to fix this problem is working on it.
This problem has emerged since the default Ubuntu session now uses gdm3 (as of 17.10) but standard gnome users on all recent distribution have the same problem.

The best solution is to replace gdm3 with lightdm. (sudo apt install lightdm)
You can install both display managers and swap between them with

dpkg-reconfigure lightdm (or dpkg-reconfigure gdm3)
and obviously choose lightdm

You don't seem to lose anything by using lightdm instead of gdm3.