When I connect a second monitor to my laptop (HP Pavilion dv6 2130er, NVIDIA GX 320m) with Ubuntu 18.04 by HDMI, it's freezing and doesn't respond to any actions until rebooted. When I reboot the laptop with the monitor connected it works fine but, when I turn HDMI off and on again, it freezes.
sudo lshw -class display
*-display
description: VGA compatible controller
product: GT216M [GeForce GT 320M]
vendor: NVIDIA Corporation
physical id: 0
bus info: pci@0000:01:00.0
version: a2
width: 64 bits
clock: 33MHz
capabilities: pm msi pciexpress vga_controller bus_master cap_list rom
configuration: driver=nouveau latency=0
resources: irq:26 memory:d2000000-d2ffffff memory:c0000000-cfffffff memory:d0000000-d1ffffff ioport:6000(size=128) memory:c0000-dffff
sudo lshw -class displayto your question please? also have you installed updated drivers using this ppa: sudo add-apt-repository ppa:graphics-drivers/ppa ?