Bug 30482 - KDE/Plasma flicker
Summary: KDE/Plasma flicker
Status: RESOLVED WORKSFORME
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: Cauldron
Hardware: All Linux
Priority: Normal normal
Target Milestone: ---
Assignee: Mageia Bug Squad
QA Contact:
URL:
Whiteboard:
Keywords: NEEDINFO
Depends on:
Blocks:
 
Reported: 2022-05-26 18:26 CEST by Pierre Fortin
Modified: 2022-11-06 09:51 CET (History)
3 users (show)

See Also:
Source RPM:
CVE:
Status comment:


Attachments
screenshot of taskbar (90.79 KB, image/png)
2022-05-26 18:29 CEST, Pierre Fortin
Details
short video of running tasks flickering (564.06 KB, application/octet-stream)
2022-05-27 06:28 CEST, Pierre Fortin
Details
Example of window flickering (832.64 KB, application/octet-stream)
2022-05-27 06:38 CEST, Pierre Fortin
Details

Description Pierre Fortin 2022-05-26 18:26:49 CEST
Description of problem: I've been suffering with flicker since mga8 on Dell M6800.  On my new Dell XPS 8950, flickering is still present; but faster.Operating System: Mageia 9
KDE Plasma Version: 5.24.4
KDE Frameworks Version: 5.93.0
Qt Version: 5.15.2
Kernel Version: 5.17.9-server-3.mga9 (64-bit)
Graphics Platform: X11
Processors: 20 × 12th Gen Intel® Core™ i7-12700K
Memory: 62.5 GiB of RAM
Graphics Processor: AMD Radeon RX 6600 XT


Will file bug with KDE; Mageia should understand the risks before releasing Cauldron as mga9. I wish this flickering didn't happen; but knowing it's Cauldron is easier to deal with than if it was Official Release mga9...

Version-Release number of selected component (if applicable):


How reproducible: always after some random elapsed time after reboot.


Steps to Reproduce:
1. use the system
2. runs fine for a while, then flickering starts; gets worse over time
3.

I will add info as it occurs. Initially, I'll add a screen shot with numbered comments.
Comment 1 Pierre Fortin 2022-05-26 18:29:15 CEST
Created attachment 13275 [details]
screenshot of taskbar

Two idnetical 27" monitors 1980x1024. Focus follows mouse (mouse precedence).

1. App Menu (just the blue) will flicker between normal color and slightly lighter. (rare; no idea how to trigger)

2. With only a konsole window on the desktop, dragging the konsole from one screen to the other starts the taskbar representation (dark and light blue) to flip colors back and forth at high speed. (new today; not easily reproducible. Once it starts, moving the konsole window triggers the flicker)

3. these icons (just the icon; not the background) will flicker randomly; moving mouse of the icons will often trigger this flickering. Colors change from normal to lighter to normal at high speed.

4. The running tasks in this screenshot only shows the konsole. By itself, moving the mouse into that area brings up the popup; moving the mouse over the popup starts the app icon flickering.
   when multiple app icons are in this area:
   a. the icons start doing a sideways dance, like they can't figure out where to sit -- musical chairs?
   b. the taskbar doesn't update anything or respond for several seconds (N seconds just now); even the clock, with seconds displayed does not update.
      (N = 6, 29, ... -- lack of clock updates is how I timed the issue)
5, systray:
   a. icons (not bacground) flicker 
   b. claws-mail usually updates these icons instantly; when the problems start, these icons only update when mouse focus leaves/enters the claws-mail window.
Comment 2 Pierre Fortin 2022-05-26 20:00:59 CEST
See also https://bugzilla.mozilla.org/show_bug.cgi?id=1746708

Firefox will start flickering after a while. Eventually, one window will become totally unusable until FF is restarted.  The flickering is random sized blocks in random areas of the window at random speeds...  Probably why there are so many flickering bugs: https://bugzilla.mozilla.org/buglist.cgi?short_desc=flicker&list_id=16097289&short_desc_type=allwordssubstr&query_format=advanced&classification=Client%20Software&classification=Developer%20Infrastructure&classification=Components&classification=Server%20Software&classification=Other&resolution=---

I'm beginning to suspect there may be a resource limit or race condition at a very low level (X11? kernel?). 

Switching desktops, the Firefox icon in the running apps of the taskbar was flickering; differently this time: the right 1/2 was doing a side-to-side dance, while the left 1/2 was stable.

