Bug 404220

Summary: Animations move too fast under Optimus
Product: [Plasma] plasmashell Reporter: Dan Robinson <dlrobin874>
Component: generalAssignee: David Edmundson <kde>
Status: RESOLVED DUPLICATE    
Severity: minor CC: anton.bugs, dm.vl.ivanov, katyaberezyaka, nate, plasma-bugs
Priority: NOR    
Version: 5.14.5   
Target Milestone: 1.0   
Platform: Debian testing   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: QSG_INFO=1 plasmashell --replace
xrandr -q

Description Dan Robinson 2019-02-12 00:44:48 UTC
SUMMARY
Animations move too fast under Nvidia Optimus. Most noticeable is the spinner on the Breeze login screen but any other spinners or similar types of animations move way faster under Optimus than they do normally.


STEPS TO REPRODUCE
1. Acquire Optimus laptop, and configure PRIME offloading (I used the Debian wiki directions, use your distro of choice)
2. Load up Plasma
3. Observe things spinning too fast

SOFTWARE/OS VERSIONS
Debian Buster, Plasma 4.14.5, Frameworks 4.54.0, Qt 5.11.3

ADDITIONAL INFORMATION
I'm not sure what component this was so please fix it if I'm totally off. I'm not sure what's causing it so I went as generic as possible.
Comment 1 David Edmundson 2019-02-12 13:15:59 UTC
Please run QSG_INFO=1 plasmashell --replace and attach the log

Also output of "xrandr -q"
Comment 2 Dan Robinson 2019-02-13 01:40:21 UTC
Created attachment 118028 [details]
QSG_INFO=1 plasmashell --replace
Comment 3 Dan Robinson 2019-02-13 01:40:51 UTC
Created attachment 118029 [details]
xrandr -q
Comment 4 Christoph Feck 2019-02-15 17:29:13 UTC
Information was provided; changing status for inspection.
Comment 5 Anton 2019-06-07 03:12:57 UTC
This bug must be a high priority. 

kde: 5.15.5
qt: 5.12.3

"top" shows that "plasmashell" is using 100% of cpu while copying.
I was copying files using Delphin to a share drive (a bit slow) and that spinner makes my computer hot for no reason.

it is also annoying while starting any programm: the icon spins way to fast

An obvious workaround is to disable it in:
Notification Settings -> Information -> "Track file transfers and other jobs".
Comment 6 Anton 2019-06-07 03:34:50 UTC
Ok, I think I managed to find the root of the problem
It is a documented problem:
https://doc.qt.io/qt-5/qtquick-visualcanvas-scenegraph.html

"The threaded and windows render loops rely on the OpenGL implementation for throttling by requesting a swap interval of 1. Some graphics drivers allow users to override this setting and turn it off, ignoring Qt's request. Without blocking in the swap buffers operation (or elsewhere), the render loop will run animations too fast and spin the CPU at 100%. If a system is known to be unable to provide vsync-based throttling, use the basic render loop instead by setting QSG_RENDER_LOOP=basic in the environment"

I have managed to fix it by running:
QSG_RENDER_LOOP=basic plasmashell --replace
Comment 7 David Edmundson 2019-06-07 09:44:43 UTC
You can run "kcmshell5 qtquicksettings" to find a permanent config option for the render loop that will affect most apps
Comment 8 Nate Graham 2021-03-09 05:02:24 UTC
David, do you think this is the same issue/root cause as Bug 419421?
Comment 9 Nate Graham 2021-03-10 23:10:55 UTC

*** This bug has been marked as a duplicate of bug 390693 ***