Skip to main content
v2026.11,986 entries · CC-BY 4.0

Scaphandre: Measuring Energy Consumption in Scientific Computing

A technical guide to Scaphandre for researchers: hardware RAPL requirements, daemon installation, process energy attribution, and Prometheus export.

Written and maintained by CASRAI Editorial Board

Published · Last updated

On this page

Scaphandre is an open-source electrical energy consumption metrology agent designed to measure the power and energy consumption of bare-metal servers, virtual machines, and individual computing processes without requiring application source code modifications. Developed in Rust by Hubblo, Scaphandre reads hardware telemetry from processor Running Average Power Limit (RAPL) counters via the Linux sysfs interface, attributes energy consumption dynamically based on process CPU time, and exposes standardized metrics to telemetry collectors including Prometheus, Riemann, Warp10, and terminal standard output.

As computational demands accelerate across scientific research, quantifying the environmental footprint of digital workloads has transitioned from an administrative curiosity to a core requirement of research integrity and infrastructure management. High-performance computing (HPC) centers, cloud research tenants, and institutional laboratories consume megawatts of electricity to execute complex simulations, train artificial intelligence models, and process massive observational datasets. Establishing an empirical baseline for this energy consumption requires transparent, vendor-independent measurement tools capable of operating in production environments with negligible overhead. Scaphandre addresses this requirement by acting as an unobtrusive system daemon that captures low-level energy signals directly from the physical silicon and translates them into actionable data for researchers, system administrators, and sustainability officers.

What it is used for in research

In academic and industrial research settings, Scaphandre provides foundational observability for green software engineering and energy-aware computing. Traditional system monitoring frameworks track utilization metrics—such as central processing unit (CPU) load percentage, random-access memory (RAM) allocation, and input/output (I/O) throughput—but fail to report direct electrical energy consumption in joules or watts. Because modern superscalar microprocessors incorporate aggressive dynamic frequency scaling, power gating, and heterogeneous execution units, two workloads exhibiting identical 100% CPU utilization can exhibit vastly different electrical power draws depending on whether they execute integer arithmetic, vectorized floating-point operations (such as AVX-512), or memory-bound cache transfers.

Research applications of Scaphandre span several specialized domains:

  • High-Performance Computing Power Profiling: Cluster administrators and researchers deploy Scaphandre across multi-tenant compute nodes to profile the baseline power consumption of scientific codes. By monitoring continuous telemetry alongside workload schedulers such as Slurm, facility managers identify energy-inefficient algorithms, quantify idle node waste, and implement sustainable HPC operational strategies.
  • Machine Learning Energy Attribution: Deep learning model training and inference pipelines require substantial electrical power. Researchers utilize Scaphandre to measure the energy consumed across distributed training epochs without injecting profiling hooks into Python scripts or deep learning frameworks, establishing an accurate baseline for the total compute carbon footprint of machine learning experiments.
  • Algorithmic Energy Benchmarking: In computer science and computational biology, research software engineers utilize Scaphandre to perform empirical comparisons between algorithmic implementations. By quantifying energy consumed per completed task (such as genome sequence alignment or matrix decomposition), developers can optimize software for energy efficiency alongside execution runtime, verifying principles of energy proportionality.
  • Carbon-Aware Workload Scheduling: Integrated with regional electrical grid carbon intensity signals, Scaphandre metrics inform automated scheduling policies that shift intensive non-urgent computations to periods when renewable energy generation is abundant, operationalizing the principles of carbon-aware computing.
  • Cross-Architecture Hardware Auditing: Systems researchers measure how identical computational workloads perform across differing server architectures, contrasting energy expenditures across generations of Intel Xeon and AMD EPYC processors.
  • Institutional Sustainability Reporting: Academic universities and research institutions utilize aggregated Scaphandre telemetry to provide audited, empirical data for Scope 2 greenhouse gas emissions disclosures under institutional climate commitments.

Unlike application-level telemetry libraries that require instrumenting internal source code—such as CodeCarbon—Scaphandre operates strictly at the operating system and hypervisor boundary. This non-invasive architectural approach allows research software engineers to monitor compiled legacy Fortran codes, proprietary binary software, containerized microservices, and multi-user batch scripts without requesting source modifications or recompilation from domain scientists.

