External monitor does not work with NVIDIA GEFORCE GTX 960m on Ubuntu

I have an Asus laptop GL552VW that comes with an NVIDIA GEFORCE GTX 960m card.
I tried unsucessfully to use an external monitor LG 32MN500M connected through a HDMI slot with the following environments

  • Ubuntu 20.04 Kernel 5.4.0

  • Ubuntu 21.10 Kernel 5.16

  • Ubuntu 21.10 Kernel 5.13

  • Ubuntu 21.10 Kernel 5.11.20

  • Ubuntu 21.10 Kernel 5.11.0

I have also tried to use unsuccesfully the following drivers provided by Ubuntu

nvidia 510 (Which is the recommended one according to NVIDIA site and Ubuntu)
nvidia 470
nvidia 418
nvidia 450
nvidia 390
xserver-xorg-video-nouveau

The external monitor works for less than a second, with some noise lines, and then the screen turns black. This behavior repeats randomly causing some kind of blink/flick effect. When the monitor turns black it shows a “Signal out of range” message

The atached bug report is for the environment → Ubuntu 21.10, Kernel 5.13, nvidia driver 510

Your external connectors are handled by the intel igpu and the i915 driver has a bug/regression on skylake HQ model HD530 graphics. Please see this:
https://forums.developer.nvidia.com/t/external-monitor-blinking-nvidia-gtx-960m-ubuntu-20-04/200996/6