NVIDIA GeForce RTX 3060 freezes Ubuntu 18.04/20.04/22.04

Dear developers & experienced users of NVIDIA and Linux,
could you give me an advice on the following (typical) issue: I’m running different versions of Ubuntu (18.04, 20.04, 22.04) on my laptop equipped with NVIDIA GeForce RTX 3060 (and also Intel UHD Graphics) and constantly face freezes of the graphical interface (i.e., everything on the screen becomes non-clickable), so I have to run terminal and reboot. In the kern.log I found quite common (according to the Google) error message ‘Failed to grab modeset ownership’. I tried to modify the grub file by adding GRUB_CMDLINE_LINUX_DEFAULT=“nvidia-drm.modeset=1” followed by ‘sudo grub-mkconfig -o /boot/grub/grub.cfg’ but it did not affect the problem. Attached, please find the output of the script nvidia-bug-report.sh. I will be very grateful for any hint on how to overcome this problem.
nvidia-bug-report.log.gz (389.3 KB)

The nvidia gpu is in on-demand mode and actually sleeping. The desktop is rendered by the intel igpu only.
Please check if there’s an issue with panel self refresh by disabling it with kernel parameter
i915.enable_psr=0

generix,
thanks for the reply. Indeed, I found that the nvidia was in the on-demand mode. However, as I’m quite new to Ubuntu I misinterpreted the error messages in the kern.log.
I tried your recommendation by adding ‘GRUB_CMDLINE_LINUX=“i915.enable_psr=0”’ in the grub file with its further updating. Unfortunately, it did not fix the freezes. I only found that those freezes very often occur when I’m trying to copy some commands from the google-chrome browser to the terminal. IDK, whether it could explain something, or it’s just a coincidence.
After some more googling on the related issues, I also applied another advice and updated the kernel from 5.15 to 5.19, also without success.
Finally, I tried performance mode of the nvidia gpu and nothing changed.

So, I realized that this is most likely not nvidia problem and now looking for some other hints on this problem over the Internet. Of course, I would be very happy if anyone who managed to overcome this problem, or just have ideas will post here.

UPD! After some more experiments the problem seems to be fixed by activating Wayland. I just added ‘WaylandEnable=true’ to /etc/gdm3/custom.conf and now login using Wayland display server. The complete description of these steps I found at https://linuxconfig.org/how-to-enable-disable-wayland-on-ubuntu-22-04-desktop. Hope, it helps someone meeting the same issue.