How to install or access it

Scaphandre is officially distributed as an open-source Rust application licensed under the Apache License 2.0. The software is maintained by the Hubblo development collective and is accessible via its official source repository and binary distribution channels. Running Scaphandre requires an x86_64 host system with hardware support for Intel or AMD Running Average Power Limit (RAPL) interfaces and a contemporary Linux kernel.

Hardware and operating system prerequisites include:

  • CPU Architecture: Intel Sandy Bridge microarchitecture (introduced in 2011) or newer, or AMD Zen microarchitecture (Zen 1 / Family 17h, introduced in 2017) or newer. Older processors lack the internal energy counters necessary for hardware-level telemetry.
  • Linux Kernel: Linux kernel version 5.0 or higher is recommended. Kernels in the 5.x and 6.x series provide native support for the powercap driver interface via the intel_rapl_common kernel module.
  • Operating System Permissions: Root or administrative superuser privileges are mandatory to read RAPL energy counters. Following security patches for the PLATYPUS side-channel vulnerability (CVE-2020-8694), Linux distributions restrict access to RAPL sysfs files to the root user.

Method 1: Pre-Compiled Debian / Ubuntu Package Installation

On Debian, Ubuntu, and related Linux distributions, the most straightforward installation method utilizes official deb package releases published on GitHub:

  1. Download the latest release package matching your system architecture from the official Hubblo repository:
    wget https://github.com/hubblo-org/scaphandre/releases/latest/download/scaphandre_amd64.deb
  2. Install the package using the system package manager:
    sudo dpkg -i scaphandre_amd64.deb
  3. Resolve any missing system dependencies using apt:
    sudo apt-get install -f
  4. Verify the installation by checking the binary version:
    scaphandre --version

Method 2: Compiling from Source via Cargo

For high-performance computing clusters running customized Linux distributions (such as Rocky Linux, AlmaLinux, or Arch Linux), compiling Scaphandre from source via the Rust package manager cargo guarantees optimal binary compatibility:

  1. Ensure that the Rust toolchain (compiler rustc and package manager cargo) and build essentials are installed:
    sudo apt-get install build-essential pkg-config libssl-dev
    curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
    source $HOME/.cargo/env
  2. Install Scaphandre globally from crates.io using Cargo:
    cargo install scaphandre
  3. Alternatively, clone the official GitHub repository and compile a release binary with specific exporter feature flags enabled:
    git clone https://github.com/hubblo-org/scaphandre.git
    cd scaphandre
    cargo build --release
    sudo cp target/release/scaphandre /usr/local/bin/

Method 3: Containerized Deployment via Docker or Podman

Scaphandre is packaged as an official container image on Docker Hub under hubblo/scaphandre. Because Scaphandre must read physical hardware counters and process tables directly from the host operating system, containerized instances require specific host path volume mounts:

  1. Pull the official container image:
    docker pull hubblo/scaphandre
  2. Execute Scaphandre by mounting the host /sys/class/powercap and /proc directories into the container:
    docker run --rm -ti   -v /sys/class/powercap:/sys/class/powercap   -v /proc:/proc   hubblo/scaphandre stdout -t 15

Step-by-step task

The following numbered walkthrough demonstrates how to set up Scaphandre on a research compute node, verify kernel telemetry interfaces, run local terminal profiling, launch a background Prometheus exporter daemon, and integrate telemetry collection into a monitoring pipeline.

Step 1: Verify Hardware RAPL Interfaces and Load Kernel Modules

Before launching Scaphandre, verify that your processor supports RAPL and that the appropriate Linux kernel modules are actively loaded. Execute the following commands in an interactive shell:

sudo modprobe intel_rapl_common
ls -la /sys/class/powercap/intel-rapl/

If your system supports RAPL, the directory will contain domain subdirectories named intel-rapl:0, intel-rapl:1 (on multi-socket nodes), and subdomains such as intel-rapl:0:0. Confirm that the energy counter file energy_uj exists:

