<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta>
      <journal-title-group>
        <journal-title>Rennes, France, June</journal-title>
      </journal-title-group>
    </journal-meta>
    <article-meta>
      <title-group>
        <article-title>Power Bench: An Automated Benchmark Tool for Power Estimation in Single-Board Computers - Extended Abstract</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Houssam Kanso</string-name>
          <email>houssam.kanso@univ-pau.fr</email>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
          <xref ref-type="aff" rid="aff2">2</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Adel Noureddine</string-name>
          <email>adel.noureddine@univ-pau.fr</email>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
          <xref ref-type="aff" rid="aff2">2</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Ernesto Exposito</string-name>
          <email>ernesto.exposito@univ-pau.fr</email>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
          <xref ref-type="aff" rid="aff2">2</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>In: B. Combemale</institution>
          ,
          <addr-line>G. Mussbacher, S. Betz, A. Friday, I. Hadar, J. Sallou, I. Groher, H. Muccini, O. Le Meur, C. Herglotz, E</addr-line>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Power Consumption</institution>
          ,
          <addr-line>Measurement, Power Estimation, Automated, Single-Board Computers, SBCs</addr-line>
        </aff>
        <aff id="aff2">
          <label>2</label>
          <institution>Universite de Pau et des Pays de l'Adour</institution>
          ,
          <addr-line>E2S UPPA, LIUPPA, Anglet</addr-line>
          ,
          <country country="FR">France</country>
        </aff>
      </contrib-group>
      <pub-date>
        <year>2023</year>
      </pub-date>
      <volume>0</volume>
      <fpage>5</fpage>
      <lpage>09</lpage>
      <abstract>
        <p>models for various Single-Board Computers (SBCs) such as Raspberry Pi, Asus TinkerBoard, etc. This tool stresses the CPU with variable theoretical loads, then collects data on CPU cycles and measures the power consumed by the device for each load. CPU Power Bench automatically applies linear and polynomial regression algorithms on the collected data to generate power models, as we have observed a correlation between CPU utilization and power consumption in SBCs.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>Tool
CPU Power Bench is an automated benchmark tool designed to accurately generate power estimation</p>
    </sec>
    <sec id="sec-2">
      <title>1. Introduction</title>
      <p>Nowadays, single-board computers (SBCs) are widely used in various embedded systems and
Internet of Things (IoT) applications due to their small size, low cost, and low power consumption.
This type of device may be powered by batteries or other portable power sources. Power
consumption is a critical factor in defining the overall performance and energy eficiency of
these devices. Thus, measuring or estimating the power consumption of these devices is a
crucial first step toward optimizing their energy usage.</p>
      <p>
        Some state-of-the-art approaches involve the use of hardware meters (such as in [
        <xref ref-type="bibr" rid="ref1 ref2">1, 2</xref>
        ]).
These are physical devices that can be attached to a computing device to measure its power
consumption. Hardware meters can provide accurate power measurements. However,
hardwarebased approaches may require costly specialized equipment.
      </p>
      <p>
        Other solutions are software-based, they are more accessible, less costly, and more scalable
(such as in [
        <xref ref-type="bibr" rid="ref3 ref4">3, 4</xref>
        ]). However, they may not always be as accurate as hardware meters and can
be afected by various factors, such as the device’s workload or environmental conditions. As
https://www.noureddine.org/ (A. Noureddine); https://eexposit.perso.univ-pau.fr/ (E. Exposito)
© 2023 Copyright for this paper by its authors. Use permitted under Creative Commons License Attribution 4.0 International (CC BY 4.0).
a result, researchers have been working on improving the accuracy of software-based power
estimation techniques by incorporating machine learning algorithms.
      </p>
      <p>In this tool demo paper, we introduce CPU Power Bench an automated power consumption
model generation tool. In Section 2, we present the energy and metrics benchmarking
architecture. In Section 3, we present the relevance of our tool and its use in understanding the energy
consumption of each device.</p>
    </sec>
    <sec id="sec-3">
      <title>2. CPU Power Bench</title>
      <p>CPU Power Bench is an automated benchmark to accurately generate a power model for
