scaphandre
scaphandre copied to clipboard
Way to know if the CPU is compliant with scaphandre - could not start on kube with intel CPU
Hello,
I would like to give a try to scaphandre on a kubernetes cluster. I tried to deploy it with the helm chart, but I always have the error:
thread 'main' panicked at 'called Result::unwrap()
on an Err
value: Os { code: 2, kind: NotFound, message: "No such file or directory" }', src/sensors/powercap_rapl.rs:76:53
After a few research, I checked on the node the module, intel_rapl which is loaded (it's a kernel prior to 5).
ll /sys/class/powercap/ total 0 intel-rapl -> ../../devices/virtual/powercap/intel-rapl intel-rapl:0 -> ../../devices/virtual/powercap/intel-rapl/intel-rapl:0 intel-rapl:1 -> ../../devices/virtual/powercap/intel-rapl/intel-rapl:1
The CPU is https://ark.intel.com/content/www/us/en/ark/products/192451/intel-xeon-gold-6254-processor-24-75m-cache-3-10-ghz.html
cat /proc/cpuinfo
processor : 0 vendor_id : GenuineIntel cpu family : 6 model : 85 model name : Intel(R) Xeon(R) Gold 6254 CPU @ 3.10GHz stepping : 7 microcode : 0x5003006 cpu MHz : 3100.000 cache size : 25344 KB physical id : 0 siblings : 18 core id : 0 cpu cores : 18 apicid : 0 initial apicid : 0 fpu : yes fpu_exception : yes cpuid level : 22 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch epb cat_l3 cdp_l3 invpcid_single intel_ppin intel_pt ssbd mba ibrs ibpb stibp ibrs_enhanced tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm cqm mpx rdt_a avx512f avx512dq rdseed adx smap clflushopt clwb avx512cd avx512bw avx512vl xsaveopt xsavec xgetbv1 cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local dtherm ida arat pln pts pku ospke avx512_vnni md_clear spec_ctrl intel_stibp flush_l1d arch_capabilities bogomips : 6200.00 clflush size : 64 cache_alignment : 64 address sizes : 46 bits physical, 48 bits virtual power management:
There is nothing in power management section. I had to add the --vm option to make it start. So I guess I met this issue: https://github.com/hubblo-org/scaphandre/issues/131
Or is that my CPU does not support RAPL? According to the compatibility matrix, it's a recent intel CPU, it should. Or I made a configuration error, but I can not really find what.
Thanks a lot
Hi ! Thanks for reporting that issue.
Do you have a full trace of the crash ?
As you are running on a Xeon Gold, it seems related to #131 as you imagined.
I encourage you to give a try to #198 if you can, or wait for it to be merged/released (#131 to be solved)
Hi ! #131 as been merged.
Could you give a try to the dev branch and see if this solves your issue ? @kennux75
Closing, as it seems related to the PR mentioned.
Don't hesitate to ask/reopen the issue if this is not fixed on your side.
Hello @bpetit Sorry to be re-opening this, we are facing similar issues with our bare-metal kubernetes cluster. Scaphandre is working on some nodes but not on others, so i dug into the differences in our machines and I found some differences in the kernel and CPU.
First a screenshot of the scenarion:
Logs from the machines were scaphandre is not working:
Scaphandre prometheus exporter
Sending ⚡ metrics
Press CTRL-C to stop scaphandre
scaphandre::sensors::powercap_rapl: Couldn't find intel_rapl modules.
scaphandre::sensors::powercap_rapl: Couldn't find domain folders from powercap. Fallback on socket folders.
scaphandre::sensors::powercap_rapl: Scaphandre will not be able to provide per-domain data.
thread 'main' panicked at 'Trick: if you are running on a vm, do not forget to use --vm parameter invoking scaphandre at the command line', src/sensors/mod.rs:320:22
stack backtrace:
0: rust_begin_unwind
at /rustc/9d1b2106e23b1abd32fce1f17267604a5102f57a/library/std/src/panicking.rs:498:5
1: core::panicking::panic_fmt
at /rustc/9d1b2106e23b1abd32fce1f17267604a5102f57a/library/core/src/panicking.rs:116:14
2: core::panicking::panic_display
at /rustc/9d1b2106e23b1abd32fce1f17267604a5102f57a/library/core/src/panicking.rs:72:5
3: core::panicking::panic_str
at /rustc/9d1b2106e23b1abd32fce1f17267604a5102f57a/library/core/src/panicking.rs:56:5
4: core::option::expect_failed
at /rustc/9d1b2106e23b1abd32fce1f17267604a5102f57a/library/core/src/option.rs:1817:5
5: scaphandre::sensors2023-07-28T11:11:03.583249664+02:00 ::Topology::add_cpu_cores
6: <scaphandre2023-07-28T11:11:03.583259795+02:00 ::sensors::powercap_rapl::PowercapRAPLSensor as scaphandre::sensors::Sensor>2023-07-28T11:11:03.583265629+02:00 ::generate_topology
7: 2023-07-28T11:11:03.583270786+02:00 <scaphandre::sensors::powercap_rapl::PowercapRAPLSensor as scaphandre::sensors::Sensor2023-07-28T11:11:03.583274608+02:00 >::get_topology
2023-07-28T11:11:03.583278761+02:00 8: <scaphandre::exporters::prometheus::PrometheusExporter as2023-07-28T11:11:03.583282679+02:00 scaphandre::exporters::Exporter>::run
9: 2023-07-28T11:11:03.583290428+02:00 scaphandre::run
10: scaphandre::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
Stream closed EOF for default/scaphandre-lsg4f (scaphandre)
I decided to investigate using some linux commands to get system info:
cat /etc/os-release
lsb_release -a
hostnamectl
uname -r
dmesg | grep rapl
ls /lib/modules/$(uname -r)/kernel/drivers/powercap/
lscpu
System information for the machines where scaphandre works:
ubuntu@worker-0:~$ cat /etc/os-release
NAME="Ubuntu"
VERSION="20.04.5 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.5 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal
ubuntu@worker-0:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.5 LTS
Release: 20.04
Codename: focal
ubuntu@worker-0:~$ hostnamectl
Static hostname: worker-0
Icon name: computer-desktop
Chassis: desktop
Machine ID: b8e643305cce4e69bec0475fa3c1c2b3
Boot ID: 2e8dea0794264b67bd272f0b7916be4a
Operating System: Ubuntu 20.04.5 LTS
Kernel: Linux 5.4.0-132-generic
Architecture: x86-64
ubuntu@worker-0:~$ uname -r
5.4.0-132-generic
ubuntu@worker-0:~$ dmesg | grep rapl
ubuntu@worker-0:~$
ubuntu@worker-0:~$ ls /lib/modules/$(uname -r)/kernel/drivers/powercap/
intel_rapl_common.ko intel_rapl_msr.ko
ubuntu@worker-0:~$ lscpu
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
Address sizes: 39 bits physical, 48 bits virtual
CPU(s): 16
On-line CPU(s) list: 0-15
Thread(s) per core: 2
Core(s) per socket: 8
Socket(s): 1
NUMA node(s): 1
Vendor ID: GenuineIntel
CPU family: 6
Model: 158
Model name: Intel(R) Xeon(R) E-2288G CPU @ 3.70GHz
Stepping: 13
CPU MHz: 2339.355
CPU max MHz: 5000.0000
CPU min MHz: 800.0000
BogoMIPS: 7399.70
Virtualization: VT-x
L1d cache: 256 KiB
L1i cache: 256 KiB
L2 cache: 2 MiB
L3 cache: 16 MiB
NUMA node0 CPU(s): 0-15
Vulnerability Itlb multihit: KVM: Mitigation: Split huge pages
Vulnerability L1tf: Not affected
Vulnerability Mds: Not affected
Vulnerability Meltdown: Not affected
Vulnerability Mmio stale data: Mitigation; Clear CPU buffers; SMT vulnerable
Vulnerability Retbleed: Mitigation; Enhanced IBRS
Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl and seccomp
Vulnerability Spectre v1: Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Vulnerability Spectre v2: Mitigation; Enhanced IBRS, IBPB conditional, RSB filling, PBRSB-eIBRS SW sequence
Vulnerability Srbds: Mitigation; Microcode
Vulnerability Tsx async abort: Mitigation; TSX disabled
Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm con
stant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg
fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb invpcid
_single ssbd ibrs ibpb stibp ibrs_enhanced tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid mpx rdseed
adx smap clflushopt intel_pt xsaveopt xsavec xgetbv1 xsaves dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp md_clear flush_l1d arch_capabi
lities
System information from a machine where scaphandre does not work:
ubuntu@worker-10:~$ cat /etc/os-release
NAME="Ubuntu"
VERSION="20.04.5 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.5 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal
ubuntu@worker-10:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.5 LTS
Release: 20.04
Codename: focal
ubuntu@worker-10:~$ hostnamectl
Static hostname: worker-10
Icon name: computer-server
Chassis: server
Machine ID: 88a6e50b09bd4dbc8b4a1226cd6fd85a
Boot ID: 1c86da713abf44e9a61ab693018a5a72
Operating System: Ubuntu 20.04.5 LTS
Kernel: Linux 5.4.0-139-generic
Architecture: x86-64
ubuntu@worker-10:~$ uname -r
5.4.0-139-generic
ubuntu@worker-10:~$ dmesg | grep rapl
[13284554.143685] intel_rapl_common: driver does not support CPU family 6 model 167
ubuntu@worker-10:~$ ls /lib/modules/$(uname -r)/kernel/drivers/powercap/
intel_rapl_common.ko intel_rapl_msr.ko
ubuntu@worker-10:~$ lscpu
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
Address sizes: 39 bits physical, 48 bits virtual
CPU(s): 16
On-line CPU(s) list: 0-15
Thread(s) per core: 2
Core(s) per socket: 8
Socket(s): 1
NUMA node(s): 1
Vendor ID: GenuineIntel
CPU family: 6
Model: 167
Model name: Intel(R) Xeon(R) E-2388G CPU @ 3.20GHz
Stepping: 1
CPU MHz: 3794.008
CPU max MHz: 5100.0000
CPU min MHz: 800.0000
BogoMIPS: 6384.00
Virtualization: VT-x
L1d cache: 384 KiB
L1i cache: 256 KiB
L2 cache: 4 MiB
L3 cache: 16 MiB
NUMA node0 CPU(s): 0-15
Vulnerability Itlb multihit: Not affected
Vulnerability L1tf: Not affected
Vulnerability Mds: Not affected
Vulnerability Meltdown: Not affected
Vulnerability Mmio stale data: Mitigation; Clear CPU buffers; SMT vulnerable
Vulnerability Retbleed: Mitigation; Enhanced IBRS
Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl and seccomp
Vulnerability Spectre v1: Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Vulnerability Spectre v2: Mitigation; Enhanced IBRS, IBPB conditional, RSB filling, PBRSB-eIBRS SW sequence
Vulnerability Srbds: Not affected
Vulnerability Tsx async abort: Not affected
Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm con
stant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx smx est
tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fa
ult epb invpcid_single ssbd ibrs ibpb stibp ibrs_enhanced tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invp
cid mpx avx512f avx512dq rdseed adx smap avx512ifma clflushopt intel_pt avx512cd sha_ni avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves dtherm ida arat
pln pts hwp hwp_notify hwp_act_window hwp_epp hwp_pkg_req avx512vbmi umip pku ospke avx512_vbmi2 gfni vaes vpclmulqdq avx512_vnni avx512_bitalg avx512_
vpopcntdq rdpid md_clear flush_l1d arch_capabilities
System information form ANOTHER machine where scaphandre does not work:
ubuntu@worker-16:~$ cat /etc/os-release
NAME="Ubuntu"
VERSION="20.04.6 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.6 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal
ubuntu@worker-16:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.6 LTS
Release: 20.04
Codename: focal
ubuntu@worker-16:~$ hostnamectl
Static hostname: worker-16
Icon name: computer-server
Chassis: server
Machine ID: f2e27e067f964ba990e83757d7fd67b8
Boot ID: 757c2843ae414738902d5a346d85b42b
Operating System: Ubuntu 20.04.6 LTS
Kernel: Linux 5.4.0-149-generic
Architecture: x86-64
ubuntu@worker-16:~$ uname -r
5.4.0-149-generic
ubuntu@worker-16:~$ dmesg | grep rapl
[5532924.548674] intel_rapl_common: driver does not support CPU family 6 model 167
[5533147.957785] intel_rapl_common: driver does not support CPU family 6 model 167
[5533711.154311] intel_rapl_common: driver does not support CPU family 6 model 167
ubuntu@worker-16:~$ ls /lib/modules/$(uname -r)/kernel/drivers/powercap/
intel_rapl_common.ko intel_rapl_msr.ko
ubuntu@worker-16:~$ lscpu
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
Address sizes: 39 bits physical, 48 bits virtual
CPU(s): 12
On-line CPU(s) list: 0-11
Thread(s) per core: 2
Core(s) per socket: 6
Socket(s): 1
NUMA node(s): 1
Vendor ID: GenuineIntel
CPU family: 6
Model: 167
Model name: Intel(R) Xeon(R) E-2386G CPU @ 3.50GHz
Stepping: 1
CPU MHz: 1478.075
CPU max MHz: 5100.0000
CPU min MHz: 800.0000
BogoMIPS: 7008.00
Virtualization: VT-x
L1d cache: 288 KiB
L1i cache: 192 KiB
L2 cache: 3 MiB
L3 cache: 12 MiB
NUMA node0 CPU(s): 0-11
Vulnerability Itlb multihit: Not affected
Vulnerability L1tf: Not affected
Vulnerability Mds: Not affected
Vulnerability Meltdown: Not affected
Vulnerability Mmio stale data: Mitigation; Clear CPU buffers; SMT vulnerable
Vulnerability Retbleed: Mitigation; Enhanced IBRS
Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl and seccomp
Vulnerability Spectre v1: Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Vulnerability Spectre v2: Mitigation; Enhanced IBRS, IBPB conditional, RSB filling, PBRSB-eIBRS SW sequence
Vulnerability Srbds: Not affected
Vulnerability Tsx async abort: Not affected
Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm con
stant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx smx est
tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fa
ult epb invpcid_single ssbd ibrs ibpb stibp ibrs_enhanced tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invp
cid mpx avx512f avx512dq rdseed adx smap avx512ifma clflushopt intel_pt avx512cd sha_ni avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves dtherm ida arat
pln pts hwp hwp_notify hwp_act_window hwp_epp hwp_pkg_req avx512vbmi umip pku ospke avx512_vbmi2 gfni vaes vpclmulqdq avx512_vnni avx512_bitalg avx512_
vpopcntdq rdpid md_clear flush_l1d arch_capabilities
Analysis
The main differences lie in the CPU version and the kernel version (but i think the issue lies more on the side of the CPU)
Model name: Intel(R) Xeon(R) E-2288G CPU @ 3.70GHz Model Number: 158 Comparing this to the non working machines (worker-16 & worker-10):
Model name: Intel(R) Xeon(R) E-2386G CPU @ 3.50GHz Model Number: 167
Model name: Intel(R) Xeon(R) E-2388G CPU @ 3.20GHz Model Number: 167
and checking the output of dmesg | grep rapl:
intel_rapl_common: driver does not support CPU family 6 model 167
It seems that scaphandre has issues with newer CPUs (this seems to be coherent with our setup where scaphandre works on older workers, e.g. worker-0, worker-1... but not on newer workers like worker-10 and worker-16)
We tried using scaphandre latest and 0.5.0.
Scaphandre is started with:
....
spec:
....
containers:
- args:
- prometheus
- --containers=true
env:
- name: RUST_BACKTRACE
value: "1"
image: hubblo/scaphandre:0.5.0
imagePullPolicy: Always
name: scaphandre
ports:
- containerPort: 8080
name: metrics
protocol: TCP
resources:
limits:
memory: 200Mi
requests:
cpu: 75m
memory: 150Mi
securityContext:
allowPrivilegeEscalation: false
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
volumeMounts:
- mountPath: /proc
name: proc
- mountPath: /sys/class/powercap
name: powercap
- mountPath: /var/run/secrets/kubernetes.io/serviceaccount
name: kube-api-access-rdv2l
readOnly: true
dnsPolicy: ClusterFirst
enableServiceLinks: true
nodeName: worker-10.
preemptionPolicy: PreemptLowerPriority
priority: 0
restartPolicy: Always
schedulerName: default-scheduler
securityContext:
fsGroup: 1
runAsGroup: 0
runAsUser: 0
supplementalGroups:
- 1
serviceAccount: scaphandre
serviceAccountName: scaphandre
terminationGracePeriodSeconds: 30
tolerations:
- operator: Exists
- effect: NoExecute
key: node.kubernetes.io/not-ready
operator: Exists
- effect: NoExecute
key: node.kubernetes.io/unreachable
operator: Exists
- effect: NoSchedule
key: node.kubernetes.io/disk-pressure
operator: Exists
- effect: NoSchedule
key: node.kubernetes.io/memory-pressure
operator: Exists
- effect: NoSchedule
key: node.kubernetes.io/pid-pressure
operator: Exists
- effect: NoSchedule
key: node.kubernetes.io/unschedulable
operator: Exists
volumes:
- hostPath:
path: /proc
type: Directory
name: proc
- hostPath:
path: /sys/class/powercap
type: Directory
name: powercap
- name: kube-api-access-rdv2l
projected:
defaultMode: 420
sources:
- serviceAccountToken:
expirationSeconds: 3607
path: token
- configMap:
items:
- key: ca.crt
path: ca.crt
name: kube-root-ca.crt
- downwardAPI:
items:
- fieldRef:
apiVersion: v1
fieldPath: metadata.namespace
path: namespace
....
What do you think we can do?