Bug description
Running scaphandre on bare metal (no VM) produces the following error, even though the machine is not a virtual machine:
Scaphandre stdout exporter
Sending ⚡ metrics
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:263:18
stack backtrace:
0: rust_begin_unwind
at /build/rustc-h1hlaa/rustc-1.51.0+dfsg1+llvm/library/std/src/panicking.rs:493:5
1: core::panicking::panic_fmt
at /build/rustc-h1hlaa/rustc-1.51.0+dfsg1+llvm/library/core/src/panicking.rs:92:14
2: core::option::expect_failed
at /build/rustc-h1hlaa/rustc-1.51.0+dfsg1+llvm/library/core/src/option.rs:1292:5
3: core::option::Option<T>::expect
at /build/rustc-h1hlaa/rustc-1.51.0+dfsg1+llvm/library/core/src/option.rs:349:21
4: scaphandre::sensors::Topology::add_cpu_cores
at ./src/sensors/mod.rs:259:26
5: <scaphandre::sensors::powercap_rapl::PowercapRAPLSensor as scaphandre::sensors::Sensor>::generate_topology
at ./src/sensors/powercap_rapl.rs:106:9
6: <scaphandre::sensors::powercap_rapl::PowercapRAPLSensor as scaphandre::sensors::Sensor>::get_topology
at ./src/sensors/powercap_rapl.rs:112:24
7: scaphandre::exporters::stdout::StdoutExporter::runner
at ./src/exporters/stdout.rs:122:24
8: <scaphandre::exporters::stdout::StdoutExporter as scaphandre::exporters::Exporter>::run
at ./src/exporters/stdout.rs:19:9
9: scaphandre::run
at ./src/lib.rs:74:9
10: scaphandre::main
at ./src/main.rs:81:5
11: core::ops::function::FnOnce::call_once
at /build/rustc-h1hlaa/rustc-1.51.0+dfsg1+llvm/library/core/src/ops/function.rs:227:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
Adding the "--vm" argument gives (and still does not work):
scaphandre::sensors::powercap_rapl: Powercap_rapl path is: /var/scaphandre
Scaphandre stdout exporter
Sending ⚡ metrics
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
stack backtrace:
0: rust_begin_unwind
at /build/rustc-h1hlaa/rustc-1.51.0+dfsg1+llvm/library/std/src/panicking.rs:493:5
1: core::panicking::panic_fmt
at /build/rustc-h1hlaa/rustc-1.51.0+dfsg1+llvm/library/core/src/panicking.rs:92:14
2: core::result::unwrap_failed
at /build/rustc-h1hlaa/rustc-1.51.0+dfsg1+llvm/library/core/src/result.rs:1284:5
3: core::result::Result<T,E>::unwrap
at /build/rustc-h1hlaa/rustc-1.51.0+dfsg1+llvm/library/core/src/result.rs:1037:23
4: <scaphandre::sensors::powercap_rapl::PowercapRAPLSensor as scaphandre::sensors::Sensor>::generate_topology
at ./src/sensors/powercap_rapl.rs:76:23
5: <scaphandre::sensors::powercap_rapl::PowercapRAPLSensor as scaphandre::sensors::Sensor>::get_topology
at ./src/sensors/powercap_rapl.rs:112:24
6: scaphandre::exporters::stdout::StdoutExporter::runner
at ./src/exporters/stdout.rs:122:24
7: <scaphandre::exporters::stdout::StdoutExporter as scaphandre::exporters::Exporter>::run
at ./src/exporters/stdout.rs:19:9
8: scaphandre::run
at ./src/lib.rs:74:9
9: scaphandre::main
at ./src/main.rs:81:5
10: core::ops::function::FnOnce::call_once
at /build/rustc-h1hlaa/rustc-1.51.0+dfsg1+llvm/library/core/src/ops/function.rs:227:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
Reloading the rapl kernel modules, and restarting the machine does not seem to change anything.
To Reproduce
cargo build
./target/debug/scaphandre stdout
Expected behavior
Something should happen :)
Environment
Linux Distribution: Ubuntu 18.04.5 LTS
Linux Kernel: 5.14.15-051415-generic (Also had issues with 5.04)
>> lsmod | grep rapl
intel_rapl_msr 20480 0
intel_rapl_common 24576 1 intel_rapl_msr
rapl 20480 0
>> ls /sys/class/powercap
dtpm intel-rapl intel-rapl:0
>> lshw -short
H/W path Device Class Description
===============================================================
system System Product Name
/0 bus WS X299 SAGE
/0/1 memory 64KiB BIOS
/0/4a memory System Memory
/0/4a/0 memory 16GiB DIMM DDR4 Synchronous 2667 MHz (0.4 ns)
/0/4a/1 memory 16GiB DIMM DDR4 Synchronous 2667 MHz (0.4 ns)
/0/4a/2 memory 16GiB DIMM DDR4 Synchronous 2667 MHz (0.4 ns)
/0/4a/3 memory 16GiB DIMM DDR4 Synchronous 2667 MHz (0.4 ns)
/0/54 memory System Memory
/0/54/0 memory 16GiB DIMM DDR4 Synchronous 2667 MHz (0.4 ns)
/0/54/1 memory 16GiB DIMM DDR4 Synchronous 2667 MHz (0.4 ns)
/0/54/2 memory 16GiB DIMM DDR4 Synchronous 2667 MHz (0.4 ns)
/0/54/3 memory 16GiB DIMM DDR4 Synchronous 2667 MHz (0.4 ns)
/0/5e memory 896KiB L1 cache
/0/5f memory 14MiB L2 cache
/0/60 memory 19MiB L3 cache
/0/61 processor Intel(R) Core(TM) i9-9940X CPU @ 3.30GHz
/0/2 memory
/0/3 memory
/0/100 bridge Sky Lake-E DMI3 Registers
/0/100/4 generic Sky Lake-E CBDMA Registers
/0/100/4.1 generic Sky Lake-E CBDMA Registers
/0/100/4.2 generic Sky Lake-E CBDMA Registers
/0/100/4.3 generic Sky Lake-E CBDMA Registers
/0/100/4.4 generic Sky Lake-E CBDMA Registers
/0/100/4.5 generic Sky Lake-E CBDMA Registers
/0/100/4.6 generic Sky Lake-E CBDMA Registers
/0/100/4.7 generic Sky Lake-E CBDMA Registers
/0/100/5 generic Sky Lake-E MM/Vt-d Configuration Registers
/0/100/5.2 generic Intel Corporation
/0/100/5.4 generic Intel Corporation
/0/100/8 generic Sky Lake-E Ubox Registers
/0/100/8.1 generic Sky Lake-E Ubox Registers
/0/100/8.2 generic Sky Lake-E Ubox Registers
/0/100/14 bus 200 Series/Z370 Chipset Family USB 3.0 xHCI Controller
/0/100/14/0 usb1 bus xHCI Host Controller
/0/100/14/0/e input AURA Custom Human interface
/0/100/14/1 usb2 bus xHCI Host Controller
/0/100/14.2 generic 200 Series PCH Thermal Subsystem
/0/100/16 communication 200 Series PCH CSME HECI #1
/0/100/17 storage 200 Series PCH SATA controller [AHCI mode]
/0/100/1b bridge 200 Series PCH PCI Express Root Port #17
/0/100/1b.4 bridge 200 Series PCH PCI Express Root Port #21
/0/100/1b.4/0 storage NVMe SSD Controller SM981/PM981
/0/100/1b.4/0/0 /dev/nvme0 storage Samsung SSD 970 EVO Plus 2TB
/0/100/1b.4/0/0/1 /dev/nvme0n1 disk 2TB NVMe namespace
/0/100/1b.4/0/0/1/1 volume 511MiB Windows FAT volume
/0/100/1b.4/0/0/1/2 /dev/nvme0n1p2 volume 1862GiB EXT4 volume
/0/100/1c bridge 200 Series PCH PCI Express Root Port #1
/0/100/1c.2 bridge 200 Series PCH PCI Express Root Port #3
/0/100/1c.2/0 enp4s0 network I210 Gigabit Network Connection
/0/100/1d bridge 200 Series PCH PCI Express Root Port #9
/0/100/1d/0 bus ASMedia Technology Inc.
/0/100/1d/0/0 usb3 bus xHCI Host Controller
/0/100/1d/0/1 usb4 bus xHCI Host Controller
/0/100/1d.2 bridge 200 Series PCH PCI Express Root Port #11
/0/100/1d.2/0 bus ASMedia Technology Inc.
/0/100/1d.2/0/0 usb5 bus xHCI Host Controller
/0/100/1d.2/0/1 usb6 bus xHCI Host Controller
/0/100/1f bridge X299 Chipset LPC/eSPI Controller
/0/100/1f.2 memory Memory controller
/0/100/1f.3 multimedia 200 Series PCH HD Audio
/0/100/1f.4 bus 200 Series/Z370 Chipset Family SMBus Controller
/0/100/1f.6 eno1 network Ethernet Connection (2) I219-LM
/0/101 bridge Sky Lake-E PCI Express Root Port A
/0/101/0 bridge PEX 8747 48-Lane, 5-Port PCI Express Gen 3 (8.0 GT/s) Switch
/0/101/0/8 bridge PEX 8747 48-Lane, 5-Port PCI Express Gen 3 (8.0 GT/s) Switch
/0/101/0/10 bridge PEX 8747 48-Lane, 5-Port PCI Express Gen 3 (8.0 GT/s) Switch
/0/4 generic Intel Corporation
/0/6 generic Sky Lake-E RAS Configuration Registers
/0/7 generic Intel Corporation
/0/8 generic Sky Lake-E CHA Registers
/0/8.1 generic Sky Lake-E CHA Registers
/0/8.2 generic Sky Lake-E CHA Registers
/0/8.3 generic Sky Lake-E CHA Registers
/0/8.4 generic Sky Lake-E CHA Registers
/0/8.5 generic Sky Lake-E CHA Registers
/0/8.6 generic Sky Lake-E CHA Registers
/0/8.7 generic Sky Lake-E CHA Registers
/0/9 generic Sky Lake-E CHA Registers
/0/9.1 generic Sky Lake-E CHA Registers
/0/9.2 generic Sky Lake-E CHA Registers
/0/9.3 generic Sky Lake-E CHA Registers
/0/9.4 generic Sky Lake-E CHA Registers
/0/9.5 generic Sky Lake-E CHA Registers
/0/9.6 generic Sky Lake-E CHA Registers
/0/9.7 generic Sky Lake-E CHA Registers
/0/a generic Sky Lake-E CHA Registers
/0/11 generic Sky Lake-E CHA Registers
/0/e generic Sky Lake-E CHA Registers
/0/e.1 generic Sky Lake-E CHA Registers
/0/e.2 generic Sky Lake-E CHA Registers
/0/e.3 generic Sky Lake-E CHA Registers
/0/e.4 generic Sky Lake-E CHA Registers
/0/e.5 generic Sky Lake-E CHA Registers
/0/e.6 generic Sky Lake-E CHA Registers
/0/e.7 generic Sky Lake-E CHA Registers
/0/f generic Sky Lake-E CHA Registers
/0/f.1 generic Sky Lake-E CHA Registers
/0/f.2 generic Sky Lake-E CHA Registers
/0/f.3 generic Sky Lake-E CHA Registers
/0/f.4 generic Sky Lake-E CHA Registers
/0/f.5 generic Sky Lake-E CHA Registers
/0/f.6 generic Sky Lake-E CHA Registers
/0/f.7 generic Sky Lake-E CHA Registers
/0/10 generic Sky Lake-E CHA Registers
/0/10.1 generic Sky Lake-E CHA Registers
/0/1d generic Sky Lake-E CHA Registers
/0/1d.1 generic Sky Lake-E CHA Registers
/0/1d.2 generic Sky Lake-E CHA Registers
/0/1d.3 generic Sky Lake-E CHA Registers
/0/1e generic Sky Lake-E PCU Registers
/0/1e.1 generic Sky Lake-E PCU Registers
/0/1e.2 generic Sky Lake-E PCU Registers
/0/1e.3 generic Sky Lake-E PCU Registers
/0/1e.4 generic Sky Lake-E PCU Registers
/0/1e.5 generic Sky Lake-E PCU Registers
/0/1e.6 generic Sky Lake-E PCU Registers
/0/0 bridge Sky Lake-E PCI Express Root Port A
/0/0/0 bridge PEX 8747 48-Lane, 5-Port PCI Express Gen 3 (8.0 GT/s) Switch
/0/0/0/8 bridge PEX 8747 48-Lane, 5-Port PCI Express Gen 3 (8.0 GT/s) Switch
/0/0/0/8/0 display NVIDIA Corporation
/0/0/0/8/0.1 multimedia NVIDIA Corporation
/0/0/0/8/0.2 bus NVIDIA Corporation
/0/0/0/8/0.2/0 usb7 bus xHCI Host Controller
/0/0/0/8/0.2/1 usb8 bus xHCI Host Controller
/0/0/0/8/0.3 bus NVIDIA Corporation
/0/0/0/10 bridge PEX 8747 48-Lane, 5-Port PCI Express Gen 3 (8.0 GT/s) Switch
/0/0/0/10/0 display NVIDIA Corporation
/0/0/0/10/0.1 multimedia NVIDIA Corporation
/0/0/0/10/0.2 bus NVIDIA Corporation
/0/0/0/10/0.2/0 usb9 bus xHCI Host Controller
/0/0/0/10/0.2/1 usb10 bus xHCI Host Controller
/0/0/0/10/0.3 bus NVIDIA Corporation
/0/13 generic Intel Corporation
/0/14 generic Sky Lake-E RAS Configuration Registers
/0/18 generic Intel Corporation
/0/19 generic Intel Corporation
/0/1a generic Intel Corporation
/0/1b generic Intel Corporation
/0/1c generic Intel Corporation
/0/a.2 generic Intel Corporation
/0/a.3 generic Intel Corporation
/0/a.4 generic Intel Corporation
/0/a.5 generic Intel Corporation
/0/a.6 generic Intel Corporation
/0/a.7 generic Intel Corporation
/0/b generic Intel Corporation
/0/b.1 generic Intel Corporation
/0/b.2 generic Intel Corporation
/0/b.3 generic Intel Corporation
/0/c generic Intel Corporation
/0/c.1 generic Intel Corporation
/0/c.2 generic Intel Corporation
/0/c.3 generic Intel Corporation
/0/c.4 generic Intel Corporation
/0/c.5 generic Intel Corporation
/0/c.6 generic Intel Corporation
/0/c.7 generic Intel Corporation
/0/d generic Intel Corporation
/0/d.1 generic Intel Corporation
/0/d.2 generic Intel Corporation
/0/d.3 generic Intel Corporation
/0/5 generic Intel Corporation
/0/5.2 generic Sky Lake-E RAS Configuration Registers
/0/5.4 generic Intel Corporation
/0/12 generic Sky Lake-E M3KTI Registers
/0/12.1 generic Sky Lake-E M3KTI Registers
/0/12.2 generic Sky Lake-E M3KTI Registers
/0/15 generic Sky Lake-E M2PCI Registers
/0/16 generic Sky Lake-E M2PCI Registers
/0/16.4 generic Sky Lake-E M2PCI Registers
/0/17 generic Sky Lake-E M2PCI Registers
/0/1f scsi3 storage
/0/1f/0.0.0 /dev/sda disk 8001GB ST8000DM004-2CX1
/0/20 scsi5 storage
/0/20/0.0.0 /dev/sdb disk 8001GB ST8000DM004-2CX1
/0/21 scsi7 storage
/0/21/0.0.0 /dev/sdc disk 8001GB ST8000DM004-2CX1
/1 power To Be Filled By O.E.M.
bug help wanted