Display lags/freezes after suspend with Prime Performance mode

My machine lags. It freezes temporarily for 1s or ~10s about every 5 seconds. This happened after I have suspended the machine at least once and Prime settings are on Performance mode.

This stops lags until next suspend: sudo systemctl restart gdm
This takes no effect Alt+F2 --> r

Related to this issue: Ubuntu 22.04: type-c display lags after wake from suspend

PC info
OS: Ubuntu 22.04 LTS x86_64
Host: ROG Strix G513QC_G513QC 1.0
Kernel: 5.15.0-33-generic
Shell: bash 5.1.16
Resolution: 1920x1080
DE: GNOME 42.0
CPU: AMD Ryzen 7 5800H with Radeon Graphics (16) @ 3.200GHz
GPU: NVIDIA GeForce RTX 3050 Mobile
GPU: AMD ATI 05:00.0 Cezanne
Memory: 3401MiB / 15400MiB
nvidia-bug-report.log.gz (392.0 KB)

Seems like this has resolved the issue

sudo systemctl stop nvidia-suspend.service
sudo systemctl stop nvidia-hibernate.service
sudo systemctl stop nvidia-resume.service

sudo systemctl disable nvidia-suspend.service
sudo systemctl disable nvidia-hibernate.service
sudo systemctl disable nvidia-resume.service

sudo rm /lib/systemd/system-sleep/nvidia

credit: [FIXED] Suspend / Resume issues with the driver version 470 - #3 by humblebee

The freezing started about a month ago (maybe a bit more) , after idling for awhile it would lock up.
I still could ssh to my desktop - (x)ubuntu0.22.04.

The tip from @makar.melikyan did not work for me.
but the freeze did take longer to happen, I think 3 hours idling now
also after disabling these services. The only thing I see now in syslog:

sep 01 03:03:11 SnowPhoeniX-R rtkit-daemon[1694]: Supervising 9 threads of 6 processes of 1 users.
sep 01 03:03:11 SnowPhoeniX-R rtkit-daemon[1694]: Supervising 9 threads of 6 processes of 1 users.
sep 01 03:02:24 SnowPhoeniX-R kernel: NVRM: Xid (PCI:0000:01:00): 61, pid=1197, 0d20(3244) 00000000 00000000
sep 01 03:02:24 SnowPhoeniX-R kernel: NVRM: GPU at PCI:0000:01:00: GPU-a724ac37-9b6d-a960-643f-ad9b669b3123
sep 01 03:02:07 SnowPhoeniX-R rtkit-daemon[1694]: Supervising 9 threads of 6 processes of 1 users.
sep 01 03:02:07 SnowPhoeniX-R rtkit-daemon[1694]: Supervising 9 threads of 6 processes of 1 users.
sep 01 03:01:07 SnowPhoeniX-R rtkit-daemon[1694]: Supervising 9 threads of 6 processes of 1 users.
sep 01 03:01:07 SnowPhoeniX-R rtkit-daemon[1694]: Supervising 9 threads of 6 processes of 1 users.
sep 01 03:00:07 SnowPhoeniX-R rtkit-daemon[1694]: Supervising 9 threads of 6 processes of 1 users.
sep 01 03:00:07 SnowPhoeniX-R rtkit-daemon[1694]: Supervising 9 threads of 6 processes of 1 users.
sep 01 02:59:07 SnowPhoeniX-R rtkit-daemon[1694]: Supervising 9 threads of 6 processes of 1 users.
sep 01 02:59:07 SnowPhoeniX-R rtkit-daemon[1694]: Supervising 9 threads of 6 processes of 1 users.
sep 01 02:58:07 SnowPhoeniX-R rtkit-daemon[1694]: Supervising 9 threads of 6 processes of 1 users.
sep 01 02:58:07 SnowPhoeniX-R rtkit-daemon[1694]: Supervising 9 threads of 6 processes of 1 users.
sep 01 02:57:07 SnowPhoeniX-R rtkit-daemon[1694]: Supervising 9 threads of 6 processes of 1 users.
sep 01 02:57:07 SnowPhoeniX-R rtkit-daemon[1694]: Supervising 9 threads of 6 processes of 1 users.

I was following syslog and the screen frooze at 03:02:24

I am currently using the 510.85.02 drivers using a RTX2080
installed packages :

