Ubuntu 22.04 with dual nvidia cards nvs 315 and nvs 510

I have a lenovo thinkstation p700 with 2 HP Z24n moniotr, both set as portrait.

I have a problem setting up 2 display card to make both works. 1st one is nvidia nvs 315, 2nd one is nvidia nvs 510. Now I can only use one monitor using 315 with one DVI.

If I use free driver from ubuntu, 315 works but 510 doesn’t work. I mean the display port never get detected. But at least the ubuntu can run with only one display as DVI. However, my monitor cannot set as portrait.

If I upgraded 315 using driver 390, I can setup the monitor as portrait. But still the 2nd monitor using display port is not detected.

But last time I keep 315 as free driver, and upgrade 510 using driver 470, it I can see the connection like display port or hdmi from 510 but once I try to set portrait. It seems not supported and again I got a black screen.

Please advise how I should setup?