singleboard computers (Raspberry Pi, Asus TinkerBoard, etc.). Our tool’s primary objective is to
generate power estimation models for any SBC in a simple and automated manner. The tool
runs three sets of scripts that stress the CPU with loads ranging from 0 to 100% and collects
real-time CPU cycles. Simultaneously, it collects the power consumed by the device from the
wattmeter. Then, it uses the theoretical and practical collected data to generate linear and
polynomial power estimation models.</p>
      <p>CPUPowerBench
CPULoad.csv
(start_time,end_time,theoratical_U)
CPUCycles.csv
(time,measured_U)
cpu-benchmark component
cpu-load generator
cpu-cycles collector
model-generation component</p>
      <p>CPU Load</p>
      <p>CPU Cycles
Power.csv
(time,power)</p>
      <p>CPU
Wattmeter
completeSynchedData.csv</p>
      <p>Linear Power Polynonial Power</p>
      <p>Estimation Model Estimation Model</p>
      <p>Concretely, our architecture, in Figure 1, is composed of three components: a cpu-load
generator, a cpu-cycle collector, and a model-generation component. In the following, we detail
each of these components.</p>
      <p>
        • cpu-benchmark component:
– cpu-load generator: The benchmark produces a workload by applying various loads
on the processor of the device. Our strategy is to apply a stress load on the CPU,
spanning the entire load spectrum, starting from 0% to 100% with an increase of 5%
in each step. The stress is applied for 60 seconds at each percentage interval, and
we save the workload timestamp, storing all the data in a CSV file (CPULoad.csv).
We initially used the same stress command (or stress-ng) used in the literature [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ]
to specify a percentage CPU load. However, we noticed that the CPU load was
inconsistent, with the actual CPU load altering between 0% or 100% in various time
duration, rather than consistently stabilizing at the asked percentage load. Instead,
we used a Python script, CPULoadGenerator [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ], which consistently stressed the
CPU at the asked percentage with a small degree of variation.
– cpu-cycles generator: The data collector component is a program that collects
CPU metrics. In particular, we collect CPU cycles from the Linux proc interface
(/ p r o c / s t a t ). Then, we calculate the CPU utilization (ranging from 0 to 1) and save
this data to another CSV file (CPUCycles.csv).
• model-generation component: Takes as input the CPUCycles.csv, CPULoad.csv, and
Power.csv (data collected by the wattmeter) to synchronize the data into the
completeSynchedData.csv. Then, it uses the same data to generate power estimation models
(Linear and polynomial) using the scikit-learn machine learning library. It also calculates
the best polynomial degree (ranging from 1 to 9) before generating the power estimation
model based on the polynomial function.
      </p>
      <p>
        CPU Power Bench was tested to generate power estimation models for a series of Raspberry
Pis (Zero W, 1B, 1B+, 2B, 3B, 3B+, 4B, and 4B+), in addition to ASUS Tinker Board. It provided
highly accurate power estimation models for each of these devices with error rates as low
as 0.33% and up to 7.81% for linear models, and 0.3% up to 3.83% for polynomial models.
CPU Power Bench has much lower error rates when compared to state-of-the-art approaches:
14.56% for PowerPi [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] and 40.76% for EMM [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ].
      </p>
    </sec>
    <sec id="sec-4">
      <title>3. Relevance and novelty</title>
      <p>CPU Power Bench is a tool designed to generate accurate power estimation models in an
automated way. It integrates all the required components into a single easy-to-use tool. The
tool can be used to simulate a wide range of workloads on the device’s processor, allowing
researchers to analyze power consumption under diferent operating conditions. By stress
testing the device, users can assess the power consumption of the device under heavy loads and
determine the maximum power consumption that the device can handle. One of the key features
of CPU Power Bench is its ability to implement power estimation models on a large scale of SBC
devices, even if they are not connected to the internet. This feature is particularly useful for
researchers and developers to test and analyze the power consumption of a variety of devices.
Another advantage of CPU Power Bench is its architecture, which ensures compatibility with
numerous devices.</p>
    </sec>
    <sec id="sec-5">
      <title>Acknowledgments</title>
      <p>The project leading to this publication has received funding from Excellence Initiative of