cat /sys/class/powercap/intel-rapl/intel-rapl:0/name
sudo cat /sys/class/powercap/intel-rapl/intel-rapl:0/energy_uj

The first command outputs package-0 (the CPU socket domain), and the second command returns a numerical value representing the cumulative microjoules consumed since system initialization.

Step 2: Validate Live System Telemetry via the Stdout Exporter

To verify that Scaphandre can read the hardware sensors and map process-level energy consumption, run the interactive stdout exporter in terminal mode. Execute the command with elevated privileges:

sudo scaphandre stdout -t 15 -p 10 -s 2

In this command:

  • -t 15 instructs Scaphandre to run for a duration of 15 seconds before terminating cleanly (setting -t 0 runs the profiler indefinitely until interrupted with Ctrl+C).
  • -p 10 restricts terminal output to the top 10 most energy-intensive processes detected on the host.
  • -s 2 sets the sampling interval step to 2 seconds, balancing measurement granularity against CPU polling overhead.

Scaphandre refreshes the terminal display at each step, listing the total host power consumption in watts and presenting a table showing process identifiers (PIDs), executable names, CPU percentage consumption, and calculated power consumption in watts.

Step 3: Filter Workload Telemetry Using Regular Expressions

When monitoring specific scientific applications on a busy multi-user research server, use the -r regular expression flag to isolate target processes:

sudo scaphandre stdout -r "python|R|lammps|gromacs" -t 30

This command monitors system activity for 30 seconds and filters the process attribution table to show only processes whose executable name matches Python, R, LAMMPS, or GROMACS computational workloads.

Step 4: Launch the Prometheus HTTP Exporter Daemon

To establish continuous metrics harvesting for institutional dashboards and cluster monitoring, launch Scaphandre using the prometheus exporter subcommand:

sudo scaphandre prometheus -p 8080 -a 0.0.0.0 --containers

In this command:

  • -p 8080 specifies the TCP port on which the HTTP metrics server listens (defaulting to port 8080).
  • -a 0.0.0.0 binds the exporter service to all network interfaces on the host (the default is ::).
  • --containers instructs Scaphandre to inspect cgroups and inject container metadata labels (such as container ID and pod name) into the exposed metric series.

To run Scaphandre as a permanent system service, create a systemd unit file at /etc/systemd/system/scaphandre.service:

[Unit]
Description=Scaphandre Energy Metrology Prometheus Exporter
After=network.target

[Service]
Type=simple
ExecStart=/usr/local/bin/scaphandre prometheus -p 8080 -a 127.0.0.1 --containers
Restart=always
RestartSec=5
User=root

[Install]
WantedBy=multi-user.target

Enable and start the service using systemctl:

sudo systemctl daemon-reload
sudo systemctl enable --now scaphandre.service
sudo systemctl status scaphandre.service

Step 5: Configure the Prometheus Server Scrape Target

Integrate the Scaphandre telemetry endpoint into your centralized Prometheus configuration file (typically /etc/prometheus/prometheus.yml) by appending a scrape job configuration:

scrape_configs:
  - job_name: 'scaphandre'
    scrape_interval: 10s
    scrape_timeout: 5s
    static_configs:
      - targets: ['node01.hpc.institution.edu:8080']
        labels:
          cluster: 'production-hpc'
          datacenter: 'west-campus'

Reload Prometheus configuration to apply changes:

sudo systemctl reload prometheus

Step 6: Query Telemetry Metrics in PromQL

Open the Prometheus Web UI or Grafana and verify that metrics are arriving from Scaphandre. Useful PromQL expressions include:

  • Instantaneous Host Power in Watts:
    scaph_host_power_microwatts / 1000000
  • Total Cumulative Host Energy in Kilowatt-Hours:
    scaph_host_energy_microjoules / 3600000000000
  • Top 5 Power-Consuming Executables on Node:
    topk(5, sum by (exe) (scaph_process_power_consumption_microwatts / 1000000))
  • Energy Consumed by Specific Container Over Past Hour (in Joules):
    increase(scaph_process_power_consumption_microwatts{container_id="target_id"}[1h]) / 1000000

