gerritdevriese / kzones

KDE KWin Script for snapping windows into zones
https://store.kde.org/p/1909220
GNU General Public License v3.0
238 stars 14 forks source link

High CPU load #42

Closed otzen closed 11 months ago

otzen commented 11 months ago

I have seen a constant high cpu load for a while now, and tried to dig into it. kwin_x11 was more or less permanent on 60%. (4 cores), Xorg kept jumping up and down the list between a fw percent and 30-40%.

I tried different stuff, but the trigger was disabling kzones. After disabling kzones my CPU load dropped down to normal of a few percent in idle.

In my journey i learned the following command, maybe that provide some useful info. Iff not please let me know if/how I can provide more info.

$ qdbus org.kde.KWin /KWin supportInformation
Information til KWin-support:
Følgende information bør bruges når du spørger om hjælp f.eks. på https://forum.kde.org.
Det giver information om den aktuelt kørende instans, hvilke indstillinger der bruges, 
hvilken OpenGL-driver og hvilke effekter der kører.
Indsend venligst den information der findes nedenfor denne indledningstekst til en pastebin-tjeneste
såsom https://paste.kde.org i stedet for at indsætte den i direkte i support-tråde.

==========================

Version
=======
KWin version: 5.27.4
Qt Version: 5.15.8
Qt compile version: 5.15.8
XCB compile version: 1.15

Operation Mode: X11 only

Build Options
=============
KWIN_BUILD_DECORATIONS: yes
KWIN_BUILD_TABBOX: yes
KWIN_BUILD_ACTIVITIES: yes
HAVE_X11_XCB: yes
HAVE_EPOXY_GLX: yes

X11
===
Vendor: The X.Org Foundation
Vendor Release: 12101007
Protocol Version/Revision: 11/0
SHAPE: yes; Version: 0x11
RANDR: yes; Version: 0x14
DAMAGE: yes; Version: 0x11
Composite: yes; Version: 0x4
RENDER: yes; Version: 0xb
XFIXES: yes; Version: 0x50
SYNC: yes; Version: 0x31
GLX: yes; Version: 0x0

Decoration
==========
Plugin: org.kde.kwin.aurorae
Theme: kwin4_decoration_qml_plastik
Plugin recommends border size: No
onAllDesktopsAvailable: false
alphaChannelSupported: true
closeOnDoubleClickOnMenu: false
decorationButtonsLeft: 0, 2
decorationButtonsRight: 6, 3, 4, 5
borderSize: 3
gridUnit: 10
font: Noto Sans,10,-1,0,50,0,0,0,0,0
smallSpacing: 2
largeSpacing: 10

Output backend
==============
Name: KWin::X11StandaloneBackend

Cursor
======
themeName: breeze_cursors
themeSize: 24

Options
=======
focusPolicy: 0
xwaylandCrashPolicy: 
xwaylandMaxCrashCount: 3
nextFocusPrefersMouse: false
clickRaise: true
autoRaise: false
autoRaiseInterval: 0
delayFocusInterval: 0
shadeHover: false
shadeHoverInterval: 250
separateScreenFocus: false
activeMouseScreen: true
placement: 
activationDesktopPolicy: 0
focusPolicyIsReasonable: true
borderSnapZone: 10
windowSnapZone: 10
centerSnapZone: 0
snapOnlyWhenOverlapping: false
rollOverDesktops: false
focusStealingPreventionLevel: 1
operationTitlebarDblClick: 5000
operationMaxButtonLeftClick: 5000
operationMaxButtonMiddleClick: 5015
operationMaxButtonRightClick: 5014
commandActiveTitlebar1: 0
commandActiveTitlebar2: 28
commandActiveTitlebar3: 2
commandInactiveTitlebar1: 4
commandInactiveTitlebar2: 28
commandInactiveTitlebar3: 2
commandWindow1: 7
commandWindow2: 8
commandWindow3: 8
commandWindowWheel: 28
commandAll1: 10
commandAll2: 3
commandAll3: 14
keyCmdAllModKey: 16777251
condensedTitle: false
electricBorderMaximize: false
electricBorderTiling: true
electricBorderCornerRatio: 0.25
borderlessMaximizedWindows: false
killPingTimeout: 5000
hideUtilityWindowsForInactive: true
compositingMode: 1
useCompositing: true
hiddenPreviews: 1
glSmoothScale: 2
glStrictBinding: true
glStrictBindingFollowsDriver: true
glPreferBufferSwap: 101
glPlatformInterface: 1
windowsBlockCompositing: true
latencyPolicy: 
renderTimeEstimator: 
allowTearing: true