Université de Pau et des Pays de l’Adour - I-Site E2S UPPA, a French ”Investissements d’Avenir”
programme.
The source code of the CPU Power Bench is available via CPU Power Benchmark GitHub Project
(github.com/joular/cpupowerbench).</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>F.</given-names>
            <surname>Astudillo-Salinas</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Barrera-Salamea</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Vazquez-Rodas</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            <surname>Solano-Quinde</surname>
          </string-name>
          ,
          <article-title>Minimizing the power consumption in Raspberry Pi to use as a remote WSN gateway</article-title>
          ,
          <source>in: 2016 8th IEEE Latin-American Conference on Communications (LATINCOM)</source>
          , IEEE, Medellin, Colombia,
          <year>2016</year>
          , pp.
          <fpage>1</fpage>
          -
          <lpage>5</lpage>
          .
          <source>doi:1 0 . 1 1</source>
          <volume>0</volume>
          <fpage>9</fpage>
          <string-name>
            <surname>/ L A T I N C O M</surname>
          </string-name>
          .
          <volume>2 0 1 6 . 7 8 1 1 5 9 0 .</volume>
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <surname>ALCIOM</surname>
          </string-name>
          , Powerspy2
          <article-title>- experts systèmes électroniques [online]</article-title>
          ,
          <source>Apr. 06</source>
          ,
          <year>2023</year>
          . URL: https: //www.alciom.com/en/our-trades/products/powerspy2/.
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>F.</given-names>
            <surname>Kaup</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Gottschling</surname>
          </string-name>
          , D. Hausheer,
          <article-title>PowerPi: Measuring and modeling the power consumption of the Raspberry Pi</article-title>
          ,
          <source>in: 39th Annual IEEE Conference on Local Computer Networks</source>
          , IEEE, Edmonton, AB,
          <year>2014</year>
          , pp.
          <fpage>236</fpage>
          -
          <lpage>243</lpage>
          .
          <source>doi:1 0 . 1 1</source>
          0 9 / L C N .
          <volume>2 0 1 4 . 6 9 2 5 7 7 7 .</volume>
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>P. M.</given-names>
            <surname>Sánchez Sánchez</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J. M.</given-names>
            <surname>Jorquera Valero</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A. Huertas</given-names>
            <surname>Celdrán</surname>
          </string-name>
          , G. Bovet,
          <string-name>
            <given-names>M. Gil</given-names>
            <surname>Pérez</surname>
          </string-name>
          ,
          <string-name>
            <surname>G.</surname>
          </string-name>
          <article-title>Martínez Pérez, LwHBench: A low-level hardware component benchmark and dataset for Single Board Computers</article-title>
          , Internet of Things (
          <year>2023</year>
          )
          <article-title>100764</article-title>
          . URL: https://linkinghub. elsevier.com/retrieve/pii/S2542660523000872.
          <source>doi:1 0 . 1 0 1 6 / j . i o t . 2</source>
          <volume>0 2 3 . 1 0 0 7 6 4 .</volume>
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>K.</given-names>
            <surname>Kesrouani</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H.</given-names>
            <surname>Kanso</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Noureddine</surname>
          </string-name>
          ,
          <article-title>A Preliminary Study of the Energy Impact of Software in Raspberry Pi devices</article-title>
          , in: 29th IEEE International Conference on Enabling Technologies:
          <article-title>Infrastructure for Collaborative Enterprises</article-title>
          , Bayonne, France,
          <year>2020</year>
          , pp.
          <fpage>231</fpage>
          -
          <lpage>234</lpage>
          .
          <source>doi:1 0 . 1 1</source>
          <volume>0</volume>
          <fpage>9</fpage>
          <string-name>
            <surname>/ W E T I C E</surname>
          </string-name>
          <article-title>4 9 6 9 2 . 2 0 2 0 . 0 0 0 5 2</article-title>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>G.</given-names>
            <surname>Carlucci</surname>
          </string-name>
          , CPU Load Generator ,
          <year>2017</year>
          . URL: https://github.com/GaetanoCarlucci/ CPULoadGenerator.
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>