Step 7: Configure Hypervisor Telemetry Propagation for Virtual Machines

In virtualized cloud environments where research virtual machines (VMs) run on QEMU/KVM hypervisors, physical RAPL hardware counters cannot be accessed directly by guest operating systems. Scaphandre solves this through its qemu exporter, which computes per-VM power on the host and exports a virtualized sysfs tree via a virtiofs shared filesystem:

  1. On the KVM hypervisor host, create a dedicated tmpfs mount point for the target domain:
    sudo mkdir -p /var/lib/libvirt/scaphandre/guest_vm1
    sudo mount -t tmpfs tmpfs_guest_vm1 /var/lib/libvirt/scaphandre/guest_vm1 -o size=5m
  2. Configure the virtual machine domain XML via sudo virsh edit guest_vm1 to pass the directory to the guest using virtiofs filesystem sharing with driver type virtiofs, source directory /var/lib/libvirt/scaphandre/guest_vm1, target directory scaphandre, and readonly access.
  3. Start Scaphandre on the hypervisor using the QEMU exporter:
    sudo scaphandre qemu
  4. Inside the guest virtual machine, mount the virtiofs filesystem and run Scaphandre using the --vm flag:
    sudo mount -t virtiofs scaphandre /var/scaphandre
    sudo scaphandre --vm stdout -t 15

Output and how to read it

Scaphandre produces structured, standardized telemetry data formatted either as interactive terminal tables or as Prometheus-compatible key-value metrics. Understanding the units, mathematical derivations, and sampling boundaries of these outputs is essential for rigorous scientific data interpretation.

Prometheus Metrics Nomenclature and Units

When running the Prometheus exporter, Scaphandre publishes time-series metrics adhering to Prometheus naming conventions. All power values are expressed in microwatts (μW), and all cumulative energy values are expressed in microjoules (μJ):

  • scaph_host_power_microwatts (Gauge): Represents the estimated instantaneous power draw of the entire physical host, calculated as the sum of all active CPU sockets and associated hardware domains over the sampling step. To convert this metric to conventional electrical watts (W), divide the value by 1,000,000:

    PW = PμW × 10−6

    For example, a reading of 145000000 corresponds to exactly 145.0 watts.

  • scaph_host_energy_microjoules (Counter): A monotonically increasing counter tracking the cumulative electrical energy consumed by the host since the sensor initialized. This value is derived directly from the hardware RAPL energy registers. Because energy equals power integrated over time, the rate of increase of this counter reflects instantaneous power. To convert microjoules to kilowatt-hours (kWh) for energy billing and carbon accounting, divide by 3,600,000,000,000 (3.6 × 1012):

    EkWh = EμJ / (3.6 × 1012)

  • scaph_socket_power_microwatts (Gauge): Tracks instantaneous power consumption attributed to a specific CPU socket on multi-socket motherboards, labeled with socket_id="0", socket_id="1", etc. This enables researchers to verify whether multi-threaded research software distributes load evenly across physical Non-Uniform Memory Access (NUMA) nodes.
  • scaph_process_power_consumption_microwatts (Gauge): The process-level attributed power consumption, labeled with metadata attributes including pid (process ID), exe (executable binary name), and cmdline (command-line arguments, if enabled).

Mathematical Model of Process Power Attribution

A critical technical distinction of Scaphandre is its methodology for attributing physical hardware power to individual operating system processes. Hardware RAPL sensors operate at the package and core domain levels; physical silicon lacks separate electrical sensors for individual processes or software threads. To bridge this gap, Scaphandre employs a proportional CPU time attribution model.

During each sampling step of duration Δt, Scaphandre reads the cumulative user-space CPU time (utime) and kernel-space CPU time (stime) consumed by process i from /proc/[pid]/stat. The change in CPU time for process i is defined as:

ΔJi = (utimei, t + stimei, t) − (utimei, t−Δt + stimei, t−Δt)

Concurrently, Scaphandre computes the total CPU jiffies ΔJtotal consumed across all physical and logical CPU cores on the socket during the same interval Δt, extracted from /proc/stat. The hardware socket power Psocket is obtained by calculating the difference between successive RAPL energy readings:

