Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Power of 0 returned for all processes on Ubuntu 22.04.1 LTS #214

Closed
netzdoktor opened this issue Sep 8, 2022 · 5 comments
Closed

Power of 0 returned for all processes on Ubuntu 22.04.1 LTS #214

netzdoktor opened this issue Sep 8, 2022 · 5 comments
Labels
bug Something isn't working

Comments

@netzdoktor
Copy link

Bug description

On my system, running scaphandre stdout -t 15 returns 0 W for all processes.

To Reproduce

> scaphandre stdout -t 15
Scaphandre stdout exporter
Sending ⚡ metrics
Measurement step is: 2s
Host:   0 W
        package         core            uncore
Top 5 consumers:
Power           PID     Exe
No processes found yet or filter returns no value.
------------------------------------------------------------

Host:   0 W
        package         core            uncore
Top 5 consumers:
Power           PID     Exe
0 W     2748    "gnome-shell"
0 W     12498   "Isolated Web Co"
0 W     13      "rcu_sched"
0 W     147     "kworker/3:1H-events_highpri"
0 W     840     "kworker/u16:14-kcryptd/253:0"
------------------------------------------------------------

Host:   0 W
        package         core            uncore
Top 5 consumers:
Power           PID     Exe
0 W     2748    "gnome-shell"
0 W     1463    "containerd"
0 W     3172    "Xwayland"
0 W     3407    "gnome-terminal-"
0 W     1       "systemd"
------------------------------------------------------------

Expected behavior

The power values should be non-zero.

Screenshots

None

Environment

> lsb_release -d
Description: Ubuntu 22.04.1 LTS
> uname -r
5.15.0-47-generic
> lsmod | grep intel_rapl
intel_rapl_msr         20480  0
intel_rapl_common      40960  2 intel_rapl_msr,processor_thermal_rapl
> find rapl /usr
/usr/bin/rapl-info
/usr/bin/rapl-set
/usr/share/man/man1/rapl-set.1.gz
/usr/share/man/man1/rapl-info.1.gz
/usr/local/share/man/man1/energymon-rapl-idle-power.1
/usr/local/share/man/man1/energymon-rapl-overhead.1
/usr/local/share/man/man1/energymon-rapl-cmd-profile.1
/usr/local/share/man/man1/energymon-rapl-power-poller.1
/usr/local/share/man/man1/energymon-rapl-info.1
/usr/local/share/man/man1/energymon-rapl-file-provider.1
/usr/local/include/energymon/energymon-rapl.h
/usr/local/bin/energymon-rapl-power-poller
/usr/local/bin/energymon-rapl-cmd-profile
/usr/local/bin/energymon-rapl-overhead
/usr/local/bin/energymon-rapl-info
/usr/local/bin/energymon-rapl-file-provider
/usr/local/bin/energymon-rapl-idle-power
/usr/local/lib/libenergymon-rapl.a
/usr/local/lib/pkgconfig/energymon-rapl.pc
/usr/lib/modules/5.10.0-1057-oem/kernel/arch/x86/events/rapl.ko
/usr/lib/modules/5.10.0-1057-oem/kernel/drivers/powercap/intel_rapl_common.ko
/usr/lib/modules/5.10.0-1057-oem/kernel/drivers/powercap/intel_rapl_msr.ko
/usr/lib/modules/5.15.0-47-generic/kernel/arch/x86/events/rapl.ko
/usr/lib/modules/5.15.0-47-generic/kernel/drivers/powercap/intel_rapl_msr.ko
/usr/lib/modules/5.15.0-47-generic/kernel/drivers/powercap/intel_rapl_common.ko
/usr/lib/modules/5.15.0-47-generic/kernel/drivers/thermal/intel/int340x_thermal/processor_thermal_rapl.ko
/usr/lib/modules/5.15.0-46-generic/kernel/arch/x86/events/rapl.ko
/usr/lib/modules/5.15.0-46-generic/kernel/drivers/powercap/intel_rapl_msr.ko
/usr/lib/modules/5.15.0-46-generic/kernel/drivers/powercap/intel_rapl_common.ko
/usr/lib/modules/5.15.0-46-generic/kernel/drivers/thermal/intel/int340x_thermal/processor_thermal_rapl.ko
/usr/src/linux-headers-5.15.0-46/include/linux/intel_rapl.h
/usr/src/linux-headers-5.15.0-47/include/linux/intel_rapl.h
/usr/src/linux-headers-5.10.0-1057-oem/include/config/intel/rapl.h
/usr/src/linux-headers-5.10.0-1057-oem/include/config/intel/rapl
/usr/src/linux-headers-5.15.0-47-generic/include/config/PERF_EVENTS_INTEL_RAPL
/usr/src/linux-headers-5.15.0-46-generic/include/config/PERF_EVENTS_INTEL_RAPL
/usr/src/linux-headers-5.15.0-47-generic/include/config/INTEL_RAPL
/usr/src/linux-headers-5.15.0-46-generic/include/config/INTEL_RAPL
/usr/src/linux-headers-5.10.0-1057-oem/include/config/perf/events/intel/rapl.h
/usr/src/linux-headers-5.10.0-1057-oem/include/config/proc/thermal/mmio/rapl.h
/usr/src/linux-headers-5.15.0-47-generic/include/config/INTEL_RAPL_CORE
/usr/src/linux-headers-5.15.0-47-generic/include/config/PROC_THERMAL_MMIO_RAPL
/usr/src/linux-headers-5.15.0-46-generic/include/config/INTEL_RAPL_CORE
/usr/src/linux-headers-5.15.0-46-generic/include/config/PROC_THERMAL_MMIO_RAPL
/usr/src/linux-oem-5.10-headers-5.10.0-1057/include/linux/intel_rapl.h

Additional context

None

@netzdoktor netzdoktor added the bug Something isn't working label Sep 8, 2022
@bpetit
Copy link
Contributor

bpetit commented Sep 8, 2022

Hi,

This is most the time a problem of permissions in /sys/class/powercap. Could you run the init.sh script at the root of the project then retry ?

@netzdoktor
Copy link
Author

Indeed, sudo scaphandre did the trick. I wonder whether replying with 0W is the proper handling of missing permissions. It's not completely misleading (as 0W is obviously non-sense), but program failure or more elaborate output would be more sensible?

If you agree, I could help implement it, as I have some Rust experience.

@demeringo
Copy link
Contributor

Makes me think of #137

@bpetit bpetit added this to the Release v1.0.0 milestone Aug 14, 2023
@bpetit
Copy link
Contributor

bpetit commented Aug 14, 2023

Hi !

It's been a long time now but if you're still up to propose a PR on this @netzdoktor it would be more than welcome !

Otherwise I might try something in the direction you proposed.

Btw @demeringo I think this one is not so related to #137 as it is more about RAPL support on the CPU. No such support gives an explicit error, while the behavior described here is more silent as described @netzdoktor and returns 0 :)

@bpetit
Copy link
Contributor

bpetit commented Dec 15, 2023

I close the issue as the latest code in dev branch includes warnings messages when permissions are not okay.

It doesn't make the app crash, but makes the problem pretty obvious now.

We could open a new issue afterwards if we realize making the program crash in such case is a way better option.

@bpetit bpetit closed this as completed Dec 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Previous releases
Development

No branches or pull requests

3 participants