Nvidia-drm.modeset=1 is buggy, but without it Ubuntu has incorrect display resolution

Hi,

I have Kubuntu 20.04 and graphics card Nvidia 750Ti and two displays connected to it (HDMI and DVI).

  1. In case I do NOT set nvidia-drm.modeset=1 (default), only one of my displays is detected and its resolution is incorrect (only minimal, like 1024*764) without a way to change.

  2. If I SET nvidia-drm.modeset=1 in Grub options, I get everything fine on the start, but simetimes (i. e. when I load WebStorm - 100% reproducibility here, don’t know why) the second (DVI) monitor turning off, then after a sec turning on, but KDE UI restarts there (all my windows were moved to the first display and I need to return them back manually).
    This bug appears only once after restart, then all works fine.

  3. More strange is I already had another Kubuntu installation (100% equal to current, I just reinstalled it due to my SDD failed), and everything worked fine WITHOUT nvidia-drm.modeset=1, but once if I go out of memory, after restart, I fell into the bug (1) described above. And the solution for fixing this was setting nvidia-drm.modeset=1 ONCE - after next restarts it was not needed and all worked fine again.

I already googled a log of articles, checked all permissions for configs and dev files as it recommended, but did not understand what’s wrong here.

Do you have any idea what do I need to change to fix such strange behaviour?

Any ideas?

Please run nvidia-bug-report.sh as root and attach the resulting nvidia-bug-report.log.gz file to your post.