Other than "flickering happens" there's virtually nothing that makes sense other than a race condition.  Watching my taskbar with running apps: konsole, claws-mail, oocald, emacs, kcalc, firefox nightly, shotcut, gimp -- oocalc and firefox icons are flickering. However, slow enough to see that they are taking turns, back and forth. When the flickering stops, so do clock seconds...  Hadn't noticed before: the lack of flickering on the taskbar is that it is not updating... Looks perfectly fine; but the clock is stuck at 13:47:52. As soon as I moved the mouse over this firefox window, the taskbar updated to 13:52:30 and went dormant again at 13:52:32.  Wow...  moving across window boundaries triggers taskbar activity.  Right now, the clock can't decide if it's 13:54:46 or 13:54:47 -- the 6|7 is flickering so fast they're a blur, slowing down a bit every 2-3 seconds. 
Going to add a link to this bug on Mozilla
Comment 3 Pierre Fortin 2022-05-26 20:03:39 CEST
As soon as I moved the mouse over this firefox window, 
should read:
As soon as I moved the mouse over this firefox window's edge,
Comment 4 Lewis Smith 2022-05-26 21:00:30 CEST
Thank you for the report, which is obviously not going to be easy...

Please start by posting the output of:
 $ inxi -MSGxx

CC: (none) => lewyssmith

Comment 5 Pierre Fortin 2022-05-27 00:00:37 CEST
not easy is likely an understatement; but with over 300 such reports at Mozilla, we can hope.  Problems like this need much info; sometimes a weird symptom provides the clue...  After a reboot, all is good for a while; then the flickering starts slowly, getting worse... haven't tried a logout/login; but I'll try to do that now that the lockups are resolved after new BIOS.

Generally, the first signs of flickering are on firefox.

$ inxi -MSGxx
System:    Host: pf.pfortin.com Kernel: 5.17.9-server-3.mga9 x86_64 bits: 64 compiler: gcc v: 12.1.1 Desktop: MWM wm: kwin_x11 
           dm: LightDM, LXDM, SDDM Distro: Mageia 9 mga9 
Machine:   Type: Desktop System: Dell product: XPS 8950 v: N/A serial: 14FDLM3 Chassis: type: 3 serial: 14FDLM3 
           Mobo: Dell model: 0R6PCT v: A01 serial: .14FDLM3.CNFCW0021L00P3. UEFI: Dell v: 1.2.1 date: 03/25/2022 
Graphics:  Device-1: Advanced Micro Devices [AMD/ATI] Navi 23 [Radeon RX 6600/6600 XT/6600M] vendor: Dell driver: amdgpu 
           v: kernel bus-ID: 0000:03:00.0 chip-ID: 1002:73ff 
           Device-2: YGTek Webcam type: USB driver: snd-usb-audio,uvcvideo bus-ID: 1-10:5 chip-ID: 1d6c:1278 
           Display: server: Mageia X.org 1.21.1.3 compositor: kwin_x11 driver: loaded: amdgpu,ati 
           unloaded: fbdev,modesetting,radeon,vesa resolution: 1: 1920x1080~60Hz 2: 1920x1080~60Hz s-dpi: 96 
           OpenGL: renderer: AMD Radeon RX 6600 XT (dimgrey_cavefish LLVM 14.0.0 DRM 3.44 5.17.9-server-3.mga9) 
           v: 4.6 Mesa 22.1.0 direct render: Yes
Comment 6 Pierre Fortin 2022-05-27 06:28:43 CEST
Created attachment 13277 [details]
short video of running tasks flickering

I've had no luck doing a video capture because mouse movement in/out of windows, taskbar, systray, etc impact the flicker. Decided to use my phone and finally got a short video (under 1MB) of one set of symptoms.  In this case, the leftmost task (Welcome to Mageia) has the least movement. The action is right to left.  I have another video where the rightmost task is stable and the activity is on the left side.
Comment 7 Pierre Fortin 2022-05-27 06:38:23 CEST
Created attachment 13278 [details]
Example of window flickering

This is of firefox nightly which is usually the first clue flickering is about to start spreading.  Firefox is by far and away the most affected by this issue.
Comment 8 Pierre Fortin 2022-05-27 07:10:24 CEST
Beginning to wonder if the clock might be a clue...  The date doesn't move; but just noticed the time alternating between 0:43:01 and 0:43:02... all of these characters flitter left/right.  Only the last character would have appeared to flip if this was fixed-sized font.   The other oddity is that this seems to indicate something is processed new/old/new/old/... -- in this case "time". 

No specific reason; but was curious about some commands:

$ free -b
               total        used        free      shared  buff/cache   available
Mem:     67155083264 15221854208  5414002688  1019277312 46519226368 50166956032
Swap:     4293931008     5767168  4288163840

