Skip to content

Sensor Sources

Damien edited this page Oct 18, 2026 · 1 revision

🔬 Sensor sources

Emissions and electricity sources

Electricity carbon intensity

These sources provide the carbon intensity used to convert electricity consumption into estimated CO2 emissions. The country-level value is used when a country is selected; the IEA value is used for the world average.

Electricity prices

The source provides household electricity prices in US dollars. When the data is fetched, the corresponding exchange rate is calculated to display the price in the each country's local currency.

Network emissions

D. Al Kez, A. M. Foley, D. Laverty, D. F. Del Rio, and B. Sovacool, "Exploring the sustainability challenges facing digitalization and internet data centers", Journal of Cleaner Production, vol. 371, no. 371, p. 133633, 2022.

This source supports the estimate that internet usage generates indirect emissions from network infrastructure and remote servers (28-63 g CO2/GB). These emissions are presented as context and are not included in WattSeal's direct measurements.

Manufacturing and water consumption

  • N. Six, "What's the carbon footprint of a computer?", Le Monde, Apr. 30, 2023. Supports the estimate of approximately 250-500 kg CO2eq in one-time manufacturing and transport emissions, with additional impact from gaming PCs, monitors, and peripherals.
  • M. Yañez-Barnuevo, "Data Centers and Water Consumption", EESI, Jun. 25, 2025. Supports the estimate of approximately 1.9 L/kWh of water consumption for data-center cooling, alongside water use in mineral extraction.

These sources provide context for the wider environmental footprint of digital equipment. They are not included in WattSeal's electricity-use measurements.

Per-component sources

The sources of the metrics collected and estimated by WattSeal for every sensor and OS:

CPU Metrics

Windows

  • Library: msr-driver-rs (custom Rust wrapper for the Scaphandre and WinRing0 drivers).
  • Driver: WinRing0 RAPL Driver (requires admin rights for installation and start).
  • Source: Model-Specific Registers (MSR).
  • Energy counter conversion:
    • The MSR energy registers return a raw counter value (64-bit from EDX:EAX with only 32 bits used).
    • Read the energy unit from MSR_RAPL_POWER_UNIT (Intel) or ENERGY_PWR_UNIT_MSR (AMD): energy_unit = 1 / 2^energy_unit_raw where energy_unit_raw is bits 8-12 of the MSR (Intel manual chapter 14.9.1).
    • Convert the raw counter to energy: energy_joules = raw_energy_counter * energy_unit.
    • The measurement uses two samples and takes the difference: delta_energy_joules = energy_joules_current - energy_joules_previous.
  • Calculation:
    • The energy is extracted per RAPL domain (pkg, pp0, pp1, dram) by reading:
      • Intel: MSR_PKG_ENERGY_STATUS, MSR_PP0_ENERGY_STATUS, MSR_PP1_ENERGY_STATUS, MSR_DRAM_ENERGY_STATUS.
      • AMD: ENERGY_PKG_MSR, ENERGY_CORE_MSR.

Linux

  • Library: Standard file system access (needs sudo).
  • Source: Linux Kernel powercap framework documentation.
    • Path: /sys/class/powercap/intel-rapl:0/energy_uj.
  • Calculation: Directly reads microjoules ($\mu J$) from the sysfs interface and calculates the power over the measurement interval.

Fallback (OS without RAPL support or insufficient permissions, currently always on macOS)

  • Library: sysinfo (for CPU usage).
  • Source: Hardcoded TDP (Thermal Design Power) lookup table in estimation.rs.
  • Calculation: Non-linear power estimation $P = P_{idle} + (P_{peak} - P_{idle}) \times \text{usage}^{1.6}$ where usage is the percentage of CPU utilization, $P_{idle}$ is assumed to be 20% and $P_{peak}$ 125% of TDP (coefficients based on measurements on laptops and non-linear model from a Google article on server power estimation).

GPU Metrics

NVIDIA (Windows & Linux)

  • Library: nvml-wrapper.
  • Source: NVIDIA Management Library (NVML).
  • Metrics: Energy delta in millijoules (mJ), GPU utilization, and Memory (VRAM) utilization.

AMD (Windows only)

  • Library: adlx.
  • Source: AMD Display Library X (ADLX).
  • Metrics: Accesses the "Performance Monitoring Services" to retrieve real-time power (mW) and usage statistics.

Intel (Windows only)

  • Library: Win32 Performance Data Helper (PDH).
  • Source: Windows Performance Counter: \GPU Engine(*)\Utilization Percentage. Power consumption comes from PP1.

Fallback (when vendor telemetry doesn't provide power/energy)

  • Library: nvml-wrapper (NVIDIA), adlx (AMD), PDH (Intel) for usage.
  • Source: GPU utilization percentage.
  • Calculation: Non-linear power estimation $P = P_{idle} + (P_{peak} - P_{idle}) \times \text{usage}^{1.6}$ where usage is the percentage of GPU utilization, $P_{idle}$ is assumed to be 10% and $P_{peak}$ 100% of TDP (coefficients based on measurements on laptops and non-linear model from a An Integrated GPU Power and Performance Model).

RAM Metrics

  • Library: sysinfo.
  • Power Estimation: Fixed at a constant 5W for the entire memory bank, should be per-stick constant or DRAM (Scaphandre doc).

Disk Metrics

  • Library: sysinfo, real read/written bytes during the sampling period.
  • Source: Disk I/O throughput counters.
  • Power Estimation:

Network Metrics

  • Library: sysinfo, real sent/received bytes during the sampling period.
  • Source: Network interface throughput counters.
  • Power Estimation:

Process Attribution

  • Library: sysinfo (for per-process CPU/RAM/Disk usage).
  • Logic:
    • CPU Share: $\frac{\text{Process CPU Usage}}{\text{Total CPU Usage}} \times \text{Total CPU Power}$.
    • GPU Share: $\frac{\text{Process GPU Usage}}{\text{Total GPU Usage}} \times \text{Total GPU Power}$.
    • Final Attribution: The process power is the sum of its attributed compute power (CPU + GPU), weighted against the total system power. Custom calculation to encourage responsible usage: if only one process is using the CPU and GPU, it is attributed 100% of the power consumption.

Clone this wiki locally