Gnome shell is lagging after it kept idle for sometime

I noticed an issue where if I have kept the gnome shell idle for sometime about 15 seconds to 20 seconds (sometime 5 seconds also) then if I move the mouse cursor, it sticks for 1 secs and then moves.

While writing this one, I kept one YouTube video running in one tab, it sometimes freezes for 0.5s then continues. There is no pattern it just occurs randomly.

If there is a program is running in background like system monitor, then this issue doesn’t occur.

I use a nvidia RTX 3050 with X11. And My laptop display is 120Hz. My CPU is a 12th Gen Intel i5. I made nvidia GPU as primary one following this guide

I don’t know what is the reason behind this. Your help is really appreciated.
If you need more information regarding the issue, please let me know.

UPDATE: If I disable optimus graphics from bios, i.e., the display is only driven by the discrete GPU, then the problem seems solved,but another problem arises that is the spinning animation during the fedora bootup is not showing.

Please post the output of dnf list installed \*nvidia\*. Note that disabling the nvidia gpu will have other effects as well.

It is also often advisable to ensure the laptop bios is fully updated to the latest available version as well as updating the OS to the latest version for all installed software.

Output:

output_nvidia

I guess, you have got it incorrect… I am not disabling the NVIDIA gpu… if I disable the optimus switch from bios the display is only driven by the discrete gpu.

Everything is fully updated.

Sorry, I misunderstood the comment about disabling optimus. In any case when a device is disabled and thus the proper drivers may not be loaded it can cause unanticipated issues.

This may be because the nvidia gpu is not active that early in the boot process. Generally it takes 3 to 5 seconds before the drivers are loaded on my system.

Please post the requested data as text, using the preformatted text tags either with the </> button on the tool bar or by bracketing the posted text on the lines preceding and following the text with triple back quotes [ ``` ]. What you posted shows the names but does not show either the version or the repo it was installed from – all of which show with the command provided and are pertinent to the discussion.

Sorry for the inconvenience… Here is the output

Installed Packages
akmod-nvidia.x86_64                      3:535.113.01-1.fc38 @rpmfusion-nonfree-nvidia-driver
kmod-nvidia-6.5.5-200.fc38.x86_64.x86_64 3:535.113.01-1.fc38 @@commandline                   
kmod-nvidia-6.5.6-200.fc38.x86_64.x86_64 3:535.113.01-1.fc38 @@commandline                   
nvidia-gpu-firmware.noarch               20230919-1.fc38     @updates                        
nvidia-settings.x86_64                   3:535.113.01-1.fc38 @rpmfusion-nonfree-nvidia-driver
xorg-x11-drv-nvidia.x86_64               3:535.113.01-1.fc38 @rpmfusion-nonfree-nvidia-driver
xorg-x11-drv-nvidia-cuda-libs.x86_64     3:535.113.01-1.fc38 @rpmfusion-nonfree-nvidia-driver
xorg-x11-drv-nvidia-kmodsrc.x86_64       3:535.113.01-1.fc38 @rpmfusion-nonfree-nvidia-driver
xorg-x11-drv-nvidia-libs.i686            3:535.113.01-1.fc38 @rpmfusion-nonfree-nvidia-driver
xorg-x11-drv-nvidia-libs.x86_64          3:535.113.01-1.fc38 @rpmfusion-nonfree-nvidia-driver
xorg-x11-drv-nvidia-power.x86_64         3:535.113.01-1.fc38 @rpmfusion-nonfree-nvidia-driver