Because LeonidMew was asking about 18.04 (I'm using 18.04.2), here's my version.
The GUI paprefs tried to combine one HDMI with one analog output, instead of both hdmi. So I edited the file /etc/pulse/default.pa as described by Léo Léopold Hertz
$ gedit /etc/pulse/default.pa # make changes as in method a or b below
$ pulseaudio -k # then restart pulseaudio
Both the following methods work on their own, so pick one (make sure to add these lines to the top of the file, I put it right after .fail ! Otherwise it doesn't work).
Method A
load-module module-alsa-sink device=hw:0,0
load-module module-combine-sink sink_name=combined
Method B
load-module module-alsa-sink device=hw:1,3 sink_name=hdmi
load-module module-alsa-sink device=hw:1,7 sink_name=hdmi2
load-module module-combine-sink sink_name=combined slaves=hdmi,hdmi2
set-default-sink hdmi-combined
Reference
Method A
For reference, the hw:0,0 comes from aplay -l
$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 0: ALC892 Analog [ALC892 Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 1: ALC892 Digital [ALC892 Digital]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 3: HDMI 0 [HDMI 0]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 7: HDMI 1 [HDMI 1]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 8: HDMI 2 [HDMI 2]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 9: HDMI 3 [HDMI 3]
Subdevices: 1/1
Subdevice #0: subdevice #0
Method B
And the 1:7 and 1:3 comes from
$ pacmd list-sinks | grep -e 'name:' -e 'alsa.device ' -e 'alsa.subdevice '
name: <alsa_output.pci-0000_00_1b.0.iec958-stereo>
alsa.subdevice = "0"
alsa.device = "1"
name: <alsa_output.pci-0000_01_00.1.hdmi-stereo-extra1>
alsa.subdevice = "0"
alsa.device = "7"
On the GNOME "sound settings" I set the other HDMI from 2nd monitor as output, and then re-ran the command
$ pacmd list-sinks | grep -e 'name:' -e 'alsa.device ' -e 'alsa.subdevice '
name: <alsa_output.pci-0000_00_1b.0.iec958-stereo>
alsa.subdevice = "0"
alsa.device = "1"
name: <alsa_output.pci-0000_01_00.1.hdmi-stereo>
alsa.subdevice = "0"
alsa.device = "3"
To verify these numbers are correct, I ran
$ aplay -D plughw:1,3 /usr/share/sounds/alsa/Front_Right.wav
$ aplay -D plughw:1,7 /usr/share/sounds/alsa/Front_Right.wav
which sounded on their respective monitors.