Dual monitor display setup not working with driver 440 (and below) on Ubuntu 20.04 LTS

I have a dual monitor setup, one in landscape, and another in portrait. And the graphic card is GTX 1050. I can use the dual monitor in its default config, i.e., both landscape, but when I tried to match the display config to the physical setup, this doesn’t succeed.