$ df -h --type=tmpfs
Filesystem      Size  Used Avail Use% Mounted on
tmpfs            32G   16K   32G   1% /dev/shm
tmpfs            32G   11M   32G   1% /run
tmpfs            32G  453M   31G   2% /tmp
tmpfs           6.3G  316K  6.3G   1% /run/user/1000
Comment 9 sturmvogel 2022-05-27 09:35:06 CEST
There are many reports about RX 6600 XT screen flickering. Did you try to disable AMD FreeSync?
Comment 10 Pierre Fortin 2022-05-27 18:33:39 CEST
Looks like that's not even a choice..

LOL  System was offered with NVIDIA card; but I special ordered with the only (in stock) available AMD card because "AMD has better Linux support" -- apparently, "better" doesn't mean perfect or even good...  :)

Was not aware of FreeSync. Referring to:
https://www.amd.com/en/support/kb/faq/gpu-754#faq-Enabling/Disabling-AMD-FreeSync 

>>FreeSync via HDMI is not supported for this feature. Only DP FreeSync displays will work.

Connections were HDMI and DP; card has 1 HDMI and 3 DP ports. The DP ports are too close for cables to fit, so now displays are on DP-0(primary; right) and DP-2(left)

looks like FreeSync is not available anyway:

>>In multi-display configurations, FreeSync will NOT be engaged (even if both FreeSync displays are identical)

Multi, identical displays.

$ DISPLAY=:0 xrandr --prop | grep -i sync
gives no putput; even if AMD implies I should see:
>>freesync_capable
>>    0 = display does not support FreeSync
>>    1 = display supports FreeSync
>>freesync
>>    0 = FreeSync is currently disabled
>>    1 = FreeSync is currently enabled

System settings>Display Configuration>Compositor>Tearing prevention("vsync") is set to Automatic
Comment 11 Pierre Fortin 2022-05-30 09:54:21 CEST
After nearly 3 days, with both monitors on DP ports, system seems quite stable now.  Beginning to look like the AMD video card doesn't handle HDMI very well...
Comment 12 Pierre Fortin 2022-05-30 17:47:51 CEST
So far, so good... The initial flickering was affecting Firefox on my Dell M6800 laptop. The issue was really bad on the new Dell XPS 8950; but switching one monitor from HDMI to DP still appears to have resolved the flickering for me... The other monitor was always on DP port; but was impacted too. Not using HDMI appears to have resolved flickering on both screens... Still too early to be 100% certain though.
Comment 13 Pierre Fortin 2022-06-10 14:31:56 CEST
Sigh...  flickering still exists; though it's slowly revealing some of its hints...

Flickering slowly begins after system has been running for a while; and doing intensive work.  I was running a data processing script that took nearly 48 hours to complete and pushed the limits of 64GB memory, causing some swapping.

 top - 08:10:01 up 13 days, 21:13, 45 users,  load average: 1.15, 1.21, 1.20
Tasks: 635 total,   1 running, 632 sleeping,   0 stopped,   2 zombie
%Cpu(s):  1.1 us,  1.0 sy,  0.1 ni, 97.8 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
MiB Mem :  64044.1 total,   1892.1 free,  12371.3 used,  49780.7 buff/cache
MiB Swap:   4095.0 total,   2397.9 free,   1697.1 used.  50577.7 avail Mem 

Looks like most of 64GB is in use which doesn't make sense.  Maybe the system gets confused about what is swapped/resident?

In one case, an emacs session was quite confused about its memory residency. It would flicker, keystrokes would take many seconds (up to at least 15 seconds) to respond.  Killed it and re-opened with same file and OK.

Just now, I had to replicate a konsole with about 10 tabs because its flickering was uncontrollable. htop was running in one tab; repaints often required that I move the window to repaint the entire tab. One tab's visual display flickered on/off (there/not there).

Shut down most running apps and [h]top still report most memory still in use:
top - 08:25:51 up 13 days, 21:29, 45 users,  load average: 0.66, 0.90, 0.97
Tasks: 612 total,   1 running, 609 sleeping,   0 stopped,   2 zombie
%Cpu(s):  0.3 us,  1.2 sy,  0.0 ni, 98.6 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
MiB Mem :  64044.1 total,   4017.9 free,  10195.2 used,  49831.0 buff/cache
MiB Swap:   4095.0 total,   2627.7 free,   1467.3 used.  52767.5 avail Mem 

Occasionally, the running app icons on the taskbar flicker back and forth like an app is adding/removing itself from the taskbar at high speed.  

When I reboot, the symptoms clear up for a while.  I have another 64GB on order (arriving today); since this will require a reboot, will do that later...  If all that new memory stops the flickering, then it may be safe to assume swapping may be at least partially responsible for this flickering...
Comment 14 Pierre Fortin 2022-06-10 16:58:39 CEST
Flickering and general instability; so gave up and rebooted...  This is what top looks like immediately after bootup with 10 desktops and one konsole on each:

top - 10:50:51 up 3 min, 12 users,  load average: 0.79, 1.17, 0.57
Tasks: 473 total,   1 running, 471 sleeping,   0 stopped,   1 zombie
%Cpu(s):  0.1 us,  0.1 sy,  0.0 ni, 99.8 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
MiB Mem :  64044.0 total,  60045.1 free,   1779.3 used,   2219.6 buff/cache
MiB Swap:   4095.0 total,   4095.0 free,      0.0 used.  61475.6 avail Mem 

This is pretty close to all I had left running before the reboot; so the system, when this problem starts, appears to be bleeding memory -- triggered by swapping?  Hopefully this will help figure out what's going on...  Once the extra 64GB arrives and installed, if no swapping = no problems; that'll be a pretty good indicator...  time will tell...
Comment 15 Marja Van Waes 2022-07-03 22:54:49 CEST
The summary of this report gives the impression that you don't have the flickering when using a different Desktop Environment, is that true?

If you didn't yet try, then please do.

And what about using a different Display Manager? Which one are you currently using, btw, SDDM?

CC: (none) => marja11
Keywords: (none) => NEEDINFO

Comment 16 Pierre Fortin 2022-07-04 00:46:37 CEST
I never tried an alternate DE beyond a few minutes, mainly because I'm swamped with work. The flickering is less severe since I upgraded from 64 to 128GB of RAM. I have to restart Firefox Nightly soon, it's the worst application for flickering; but usually only one or two of its 20+ windows I have open with many tabs each.

My system is pretty much a default install (KDE/Plasma) with some minor tweaks (focus follows mouse); 10 dual-monitor desktops, 29TB+ of storage.  

I honestly don't know when I can find time to try another DE since the flickering can take several days to show up...
Comment 17 Pierre Fortin 2022-09-06 14:31:48 CEST
Reported to KDE: https://bugs.kde.org/show_bug.cgi?id=458771
Comment 18 Pierre Fortin 2022-09-14 04:43:11 CEST
Firefox was so erratic tonight, I tried Chrome...  Same issue.  

Looks like I'll have to try another desktop...  :(
Comment 19 Felix Miata 2022-10-01 18:39:47 CEST
TDE, forked long ago from KDE3, is built for Mageia 8. Several of my Cauldrons run it. It resembles Plasma a lot functionally, may not be hard to endure as an alternate to Plasma.

CC: (none) => mrmazda

Comment 20 Lewis Smith 2022-10-06 22:02:14 CEST
(In reply to Pierre Fortin from comment #18)
> Looks like I'll have to try another desktop...  :(
Always a good idea. If you do not like the simpler ones (LXDE, Xfce), try Mate (many of us like it) or Cinnamon. This is not to say that it will solve the problem, but it is worth a try.

(In reply to Felix Miata from comment #19)
> TDE, forked long ago from KDE3, is built for Mageia 8. Several of my
> Cauldrons run it.
I cannot find it in Cauldron... Can you give details?
Comment 21 Felix Miata 2022-10-06 22:24:32 CEST
TDE has some sort of license or ownership issue that keeps it out of individual distros' own repos.

https://wiki.trinitydesktop.org/Mageia_Trinity_Repository_Installation_Instructions

Flicker seems to be a common problem with roots in kernel modules for most situations. Have you tried amd_iommu=off for AMD GPUs or intel_iommu=off for Intel IGPs?
Comment 22 Pierre Fortin 2022-10-07 01:50:22 CEST
(In reply to Felix Miata from comment #21)
> Have you tried amd_iommu=off for AMD GPUs or intel_iommu=off for
> Intel IGPs?

Never heard of it. Where do I specify this?  Hope it doesn't require building anything; I'm swamped with work. I apply updates; but save reboots for when flicker becomes unbearable.  To avoid reboots, I can sometimes clear flicker on Firefox windows by dragging all the tabs onto a new window (see my "container" comment at https://bugs.kde.org/show_bug.cgi?id=458771)
Comment 23 Felix Miata 2022-10-07 02:24:12 CEST
Those are kernel cmdline parameters which for testing purposes one appends to Grub's linu lines after striking the E key in its menu.
https://www.kernel.org/doc/Documentation/admin-guide/kernel-parameters.txt tersely explains them.
If found useful, add them to GRUB_CMDLINE_LINUX_DEFAULT= in /etc/default/grub, then regenerate grub.cfg.
Comment 24 Pierre Fortin 2022-11-06 09:51:19 CET
Around when kernel 6 was installed, system stabilized; didn't want to jinx it be prematurely reporting flickering appears to be resolved.  Only bug 31080 would keep me from giving Cauldron a thumbs up now.

Resolution: (none) => WORKSFORME
Status: NEW => RESOLVED


Note You need to log in before you can comment on or make changes to this bug.