Bug 376485 - High CPU usage with Nvida native driver
Summary: High CPU usage with Nvida native driver
Status: RESOLVED INTENTIONAL
Alias: None
Product: plasmashell
Classification: Plasma
Component: general (show other bugs)
Version: 5.9.1
Platform: openSUSE Linux
: NOR normal
Target Milestone: 1.0
Assignee: David Edmundson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-02-14 16:25 UTC by Marcin Bajor
Modified: 2017-02-20 12:38 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Perf Nvidia (193.19 KB, image/png)
2017-02-16 23:05 UTC, Marcin Bajor
Details
Perf Intel (163.06 KB, image/png)
2017-02-16 23:06 UTC, Marcin Bajor
Details
50s Nvidia apitrace (148.46 KB, image/png)
2017-02-17 23:38 UTC, Marcin Bajor
Details
30s Nvidia apitrace (140.54 KB, image/png)
2017-02-17 23:39 UTC, Marcin Bajor
Details
50s Intel apitrace (159.22 KB, image/png)
2017-02-17 23:40 UTC, Marcin Bajor
Details
30s Intel apitrace (170.70 KB, image/png)
2017-02-17 23:40 UTC, Marcin Bajor
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marcin Bajor 2017-02-14 16:25:06 UTC
Hi,
I've noticed that plasmashell consumes 100% one of cpu core, but only when "progress" animation is played. I mean animation on notification widget. This animation is much faster when I use Nvidia GPU with native drivers than Intel graphics card. There is no problem when i use Intel graphics card.
This video shows the problem (note that cpu temperature increases in widget):
https://youtu.be/RGewsImUuTI

Kind Regards
Marcin Bajor
Comment 1 Marcin Bajor 2017-02-16 23:05:24 UTC
Created attachment 104062 [details]
Perf Nvidia

Attached report from perf profiling tool plasmashell+nvidia native driver
Comment 2 Marcin Bajor 2017-02-16 23:06:01 UTC
Created attachment 104063 [details]
Perf Intel

Attached report from perf profiling tool plasmashell+intel driver
Comment 3 David Edmundson 2017-02-17 11:13:48 UTC
That shows us nothing.

There's 1.8% of CPU time spent in renderMergeBatches in the nvidia one and 1.4% in intel.


A .4% difference in CPU time isn't going to be significant difference worth investigating even if you had some information to go on.

Exactly what perf command did you run? 
If it's really an nvidia only issue, apitrace might be more useful.
Comment 4 Marcin Bajor 2017-02-17 13:54:41 UTC
The difference is QSGRenerThread uses more CPU time when Nvidia is used.

> Exactly what perf command did you run? 
perf record plasmashell
with native nvidia drivers and intel. For clarity: I have 2 graphics card on my laptop.

> If it's really an nvidia only issue, apitrace might be more useful.
apitrace trace --api gl plasmashell
is enough?
Comment 5 David Edmundson 2017-02-17 16:33:17 UTC
>The difference is QSGRenerThread uses more CPU time when Nvidia is used.

Well that's a given. On intel there is no render thread.

you can force nvidia in there too if you run QSG_RENDER_LOOP=basic

that apitrace line should be fine.
Comment 6 Marcin Bajor 2017-02-17 23:38:44 UTC
Created attachment 104082 [details]
50s Nvidia apitrace

Command:
timeout 50s ./apitrace trace --api gl plasmashell
Comment 7 Marcin Bajor 2017-02-17 23:39:34 UTC
Created attachment 104083 [details]
30s Nvidia apitrace

Command:
timeout 30s ./apitrace trace --api gl plasmashell
Comment 8 Marcin Bajor 2017-02-17 23:40:12 UTC
Created attachment 104084 [details]
50s Intel apitrace

Command:
timeout 50s ./apitrace trace --api gl plasmashell
Comment 9 Marcin Bajor 2017-02-17 23:40:47 UTC
Created attachment 104085 [details]
30s Intel apitrace

Command:
timeout 30s ./apitrace trace --api gl plasmashell
Comment 10 Marcin Bajor 2017-02-17 23:45:01 UTC
I attached profiling results on Nvidia and Intel.
Steps:
1. Start copy files in dolphin
2. Run command:
timeout [t]s ./apitrace trace --api gl plasmashell
where t = 30s, 50s

Because of attachments limit all files are available here:
https://mega.nz/#F!h8pgmRCQ!0F93jY7rTDiGIFWy8Nay4Q
Comment 11 Marcin Bajor 2017-02-20 12:38:06 UTC
Closing the issue. I tested CPU usage on other OpenGl applications and I think it's general not plasmashell issue.