Hey there,
I’m pretty new to the Linux ecosystem and this problem was driving me up the wall! The box I’m on is pretty much a fresh install so there are hardly any optimizations in place. Honestly, not even sure if everything is set up right.
Even though I’m on 1 monitor, I was still getting this micro stutter behavior ALL THE TIME. @shelter , with my limited knowledge, I think you are pretty spot on about what the root cause could be. I would see this stutter/lag every time I would transition from typing to scrolling on a webpage. Or even just browsing. All that matters is that there is an opportunity for the GPU to go into its lowest P-State. Something is not right with the P-States when transitioning from idle to any other state.
I tried out @Klusio19 's suggestion and that does work. I just didn’t like the power draw in my current configuration hovering ~130W at idle. Before, my system was ~22W at idle.
Here is all of the information about my system that may be helpful.
My specs:
OS: Arch Linux x86_64Kernel: Linux 6.15.2-arch1-1Display (DELA0FA): 3440x1440 @ 100 Hz (as 3133x1311) in 34" [External]DE: KDE Plasma 6.3.5WM: KWin (Wayland)WM Theme: BreezeCPU: AMD Ryzen 9 5950X (32) @ 5.09 GHzGPU: NVIDIA GeForce RTX 3080 Ti [Discrete]Memory: 4.28 GiB / 31.23 GiB
Using proprietary drivers:
~]$ lspci -k -d ::03xx
0b:00.0 VGA compatible controller: NVIDIA Corporation GA102 [GeForce RTX 3080 Ti] (rev a1)
Subsystem: Micro-Star International Co., Ltd. [MSI] Device 389b
Kernel driver in use: nvidia
Kernel modules: nouveau, nvidia_drm, nvidia
~]$ modinfo nvidia | grep ^version
version: 575.57.08
GSP disabled in kernel options (systemd):
~]$ sudo cat /boot/loader/entries/arch.conf
title Arch-Linux
linux /vmlinuz-linux
initrd /initramfs-linux.img
options root=UUID=*UUID* rw nvidia_drm.modeset=1 nvidia.NVreg_EnableGpuFirmware=0 quite splash
Modules in mkinitcpio.conf:
~]$ sudo cat /etc/mkinitcpio.conf
# vim:set ft=sh
# MODULES
# The following modules are loaded before any boot hooks are
# run. Advanced users may wish to specify all system modules
# in this array. For instance:
# MODULES=(usbhid xhci_hcd)
MODULES=(nvidia nvidia_modeset nvidia_uvm nvidia_drm)
Again, new to Linux so not sure what is important.
Here’s how I fixed it for myself.
Same concept that ignacioff9kp posted. I don’t have an iGPU so something else was needed.
I could only get this working if I locked the minimum clock as a system wide change as root.
I absolutely cannot guarantee any of the following will work for you, but I hope it helps.
Created a new systemd service:
sudo nano /etc/systemd/system/nvidia-clk-lock.service
Configured the newly created service:
The values 615 and 2145 are for a 3080ti. To get the minimum 615, I just stared at
nvidia-settingsPowerMizer recreating the issue. Idle into something with power draw. 615 is a starting point and not optimized. Must be in increments of 15MHz.
[Unit]
Description=Lock the minimum clocks in GPU to avoid low P-State stutter
After=nvidia-persistenced.service # make sure NV driver is ready
[Service]
Type=oneshot
ExecStart=/usr/bin/nvidia-smi -pm 1
ExecStart=/usr/bin/nvidia-smi --lock-gpu-clocks=615,2145
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
Enabled and started this new service:
sudo systemctl daemon-reload
sudo systemctl enable nvidia-clk-lock.service
sudo systemctl start nvidia-clk-lock.service
Verified the service is enabled and active:
sudo systemctl status nvidia-clk-lock.service
And then verified the P-State nvidia-settings and nvidia-smi:
~]$ nvidia-smi --query-gpu=pstate,clocks.sm
pstate, clocks.current.sm [MHz]
P5, 615 MHz
Now, I no longer see any stutters, and my power draw went from ~22W at idle pre change to ~28W post change. Hopefully this helps someone out there.