Psocket = (ERAPL, t − ERAPL, t−Δt) / Δt

The power attributed to process i is then calculated as the proportion of its CPU time relative to total system CPU activity, scaled by the measured socket power:

Pprocess, i = Psocket × (ΔJi / ΔJtotal)

This proportional attribution model provides an accurate, fair allocation of dynamic CPU power. However, researchers must account for its operational assumptions: background non-CPU energy consumption (such as motherboard chipset idle power, storage drives, and cooling fans) is not captured by RAPL package sensors, and memory power (DRAM RAPL domain) is only included if supported and reported by the host CPU model.

Reading Stdout Terminal Output

When running in stdout mode, Scaphandre renders a tabular view refreshed at each step interval. The header displays host-level metrics:

Host: 124.50 W | Socket 0: 62.10 W | Socket 1: 62.40 W

Beneath the header, a ranked list displays active processes sorted by instantaneous consumption:

PID     EXE                     CPU %   POWER (W)
41928   python3                 78.2    48.56
41935   gromacs_mpi             99.4    61.72
1240    systemd-journald        0.4     0.25
892     prometheus              1.2     0.74

In this display, PID indicates the operating system process identifier, EXE represents the executing binary name, CPU % reflects normalized CPU core utilization over the step window, and POWER (W) represents the attributed power calculated according to the proportional attribution formula.

For comparative performance benchmarks across different profiling tools and telemetry architectures, refer to the data table below, which summarizes hardware access mechanisms, attribution scopes, and system overheads across popular scientific energy metrology software.

Troubleshooting

Deploying energy metrology agents on modern Linux kernels frequently encounters hardware permissions, virtualization barriers, and driver constraints. Common failure modes and their technical remediations include:

1. Permission Denied Accessing sysfs Energy Counters

Symptom: Scaphandre fails during sensor initialization with errors such as Permission denied (os error 13) when reading /sys/class/powercap/intel-rapl/intel-rapl:0/energy_uj.

Cause: In November 2020, security researchers published the PLATYPUS side-channel attack (CVE-2020-8694), demonstrating that unprivileged users could infer cryptographic keys by observing microscopic fluctuations in RAPL energy counters. In response, the upstream Linux kernel community modified the file permissions of energy_uj from world-readable (0444) to root-only (0400).

Solution: Scaphandre must be executed with administrative privileges using sudo, or the binary must be granted the raw I/O capability using Linux capabilities:

sudo setcap cap_sys_rawio+ep /usr/local/bin/scaphandre

Alternatively, in controlled, single-tenant lab environments, administrators can deploy a custom udev rule (e.g., /etc/udev/rules.d/99-scaphandre-powercap.rules) to permit non-root read access to a designated group:

SUBSYSTEM=="powercap", ACTION=="add", RUN+="/bin/chmod -R g+r /sys/class/powercap/intel-rapl"

2. Missing intel_rapl Kernel Modules

Symptom: Scaphandre exits with the log message: Couldn't find intel_rapl modules... or the directory /sys/class/powercap/intel-rapl does not exist.

Cause: The Linux powercap RAPL kernel drivers have not been loaded, or the hardware microarchitecture does not support RAPL telemetry.

Solution: Load the necessary kernel modules manually using modprobe:

sudo modprobe intel_rapl_common
sudo modprobe intel_rapl_msr

On kernels older than 5.0, load the legacy driver via sudo modprobe intel_rapl. If loading the module fails or the sysfs directory remains absent, inspect kernel boot logs using dmesg | grep -i rapl. Virtual machines, container hosts without volume passthrough, and legacy processors manufactured prior to 2011 do not support hardware RAPL.

3. Running Inside Virtual Machines Without Hypervisor Passthrough

Symptom: Inside an AWS EC2 instance, Google Cloud VM, or local VirtualBox guest, Scaphandre reports that no RAPL devices are found.

Cause: Commercial cloud providers and standard virtual machine monitors do not expose physical x86 Model-Specific Registers (MSRs) or RAPL hardware counters to unprivileged guest virtual machines to prevent cross-tenant side-channel attacks.