Screen Edges
============
desktopSwitching: false
desktopSwitchingMovingClients: false
cursorPushBackDistance: 1x1
timeThreshold: 150
reActivateThreshold: 350
actionTopLeft: 0
actionTop: 0
actionTopRight: 0
actionRight: 0
actionBottomRight: 0
actionBottom: 0
actionBottomLeft: 0
actionLeft: 0

Screens
=======
Active screen follows mouse:  yes
Number of Screens: 1

Screen 0:
---------
Name: DP-1
Enabled: 1
Geometry: 0,0,5120x1440
Scale: 1
Refresh Rate: 59976
Adaptive Sync: incapable

Compositing
===========
Compositing is active
Compositing Type: OpenGL
OpenGL vendor string: Intel
OpenGL renderer string: Mesa Intel(R) HD Graphics 630 (KBL GT2)
OpenGL version string: 4.6 (Compatibility Profile) Mesa 23.0.4-0ubuntu1~23.04.1
OpenGL platform interface: GLX
OpenGL shading language version string: 4.60
Driver: Intel
GPU class: Kaby Lake
OpenGL version: 4.6
GLSL version: 4.60
Mesa version: 23.0.4
X server version: 1.21.1
Linux kernel version: 6.2
Direct rendering: Requires strict binding: yes
GLSL shaders:  yes
Texture NPOT support:  yes
Virtual Machine:  no
OpenGL 2 Shaders are used

Loaded Effects:
---------------
colorpicker
outputlocator
screenshot
trackmouse
zoom
kwin4_effect_sessionquit
kwin4_effect_scale
kwin4_effect_frozenapp
kwin4_effect_dialogparent
desktopgrid
highlightwindow
overview
tileseditor
windowview
blendchanges
startupfeedback
kscreen

Currently Active Effects:
-------------------------

Effect Settings:
----------------
colorpicker:

outputlocator:

screenshot:

trackmouse:
modifiers: 67108864
mousePolling: true

zoom:
zoomFactor: 1.2
mousePointer: 0
mouseTracking: 0
focusTrackingEnabled: false
textCaretTrackingEnabled: false
focusDelay: 350
moveFactor: 20
targetZoom: 1

kwin4_effect_sessionquit:
pluginId: kwin4_effect_sessionquit
isActiveFullScreenEffect: false

kwin4_effect_scale:
pluginId: kwin4_effect_scale
isActiveFullScreenEffect: false

kwin4_effect_frozenapp:
pluginId: kwin4_effect_frozenapp
isActiveFullScreenEffect: false

kwin4_effect_dialogparent:
pluginId: kwin4_effect_dialogparent
isActiveFullScreenEffect: false

desktopgrid:
activeView: 
gridRows: 1
gridColumns: 1
animationDuration: 300
layout: 1
partialActivationFactor: 0
gestureInProgress: false
showAddRemove: true
desktopNameAlignment: 0
desktopLayoutMode: 0
customLayoutRows: 2

highlightwindow:

overview:
activeView: 
animationDuration: 300
layout: 1
ignoreMinimized: false
blurBackground: true
partialActivationFactor: 0
gestureInProgress: false
searchText: 

tileseditor:
activeView: 
animationDuration: 200

windowview:
activeView: 
animationDuration: 300
layout: 1
ignoreMinimized: false
mode: 0
partialActivationFactor: 0
gestureInProgress: false
searchText: 

blendchanges:

startupfeedback:
type: 3

kscreen:

Loaded Plugins:
---------------
kwin5_plugin_krunner
kwin5_plugin_nightcolor

Available Plugins:
------------------
kwin5_plugin_buttonrebinds
kwin5_plugin_colord
kwin5_plugin_krunner
kwin5_plugin_nightcolor
gerritdevriese commented 11 months ago

Can you try the latest version and see if you have the same issue?

otzen commented 11 months ago

I tried "latest version" as the latest release 2.1.1 - No change.

I then tried to clone and build as described in readme.md. And this appears to have made a difference, to early to say it is fixed, need more test time, reboot/slep-awake.. and all that stuff. But right now in the moment after having just build/installed it the cpu load is normal :-) There where a few warnings and errors during build-install. But they are maybe normal, I include them below anyway, note the are some danish phrases in the dump, i will provide a translation below the console dump.

