intel-gpu-overlay is showing insane power consumption amounts
https://bugs.freedesktop.org/show_bug.cgi?id=105712
Bug ID: 105712
Summary: intel-gpu-overlay is showing insane power consumption
amounts
Product: DRI
Version: unspecified
Hardware: x86-64 (AMD64)
OS: Linux (All)
Status: NEW
Severity: normal
Priority: medium
Component: IGT
Assignee: [email protected]
Reporter: [email protected]
Created attachment 138312
--> https://bugs.freedesktop.org/attachment.cgi?id=138312&action=edit
Screenshot showing intel-gpu-overlay in Xnest
The program intel-gpu-overlay from intel-gpu-tools is showing very high numbers of power consumption. It is showing values as high as 60 GW of power (60000000000000 mW). Comparing the values to versions that were OK previously (intel-gpu-tools 1.18 shows proper values), it appears that there are many additional numbers that should be in the decimal places, so that 60000000000000 mW would be 6000,0000000000 mW, or 6 W (which, usually, is the maximum I've seen so far).
This is happening both with intel-gpu-tools 1.22 and with the latest git (c2ee9077).
-- chipset: Intel Core i3-6100U
-- system architecture: 64-bit
-- xf86-video-intel: 2:2.99.917+git20171229-1
-- xserver: 2:1.19.6-1ubuntu3
-- mesa: 18.1.0-devel (git-903e9952fb)
-- libdrm: 2.4.91-2
-- kernel: 4.16.0-rc6
-- Linux distribution: Xubuntu 18.04 (Development branch) -- Machine or mobo model: Lenovo Ideapad 310-14ISK 80UG -- Display connector: eDP and VGA
Signature · 2 lines
You are receiving this mail because: You are the assignee for the bug.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
https://bugs.freedesktop.org/show_bug.cgi?id=105712
--- Comment #1 from Chris Wilson <[email protected]> --- Please try drm-tip as the interface intel-gpu-overlay uses has finally been upstreamed, hopefully it's just that.
Signature · 2 lines
You are receiving this mail because: You are the assignee for the bug.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
https://bugs.freedesktop.org/show_bug.cgi?id=105712
--- Comment #2 from [email protected] ---
I suppose drm-tip is this: https://cgit.freedesktop.org/drm-tip
I have tried to use that kernel but intel-gpu-overlay is still showing the super high values. Both older versions of intel-gpu-overlay and turbostat show sane values.
Signature · 2 lines
You are receiving this mail because: You are the assignee for the bug.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
https://bugs.freedesktop.org/show_bug.cgi?id=105712
--- Comment #3 from Chris Wilson <[email protected]> --- Ok, try changing intel-gpu-tools:
overlay/power.c +2 -1
@@ -116,7 +116,8 @@ int power_init(struct power *power)memset (power,0 ,sizeof (*power)); - power->fd =igt_perf_open (rapl_type_id (),rapl_gpu_power ()); + power->fd =-1 ; +//power->fd = igt_perf_open(rapl_type_id(), rapl_gpu_power()); if (power->fd >=0 ) { power->rapl_scale =rapl_gpu_power_scale ();
Signature · 2 lines
You are receiving this mail because: You are the assignee for the bug.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
https://bugs.freedesktop.org/show_bug.cgi?id=105712
--- Comment #4 from [email protected] ---
With this change it is showing the values as expected, 350 mW instead of 3500000000000 mW.
Signature · 2 lines
You are receiving this mail because: You are the assignee for the bug.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
https://bugs.freedesktop.org/show_bug.cgi?id=105712
--- Comment #5 from Chris Wilson <[email protected]> --- Add a couple of printfs,
overlay/power.c +1 -0
@@ -117,8 +117,12 @@ int power_init(struct power *power)memset (power,0 ,sizeof (*power)); power->fd =igt_perf_open (rapl_type_id (),rapl_gpu_power ()); + fprintf(stderr, "rapl_type_id()=%"PRIx64",
rapl_gpu_power()=%"PRIx64"\n",
+ rapl_type_id(), rapl_gpu_power());
if (power->fd >= 0) {
power->rapl_scale = rapl_gpu_power_scale();+ fprintf(stderr, "rapl_gpu_power_scale()=%f\n",
+ rapl_gpu_power_scale());
if (power->rapl_scale != NAN) {
power->rapl_scale *= 1e3; /* from nano to micro */and run with -f (so that it doesn't detach and we can see the output).
Signature · 2 lines
You are receiving this mail because: You are the assignee for the bug.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
https://bugs.freedesktop.org/show_bug.cgi?id=105712
--- Comment #6 from [email protected] ---
The lines
fprintf(stderr, "rapl_type_id()=%"PRIx64",
rapl_gpu_power()=%"PRIx64"\n",
rapl_type_id(), rapl_gpu_power());made the overlay fail to build. I have changed that to (using lx is not perfect, but PRIx64 made it fail to build):
fprintf(stderr, "rapl_type_id()=%lx\n",rapl_type_id());
fprintf(stderr, "rapl_gpu_power()=%lx\n",rapl_gpu_power());which should result in the intended output. It was:
rapl_type_id()=d
rapl_gpu_power()=4
rapl_gpu_power_scale()=2,000000
Signature · 2 lines
You are receiving this mail because: You are the assignee for the bug.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
https://bugs.freedesktop.org/show_bug.cgi?id=105712
--- Comment #7 from Chris Wilson <[email protected]> --- And for completeness: cat /sys/devices/power/events/energy-gpu.scale
Signature · 2 lines
You are receiving this mail because: You are the assignee for the bug.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
https://bugs.freedesktop.org/show_bug.cgi?id=105712
--- Comment #8 from [email protected] ---
$ sudo cat /sys/devices/power/events/energy-gpu.scale 2.3283064365386962890625e-10
Signature · 2 lines
You are receiving this mail because: You are the assignee for the bug.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
https://bugs.freedesktop.org/show_bug.cgi?id=105712
--- Comment #9 from Chris Wilson <[email protected]> --- Created attachment 138378
--> https://bugs.freedesktop.org/attachment.cgi?id=138378&action=edit
Use setlocale("C") around strtod
Please try the attached patch.
Signature · 2 lines
You are receiving this mail because: You are the assignee for the bug.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
https://bugs.freedesktop.org/show_bug.cgi?id=105712
--- Comment #10 from [email protected] --- With this patch, the power consumption is shown correctly.
Signature · 2 lines
You are receiving this mail because: You are the assignee for the bug.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
[email protected]
Reviewed-by Tvrtko Ursulinhttps://bugs.freedesktop.org/show_bug.cgi?id=105712
Chris Wilson <[email protected]> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |FIXED--- Comment #11 from Chris Wilson <[email protected]> --- Thank you for the bug report and the invaluable testing.
commit 3fa0b027304ec28cd24b314349d3731b55dfcc0a (HEAD, upstream/master)
Author: Chris Wilson <[email protected]> Date: Tue Mar 27 15:20:51 2018 +0100
overlay: Call setlocale around strtod
strtod() is locale-dependent. The decimal conversion depends on the radix character ('.' for some of us like myself) varies by locale. As the kernel reports its values using the "C" locale, we need to switch to that when parsing; and switch back before reporting to the user.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105712
Signature · 2 lines
You are receiving this mail because: You are the assignee for the bug.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
https://bugs.freedesktop.org/show_bug.cgi?id=105712
Lakshmi <[email protected]> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |CLOSED
--- Comment #12 from Lakshmi <[email protected]> --- Closing this bug, as it was resolved/fixed.
Signature · 2 lines
You are receiving this mail because: You are the assignee for the bug.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel