Consertei instalando o driver recomendado da Nvidia:
sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt-get update
Verifique os drivers recomendados: ubuntu-drivers devices
== cpu-microcode.py ==
driver : intel-microcode - distro non-free
== /sys/devices/pci0000:00/0000:00:01.2/0000:02:00.0 ==
model : GM108M [GeForce 940MX]
modalias : pci:v000010DEd0000134Dsv000017AAsd00005050bc03sc02i00
vendor : NVIDIA Corporation
driver : xserver-xorg-video-nouveau - distro free builtin
driver : nvidia-370 - third-party free recommended
driver : nvidia-367 - distro non-free
driver : nvidia-364 - third-party free
No meu caso, foi nvidia-370 - third-party free recommended
. Então eu instalei:
sudo apt-get install nvidia-370 nvidia-prime
reboot