External HDMI display on Ubuntu 16.04, NVIDIA GeForce GTX 960M
Solution 1:
I had exactly the same problem with a Laptop HP Pavillion and a GEFORCE GTX 960M. I had problems with the HDMI with both a TV and a beamer.
I finally solved it by installing the latest version of the open source drivers (nvidia-390 at the time of this post).
These steps should do the job: first clean up any eventual mess that there might be by doing
apt-get purge nvidia*
and then you can do the actual installation
add-apt-repository ppa:graphics-drivers/pp
apt update
apt-get install nvidia-387
After rebooting in principle you should obtain a non empty output to
lsmod | grep nvidia
but in my case it was empty and that was why it wasn't working. At the boot Linux wasn't loading the relevant modules. This was UEFI secure boot's fault. Apparently the secure boot didn't like the open source drivers and blocked them from being loaded. This can be fixed by going to the BIOS and disabling it (see here for a more thorough explanation https://askubuntu.com/a/762255).
If it still doesn't work you can try to look for these two possible issues:
- Some other drivers are not blacklisted, e.g. nouveau (https://askubuntu.com/a/951892)
- The file
/etc/X11/xorg.conf
isn't there. If so generate it withnvidia-xconfig