Solution: In private cloud environments (OpenStack or libvirt/KVM), configure the host hypervisor to run Scaphandre with the qemu exporter, streaming energy files to the guest via virtiofs. In commercial public cloud environments where hypervisor access is impossible, use process-level software estimation frameworks that approximate energy from CPU load percentages and published Thermal Design Power (TDP) specifications.

4. Docker and Podman Permission Failures Under SELinux

Symptom: When launching Scaphandre inside Docker or Podman on Red Hat Enterprise Linux, Rocky Linux, or Fedora, Scaphandre exits immediately with permission errors when accessing /proc or /sys/class/powercap.

Cause: SELinux enforcement blocks containerized processes from reading sensitive host kernel interfaces.

Solution: Pass the --privileged flag and the :z or :Z volume mount flags to allow container access through SELinux policies:

podman run --privileged --rm -ti   -v /sys/class/powercap:/sys/class/powercap:ro   -v /proc:/proc:ro   hubblo/scaphandre stdout -t 15

5. AMD Processor Domain Discrepancies

Symptom: On AMD EPYC or Ryzen processors, Scaphandre reports host and package power, but core-level subdomains (such as core or uncore) are absent.

Cause: AMD implements RAPL through its Energy Status MSRs (introduced in Zen microarchitectures). Unlike Intel implementations, which frequently provide separate energy counters for individual cores, graphics units, and DRAM memory channels, many AMD processors report only the aggregate package energy (Package RAPL) and per-core energy counters via sysfs.

Solution: This is expected hardware behavior and not a software defect. Scaphandre will utilize the available package-level RAPL counter and accurately distribute power across running processes using its proportional CPU time algorithm.

Free alternatives

While Scaphandre provides an effective, non-invasive telemetry daemon for Linux hosts, research software engineers and scientific computing teams have access to several open-source alternatives tailored to different operational paradigms, programming languages, and hardware infrastructures.

The primary alternatives include:

  • CodeCarbon: An open-source Python package developed collaboratively by Mila, BCG GAMMA, Haverford College, and Comet.ml. Rather than operating as an external operating system daemon, CodeCarbon is embedded directly into Python computational scripts using inline decorators or context managers. In addition to measuring RAPL energy on Linux, CodeCarbon interfaces directly with NVIDIA Management Library (NVML) to capture graphics processing unit (GPU) energy consumption and queries regional carbon intensity APIs to convert energy directly into grams of carbon dioxide equivalent (gCO2eq). It is optimal for individual data science and machine learning research workflows.
  • Kepler (Kubernetes Efficient Power Level Exporter): A Cloud Native Computing Foundation (CNCF) sandbox project created by Red Hat. Kepler utilizes extended Berkeley Packet Filter (eBPF) kernel tracepoints to monitor CPU performance counters, process scheduling events, and container boundaries within Kubernetes clusters. Kepler feeds real-time telemetry into machine learning power models that estimate container and pod-level power consumption, making it the industry standard for cloud-native Kubernetes research infrastructures.
  • PowerAPI: A modular software-defined power measurement framework created by the Spirals research team at Inria and the University of Lille. PowerAPI decouples hardware sensor acquisition (using hardware performance counters via perf_event) from mathematical power models (such as the SmartWatts formula). Implemented in Scala and Python, PowerAPI allows researchers to design, validate, and test custom empirical power models for emerging computational architectures.
  • LIKWID (likwid-powermeter): A low-level performance profiling tool suite developed by the Erlangen National High Performance Computing Center (NHR@FAU). LIKWID provides the likwid-powermeter command-line utility, which interfaces directly with x86 Model-Specific Registers (MSRs) and PCI configuration space to measure RAPL package, core, and memory energy consumption over targeted execution intervals without background daemon overhead.
  • Turbostat: An official Linux kernel utility maintained directly within the Linux source tree under tools/power/x86/turbostat. Turbostat reports processor frequency, operating C-states, core temperature, and hardware RAPL power directly from MSRs with microsecond precision, serving as the ground-truth standard for low-level microprocessor power analysis.

The following table outlines the architectural trade-offs, measurement mechanisms, and typical environments for these open-source tools:

