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

Running scaphandre_linux returns "0 W" #351

Open
ionutbalosin opened this issue Jan 13, 2024 · 5 comments
Open

Running scaphandre_linux returns "0 W" #351

ionutbalosin opened this issue Jan 13, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@ionutbalosin
Copy link

Please see below the full details.

$ scaphandre_linux_amd64 -s powercap_rapl stdout

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	2599	"gnome-shell"
0 W	4704	"gnome-terminal-"
0 W	796	"systemd-oomd"
0 W	3612	"Xwayland"
0 W	1	"systemd"
------------------------------------------------------------

Host:	0 W
	package 	core		uncore
Top 5 consumers:
Power		PID	Exe
0 W	2599	"gnome-shell"
0 W	848	"dbus-daemon"
0 W	1116	"containerd"
0 W	4704	"gnome-terminal-"
0 W	1	"systemd"
------------------------------------------------------------
...

$ powercap-info -p intel-rapl

enabled: 1
Zone 0
  name: package-0
  enabled: 1
  max_energy_range_uj: 262143328850
  Constraint 0
    name: long_term
    power_limit_uw: 200000000
    time_window_us: 31981568
    max_power_uw: 55000000
  Constraint 1
    name: short_term
    power_limit_uw: 30000000
    time_window_us: 2440
    max_power_uw: 0
  Constraint 2
    name: peak_power
    power_limit_uw: 246000000
    max_power_uw: 0
  Zone 0:0
    name: core
    enabled: 0
    max_energy_range_uj: 262143328850
    Constraint 0
      name: long_term
      power_limit_uw: 0
      time_window_us: 976
  Zone 0:1
    name: uncore
    enabled: 0
    max_energy_range_uj: 262143328850
    Constraint 0
      name: long_term
      power_limit_uw: 0
      time_window_us: 976
Zone 1
  name: psys
  enabled: 1
  max_energy_range_uj: 262143328850
  Constraint 0
    name: long_term
    power_limit_uw: 280000000
    time_window_us: 999424
  Constraint 1
    name: short_term
    power_limit_uw: 280000000
    time_window_us: 976

$ cat /proc/cpuinfo

model		: 183
model name	: 13th Gen Intel(R) Core(TM) i9-13900HX

$ uname -a
Linux ubuntu 6.5.0-14-generic #14-Ubuntu SMP PREEMPT_DYNAMIC Tue Nov 14 14:59:49 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

Is this not supported on my CPU?

Thanks
Ionut Balosin

@ionutbalosin ionutbalosin added the bug Something isn't working label Jan 13, 2024
@jnioche
Copy link

jnioche commented Jan 28, 2024

Same here on Linux Mint running on

model name : 12th Gen Intel(R) Core(TM) i7-12700H

@jnioche
Copy link

jnioche commented Feb 15, 2024

Version 1.0 gives a useful error message

scaphandre::sensors: Could'nt read record from /sys/class/powercap/intel-rapl:0/energy_uj, error was: Os { code: 13, kind: PermissionDenied, message: "Permission denied" }

Changing the rights with sudo chmod -R a+r /sys/class/powercap/intel-rapl fixed the issue
See mlco2/codecarbon#244

@bpetit I will check the README and docs later on + submit a PR to add the instructions if missing

edit - I can see now that the init.sh script exists for that very purpose and that its use is documented both in sensor-powercap_rapl.md and troubleshooting.md

@ionutbalosin can you please check whether calling init.sh fixes the issue for you?

@bpetit bpetit added this to General Jun 19, 2024
@bpetit bpetit moved this to Triage in General Jun 19, 2024
@JMLX42
Copy link

JMLX42 commented Jul 23, 2024

@jnioche I am running scaphandre on a K8S cluster following this documentation:

https://hubblo-org.github.io/scaphandre-documentation/tutorials/kubernetes.html

I have followed this workaround: mlco2/codecarbon#244

Yet, even if my user can now read the file:

$ cat /sys/class/powercap/intel-rapl:0/energy_uj
13956425892

I still get an error in the logs of the scaphandre pod:

$ kubectl logs scaphandre-tfldv -n monitoring --timestamps=true -f
2024-07-23T13:49:31.418916867Z scaphandre::sensors: Sysinfo sees 24
2024-07-23T13:49:31.422281808Z Scaphandre prometheus exporter
2024-07-23T13:49:31.422291908Z Sending ⚡ metrics
2024-07-23T13:49:31.422294098Z Press CTRL-C to stop scaphandre
2024-07-23T13:50:25.034472133Z scaphandre::sensors: Could'nt read record from /sys/class/powercap/intel-rapl:0/energy_uj, error was: Os { code: 13, kind: PermissionDenied, message: "Permission denied" }

@maxence974
Copy link

hi !

any updates please ? same issue on cluster K8s !

nothing change with "sudo chmod -R a+r /sys/class/powercap/intel-rapl", access isstill denied

my proc: Intel(R) Xeon(R) CPU E5-2698 v4 @ 2.20GHz

thanks in advance!

@CalmaIndustry
Copy link

Hello

I fixed using privileged:true in my container
#391
could you please review

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: Triage
Development

No branches or pull requests

5 participants