KDE/GNOME very unresponsive on modern hardware, maybe nvidia issue

I use Manjaro 20.2 KDE edition. I don’t know if this problem is specific to my hardware on all distributions, but I had to install Manjaro because it is the only distro where OLED brightness control works without any hacks.

The essence of the problem is that the GUI slows down very much, the more you use the system in a single session, the less responsive the system becomes, animations about 5-10 fps, although there are no problems on the same windows 10. At the beginning, I thought that KDE was lagging, I used hacks like kwin-lowlattency and other suggested options on different resources, but I tried to install the gnome environment and it only got worse.

Info about my system:

inxi -Fxxxz

System: Kernel: 5.9.11-3-MANJARO x86_64 bits: 64 compiler: gcc v: 10.2.0 Desktop: KDE Plasma 5.20.4 tk: Qt 5.15.2
wm: kwin_x11 dm: SDDM Distro: Manjaro Linux
Machine: Type: Laptop System: GIGABYTE product: AERO 15-SA v: N/A serial: Chassis: type: 10 v: y.y serial:
Mobo: GIGABYTE model: AERO 15-SA serial: UEFI: American Megatrends v: FB09 date: 03/19/2020
Battery: ID-1: BAT1 charge: 90.6 Wh condition: 94.2/94.2 Wh (100%) volts: 16.7/15.2 model: GIGABYTE Aero 15 type: Li-ion
serial: N/A status: Unknown
CPU: Info: 6-Core model: Intel Core i7-9750H bits: 64 type: MT MCP arch: Kaby Lake rev: A L2 cache: 12.0 MiB
flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx bogomips: 62431
Speed: 800 MHz min/max: 800/4500 MHz Core speeds (MHz): 1: 800 2: 800 3: 800 4: 800 5: 800 6: 800 7: 800 8: 800
9: 800 10: 800 11: 800 12: 800
Graphics: Device-1: Intel UHD Graphics 630 vendor: Gigabyte driver: i915 v: kernel bus ID: 00:02.0 chip ID: 8086:3e9b
Device-2: NVIDIA TU116M [GeForce GTX 1660 Ti Mobile] vendor: Gigabyte driver: nvidia v: 455.45.01 bus ID: 01:00.0
chip ID: 10de:2191
Device-3: IMC Networks USB2.0 HD UVC WebCam type: USB driver: uvcvideo bus ID: 1-9:4 chip ID: 13d3:56a2
serial:
Display: x11 server: X. Org 1.20.10 compositor: kwin_x11 driver: modesetting resolution: 3840x2160~60Hz s-dpi: 96
OpenGL: renderer: Mesa Intel UHD Graphics 630 (CFL GT2) v: 4.6 Mesa 20.2.3 direct render: Yes
Audio: Device-1: Intel Cannon Lake PCH cAVS vendor: Gigabyte driver: snd_hda_intel v: kernel bus ID: 00:1f.3
chip ID: 8086:a348
Sound Server: ALSA v: k5.9.11-3-MANJARO
Network: Device-1: Realtek vendor: Gigabyte driver: r8169 v: kernel port: 3000 bus ID: 02:00.0 chip ID: 10ec:2600
IF: enp2s0 state: up speed: 100 Mbps duplex: full mac:
Device-2: Intel Wi-Fi 6 AX200 vendor: Bigfoot Networks driver: iwlwifi v: kernel port: 3000 bus ID: 03:00.0
chip ID: 8086:2723
IF: wlp3s0 state: down mac:
IF-ID-1: br-08587bdd7b49 state: down mac:
IF-ID-2: docker0 state: down mac:
Drives: Local Storage: total: 476.94 GiB used: 31.09 GiB (6.5%)
ID-1: /dev/nvme0n1 vendor: Intel model: SSDPEKKW512G8 size: 476.94 GiB speed: 31.6 Gb/s lanes: 4 serial:
rev: 005C scheme: GPT
Partition: ID-1: / size: 78.78 GiB used: 31.06 GiB (39.4%) fs: ext4 dev: /dev/nvme0n1p5
Swap: Alert: No Swap data was found.
Sensors: System Temperatures: cpu: 50.0 C mobo: N/A
Fan Speeds (RPM): N/A
Info: Processes: 326 Uptime: 34m Memory: 31.09 GiB used: 7.57 GiB (24.3%) Init: systemd v: 246 Compilers: gcc: 10.2.0
Packages: 1290 pacman: 1281 snap: 9 Shell: Bash v: 5.0.18 running in: konsole inxi: 3.1.08

mhwd -li

Installed PCI configs:
video-hybrid-intel-nvidia-455xx-prime 2020.10.04 false PCI
video-modesetting 2020.01.13 true PCI

Warning: No installed USB configs!

I also tried to install optimus-manager and select nvidia. The system started up and it was clear that an nvidia card was being used now, but the system was just as laggy.

I also noticed that the configuration files in the /etc/X11 folder are empty, in particular /etc/X11/mhwd.d/nvidia.conf only has the following lines and nothing else.

nvidia.conf

Generated by mhwd - Manjaro Hardware Detection

Video low fps

Without going too deep, let’s first check if the monitor refresh rate is correct in System Settings->Display and Monitor->Display configuration->Refresh rate.

By design. optimus-manager dynamic config doesn’t write there, but to /etc/X11/xorg.conf.d/10-optimus-manager.conf. Other lines there will interfere with the dynamic config and increases the potential of non-booting system.

I have 60 hz.
I could record a video, but I will try to describe.
When I first log into the system, the animations are more or less in order, not ideal as on windows 10. But acceptable.
I’m trying to open Dolphin, minimize / maximize action happens with an animation of 55-60 fps. The more I start to open windows, the more FPS decreases, especially if the programs are not minimized to the tray. But even if you minimize all programs to the tray, over time everything starts to slow down.

To be honest, I don’t quite understand how all these configurations work, it was also empty before installing optimus-manager. I only comment out this lines in /etc/sddm.etc in X11 section.

sddm.etc

#DisplayCommand=/usr/share/sddm/scripts/Xsetup
#DisplayStopCommand=/usr/share/sddm/scripts/Xstop

OK, then you would need to monitor CPU and RAM usage. See if there are processes that keep eating them and not reducing as time goes by. Use CLI monitoring apps like htop to reduce dependency on DE processes.

Screen with htop. Sorry, but i can’t attach screenshots or post the links.
HTOP

As I have observed, kwin, X11 processes consume the most.
I excluded other applications like skype / chrome, because they also took 20% of the processor, but turning them off, the lags did not disappear.

With my Nvidia GeForce GTX 1050 it was all a question of choosing the right hardware driver in the KDE hardware configuration. Unfortunately the linux native drivers had the same latency on my system as you are describing. I ended up with the video-nvidia-455xx driver (not hyprid) which gave me the best result. I can even have my 2nd screen run with 144Hz.

I would not say that my results have improved. The only thing that helps to get rid of lags is to completely disable compositor.

Updated to nvidia 460 driver, everything is the same, nothing has changed. Is it possible to somehow identify where the problem is, in the developers of KDE or Nvidia? Tried to boot into livecd with gnome environment, also not impressed with smooth animations.