Tool Name Architecture / Language Telemetry Mechanism Primary Environment Integration Method
Scaphandre Rust Linux RAPL sysfs and MSR Bare-metal Linux servers and VMs External system daemon (Prometheus/stdout)
CodeCarbon Python RAPL sysfs, NVML, Windows EMI Python ML / Data science pipelines Inline library import / decorator
Kepler Go / eBPF eBPF tracepoints and RAPL Kubernetes container clusters Cluster DaemonSet with Prometheus exporter
PowerAPI Scala / Python Hardware counters and SmartWatts Systems and Green IT research labs Modular multi-process architecture
LIKWID C x86 MSRs and PCI config space HPC supercomputing clusters CLI command wrapper (likwid-powermeter)
Turbostat C (Kernel tool) Direct x86 MSR queries Kernel and hardware performance engineering Interactive terminal CLI tool

Frequently asked questions

What hardware is required to run Scaphandre?

Scaphandre requires an x86_64 host system equipped with an Intel processor from the Sandy Bridge generation (2011) or newer, or an AMD processor from the Zen microarchitecture (2017) or newer. These architectures provide the hardware Running Average Power Limit (RAPL) energy status registers required by the underlying Linux powercap kernel driver. ARM-based servers and legacy processors lacking hardware energy registers cannot provide telemetry to Scaphandre’s RAPL sensors.

Does Scaphandre measure GPU or DRAM energy consumption?

Scaphandre focuses primarily on CPU socket and core energy consumption reported by the processor RAPL interface. If the host CPU and motherboard BIOS support and expose the RAPL DRAM power domain via sysfs (common on server-class Intel Xeon processors), memory power is measured. However, Scaphandre does not currently provide native sensors for discrete graphics processing units (such as NVIDIA GPUs via NVML). For research workloads that combine heavy GPU computation with CPU execution, researchers frequently pair Scaphandre with GPU-specific exporters such as Prometheus NVIDIA DCGM exporter or CodeCarbon.

How does Scaphandre differ from CodeCarbon?

The primary difference lies in deployment architecture and measurement scope. Scaphandre runs as an independent system-level daemon that measures all running processes on a host without modifying application code, making it ideal for multi-tenant HPC nodes, compiled languages, and container infrastructure. In contrast, CodeCarbon is a Python library embedded directly into specific research scripts via decorators or context managers, capturing application-specific execution blocks, calculating regional grid carbon intensities, and monitoring GPU telemetry directly.

Why does Scaphandre require root privileges on Linux?

Following mitigations for the PLATYPUS side-channel vulnerability (CVE-2020-8694), Linux kernel maintainers restricted read access to the hardware energy counter files in /sys/class/powercap/intel-rapl/ to the root user (permissions 0400). Because unprivileged access to high-frequency energy measurements could allow malicious processes to infer cryptographic keys, Scaphandre must run as root or be granted the CAP_SYS_RAWIO Linux capability to sample hardware power registers.

Can Scaphandre monitor energy usage inside virtual machines?

Standard virtual machines cannot read physical RAPL hardware counters because hypervisors do not pass raw MSR registers to unprivileged guests. However, Scaphandre supports a specialized QEMU exporter that runs on the KVM hypervisor host, calculates per-VM power, and passes virtualized energy sysfs trees into guest virtual machines over a virtiofs shared filesystem. Guest instances then access this virtualized telemetry using Scaphandre with the --vm flag.

What is the runtime performance overhead of running Scaphandre?

Written in Rust, Scaphandre is engineered for low latency and minimal resource consumption. In typical production deployments configured with a 2-second or 10-second sampling step, Scaphandre consumes less than 0.5% of a single CPU core and approximately 20 to 40 megabytes of resident memory. This negligible computational footprint ensures that Scaphandre can run continuously across production HPC compute nodes without introducing measurement bias or degrading the execution performance of primary scientific simulations.