martin@frink2:~/src$ git clone https://github.com/gerritdevriese/kzones
cd kzones && ./build
Cloning into 'kzones'...
remote: Enumerating objects: 351, done.
remote: Counting objects: 100% (121/121), done.
remote: Compressing objects: 100% (85/85), done.
remote: Total 351 (delta 48), reused 83 (delta 29), pack-reused 230
Receiving objects: 100% (351/351), 4.92 MiB | 16.29 MiB/s, done.
Resolving deltas: 100% (144/144), done.
updating: contents/ (stored 0%)
updating: contents/config/ (stored 0%)
updating: contents/config/main.xml (deflated 82%)
updating: contents/ui/ (stored 0%)
updating: contents/ui/main.qml (deflated 78%)
updating: contents/ui/config.ui (deflated 84%)
updating: metadata.desktop (deflated 45%)
updating: contents/ui/components/ (stored 0%)
updating: contents/ui/components/Shadow.qml (deflated 41%)
updating: contents/ui/components/Indicator.qml (deflated 65%)
Fejl: Installation af /home/martin/src/kzones/KZones.kwinscript mislykkedes: /home/martin/.local/share/kwin/scripts/kzones findes allerede
Opgraderer pakke fra fil: /home/martin/src/kzones/KZones.kwinscript
Opgradering af /home/martin/src/kzones/KZones.kwinscript gennemført
martin@frink2:~/src/kzones$ kwin_xkbcommon: XKB: inet:323:58: unrecognized keysym "XF86EmojiPicker"
kwin_xkbcommon: XKB: inet:324:58: unrecognized keysym "XF86Dictate"
Module 'org.kde.kwin.decoration' does not contain a module identifier directive - it cannot be protected from external registrations.
OpenGL vendor string:                   Intel
OpenGL renderer string:                 Mesa Intel(R) HD Graphics 630 (KBL GT2)
OpenGL version string:                  4.6 (Compatibility Profile) Mesa 23.0.4-0ubuntu1~23.04.1
OpenGL shading language version string: 4.60
Driver:                                 Intel
GPU class:                              Kaby Lake
OpenGL version:                         4.6
GLSL version:                           4.60
Mesa version:                           23.0.4
X server version:                       1.21.1
Linux kernel version:                   6.2
Requires strict binding:                yes
GLSL shaders:                           yes
Texture NPOT support:                   yes
Virtual Machine:                        no
qt.qpa.xcb: QXcbConnection: XCB error: 3 (BadWindow), sequence: 6563, resource id: 4201973, major code: 18 (ChangeProperty), minor code: 0
qt.qpa.xcb: QXcbConnection: XCB error: 3 (BadWindow), sequence: 6567, resource id: 77605098, major code: 18 (ChangeProperty), minor code: 0
qt.qpa.xcb: QXcbConnection: XCB error: 3 (BadWindow), sequence: 6580, resource id: 4202017, major code: 18 (ChangeProperty), minor code: 0
qt.qpa.xcb: QXcbConnection: XCB error: 3 (BadWindow), sequence: 12482, resource id: 71303185, major code: 18 (ChangeProperty), minor code: 0

Fejl: Installation af /home/martin/src/kzones/KZones.kwinscript mislykkedes: /home/martin/.local/share/kwin/scripts/kzones findes allerede

Translates to:

Error: Installation of /home/martin/src/kzones/KZones.kwinscript failed: /home/martin/.local/share/kwin/scripts/kzones already exists

Opgraderer pakke fra fil: /home/martin/src/kzones/KZones.kwinscript

Translates to:

Upgrading package fro9m file: /home/martin/src/kzones/KZones.kwinscript

Opgradering af /home/martin/src/kzones/KZones.kwinscript gennemført

Translates to:

Upgrading of /home/martin/src/kzones/KZones.kwinscript completed

gerritdevriese commented 11 months ago

There is no version 2.1.1 of KZones 😮 I'm guessing you are using this fork: https://store.kde.org/p/1947784, even though it is called "KZones 2", it is not the same and is based on an older version.

@codeswhite Would you be so kind as to remove your fork from the KDE store? Your contributions were merged into the main branch, so two separate versions are not needed anymore and confuses people.

@otzen Those build warnings are fine, glad it's working for you now 🙂

otzen commented 11 months ago

2 weeks and have not seen the issue, so it is definitely gone. Thanks, for the help, and the great app/script.