When i connect second monitor to my laptop (hp pavilion dv6 2130er, nvidia gx 320m) with ubuntu 18.04 by HDMI, its freezing and doesn't respond to any actions until reboot. Also, when i reboot laptop with connected monitor, it works fine, but when i turning hdmi off and in again, it freezes. (Sorry for my english)
sudo lshw -class display
[sudo] password for dmitry:
description: VGA compatible controller product: GT216M [GeForce GT 320M] vendor: NVIDIA Corporation physical id: 0 bus info: [email protected]: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
The solution may be as simple as installing the updated pro Nvidia drivers:
First add the drivers PPA:
sudo add-apt-repository ppa:graphics-drivers/ppa sudo apt update && sudo apt upgrade
Then from "Activities" window, search for "Software & Updates" and run said program. Under the "Additional Drivers" tab you will see a list of available drivers. Select the one with the highest version number. When it finishes installing reboot. If X starts up without a hitch, you should be good to go.
If X doesn't start, and instead drops you to a command line, purge out the nvidia drivers:
sudo apt purge "*-nvidia-*" sudo apt autoremove && sudo apt autoclean
Then reboot, and follow the above instructions again, but this time selecting the next driver in the list. In my case driver 396 does NOT work for me but 390 does. Once you find the driver version that works after reboot, your dual monitors should work.