Sources

  • Hubblo. “Scaphandre: Energy Consumption Metrology Agent.” GitHub Repository, accessed 2026-11-16. https://github.com/hubblo-org/scaphandre
  • Hubblo. “Scaphandre Documentation: Architecture, Sensors, and Exporters.” Hubblo Documentation, accessed 2026-11-16. https://hubblo-org.github.io/scaphandre-documentation/
  • Hubblo. “Scaphandre Documentation: Prometheus Exporter Reference.” Hubblo Documentation, accessed 2026-11-16. https://hubblo-org.github.io/scaphandre-documentation/references/exporter-prometheus.html
  • Hubblo. “Scaphandre Documentation: PowercapRAPL Sensor Reference.” Hubblo Documentation, accessed 2026-11-16. https://hubblo-org.github.io/scaphandre-documentation/references/sensor-powercap-rapl.html
  • Linux Kernel Organization. “Running Average Power Limit (RAPL) Interface.” Linux Kernel Documentation, accessed 2026-11-16. https://www.kernel.org/doc/html/latest/power/powercap/powercap.html
  • Cloud Native Computing Foundation. “Kepler (Kubernetes Efficient Power Level Exporter).” CNCF Sandbox Projects, accessed 2026-11-16. https://sustainable-computing.io/

Data: Scientific Computing Energy Metrology and Power Profiling Tools

Comparative matrix of open-source power metrology agents, hardware telemetry interfaces, and process-level energy attribution tools used in high-performance computing, scientific workloads, and sustainable research infrastructure, compiled from official project documentation and kernel specifications.

Period covered: 2024/2026. Coverage: Global.

Scientific Computing Energy Metrology and Power Profiling Tools
ToolTelemetry MechanismAttribution ScopePrimary ExportersPrivilege RequirementTypical Overhead (%)
ScaphandreIntel/AMD RAPL sysfs and MSRProcess-level via CPU time scaling and host-levelPrometheus HTTP, stdout, JSON, Riemann, Warp10Root or CAP_SYS_RAWIO (CVE-2020-8694)0.5
CodeCarbonRAPL sysfs, Windows EMI, Apple powermetrics, NVMLProcess-level and inline code block decoratorsCSV, HTTP API dashboard, Prometheus, LoggerUser-space with udev rules, or root0.8
KeplereBPF tracepoints, RAPL sysfs, ACPI, NVMLContainer, Pod, and namespace level in KubernetesPrometheus metrics endpointPrivileged DaemonSet with BPF capabilities1
PowerAPIHardware performance counters, RAPL, SmartWatts formulaProcess-level via software-defined power formulaMongoDB, InfluxDB, CSV, OpenTSDBRoot or perf_event access0.6
LIKWIDx86 MSRs and PCI config space registersThread, core, socket, and application execution levelstdout, CSV, and text summariesRoot, suid-root access daemon, or msr kernel safe access0.3
TurbostatDirect x86 MSR queries via kernel driverPackage, core, uncore, and thread levelstdout text stream and CSV file outputRoot or CAP_SYS_RAWIO access to /dev/cpu/*/msr0.2

Sources

Compiled by CASRAI from the sources above. Free to reuse under CC BY 4.0 with attribution.

Follow CASRAI

Research-administration guidance, standards updates and independent tool reviews.

Ask CASRAI · full access

Ask about Scaphandre: Measuring Energy Consumption in Scientific Computing

Full access: large monthly usage, up to 10 source passages behind each answer, and MCP and API access for Claude Code, Codex and other CLIs. Cancel any time.

An AI assistant for research: funder rules, compliance, methods and publishing. It links the sources behind its answers and labels answers that come from a web search.

Answers draw on CASRAI's guides and dictionary plus the federal and funder documents we index: Federal Register, Grants.gov, Regulations.gov and UKRI.

Works on this site and inside Claude, Cursor and the AI tools you already use.

Everything CASRAI publishes — this page, the dictionary, the guides and the news — stays open to read, with no account and no card.

Referenced across the research world

University of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logoUniversity of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logo
  • University of Cambridge logo
  • Columbia University logo
  • Crossref logo
  • University of Edinburgh logo
  • Harvard University logo
  • University of Oxford logo
  • Princeton University logo
  • Stanford School of Medicine logo
  • University College London logo
  • ORCID logo

View CASRAI adoption →