libnvidia-cfg1-510/jammy-updates,jammy-security,jammy,jammy,now 510.85.02-0ubuntu0.22.04.1 amd64 [installed]
libnvidia-common-510/jammy-updates,jammy-updates,jammy-security,jammy-security,jammy,jammy,jammy,jammy,now 510.85.02-0ubuntu0.22.04.1 all [installed]
libnvidia-compute-510/jammy-updates,jammy-security,jammy,jammy,now 510.85.02-0ubuntu0.22.04.1 amd64 [installed]
libnvidia-compute-510/jammy-updates,jammy-security,jammy,jammy,now 510.85.02-0ubuntu0.22.04.1 i386 [installed,automatic]
libnvidia-decode-510/jammy-updates,jammy-security,jammy,jammy,now 510.85.02-0ubuntu0.22.04.1 amd64 [installed]
libnvidia-decode-510/jammy-updates,jammy-security,jammy,jammy,now 510.85.02-0ubuntu0.22.04.1 i386 [installed,automatic]
libnvidia-egl-wayland1/jammy,now 1:1.1.9-1.1 amd64 [installed,automatic]
libnvidia-encode-510/jammy-updates,jammy-security,jammy,jammy,now 510.85.02-0ubuntu0.22.04.1 amd64 [installed]
libnvidia-encode-510/jammy-updates,jammy-security,jammy,jammy,now 510.85.02-0ubuntu0.22.04.1 i386 [installed,automatic]
libnvidia-extra-510/jammy-updates,jammy-security,jammy,jammy,now 510.85.02-0ubuntu0.22.04.1 amd64 [installed]
libnvidia-fbc1-510/jammy-updates,jammy-security,jammy,jammy,now 510.85.02-0ubuntu0.22.04.1 amd64 [installed]
libnvidia-fbc1-510/jammy-updates,jammy-security,jammy,jammy,now 510.85.02-0ubuntu0.22.04.1 i386 [installed,automatic]
libnvidia-gl-510/jammy-updates,jammy-security,jammy,jammy,now 510.85.02-0ubuntu0.22.04.1 amd64 [installed]
libnvidia-gl-510/jammy-updates,jammy-security,jammy,jammy,now 510.85.02-0ubuntu0.22.04.1 i386 [installed,automatic]
libnvidia-nscq-510/jammy-updates,jammy-security,now 510.85.02-0ubuntu0.22.04.1 amd64 [installed]
linux-objects-nvidia-510-5.15.0-46-generic/jammy-updates,jammy-security,now 5.15.0-46.49 amd64 [installed]
nvidia-compute-utils-510/jammy-updates,jammy-security,jammy,jammy,now 510.85.02-0ubuntu0.22.04.1 amd64 [installed]
nvidia-dkms-510/jammy-updates,jammy-security,jammy,jammy,now 510.85.02-0ubuntu0.22.04.1 amd64 [installed]
nvidia-driver-510/jammy-updates,jammy-security,jammy,jammy,now 510.85.02-0ubuntu0.22.04.1 amd64 [installed]
nvidia-kernel-common-510/jammy-updates,jammy-security,jammy,jammy,now 510.85.02-0ubuntu0.22.04.1 amd64 [installed,automatic]
nvidia-kernel-source-510/jammy-updates,jammy-security,jammy,jammy,now 510.85.02-0ubuntu0.22.04.1 amd64 [installed,automatic]
nvidia-prime/jammy,jammy,now 0.8.17.1 all [installed,automatic]
nvidia-settings/jammy,jammy,jammy,now 510.47.03-0ubuntu1 amd64 [installed,automatic]
nvidia-utils-510/jammy-updates,jammy-security,jammy,jammy,now 510.85.02-0ubuntu0.22.04.1 amd64 [installed,automatic]
xserver-xorg-video-nvidia-510/jammy-updates,jammy-security,jammy,jammy,now 510.85.02-0ubuntu0.22.04.1 amd64 [installed,automatic]

I have an i7 11700k , but I have disabled / blacklisted the intel onboard gpu

@cainethanatos Please check for a bios update.

oh wow, must do the walk of shame :)
I have a Asus TUF Gaming Z590-PLUS WIFI
I did see firmware updates from time to time, I just assumed (shame shame shame) the bios was also updated.

it had the initial bios version 1017 . Now upgraded to 1601.

I left my system idling for +3 hours no crash/freeze so far