I'm running Ubuntu 18.04 on my laptop, and I'm trying to use my second monitor through HDMI from my NVIDIA 1050 Ti card but it is not being recognized. Before reinstalling Ubuntu, it worked.
The way I have managed to fix this problem was by updating my video card driver to the latest as mentioned here.
Start by uninstalling your old NVIDIA driver,
sudo apt-get purge nvidia-*
and then follow these steps:
1. Add the PPA
sudo add-apt-repository ppa:graphics-drivers/ppa sudo apt-get update
2. Install Video Drivers For Your Card
Now as posted in this answer, you need to install the recommended driver for your card.
sudo ubuntu-drivers devices
This will output something similar to this:
== /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0 == vendor : NVIDIA Corporation modalias : pci:v000010DEd00000DDAsv000017AAsd000021D1bc03sc00i00 model : GF106GLM [Quadro 2000M] driver : xserver-xorg-video-nouveau - distro free builtin driver : nvidia-304-updates - distro non-free driver : nvidia-304 - distro non-free driver : nvidia-331 - distro non-free **recommended** driver : nvidia-331-updates - distro non-free
Then just install the driver labeled "recommended", so in this example it would be:
sudo apt-get install nvidia-331
Once this is done reboot and you should be good to go.