Likwid installation#

LIKWID#

cf. installation commands

VERSION=stable
wget http://ftp.fau.de/pub/likwid/likwid-$VERSION.tar.gz
tar -xaf likwid-$VERSION.tar.gz
cd likwid-*
vi config.mk # configure build, e.g. change installation prefix and architecture flags
make
sudo make install # sudo required to install the access daemon with proper permissions

In order to be able to measure the power consumption, you have to load the right modules:

sudo modprobe msr
echo msr | sudo tee -a /etc/modules # pour que ce soit ok au prochain reboot

Hwloc#

In order to visualize the topology of your computer (e.g., number of cores, memories), you may need to install the hwloc package. And then visualize the architecture with the command

sudo apt install hwloc
hwloc-ls & # give it a try 

Pour tester#

Config#

cd  # retour sur le home directory
mkdir .likwid
cd .likwid
# To be adapted to the installation directory
# ln -s /opt/likwid/usr/local/share/likwid/perfgroups groups #
ln -s /usr/local/share/likwid/perfgroups groups
likwid-perfctr -g ENERGY "sleep 1"

should provide the following lines

--------------------------------------------------------------------------------
CPU name:	Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz
CPU type:	Intel Kabylake processor
CPU clock:	2.11 GHz
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
Group 1: ENERGY
+-----------------------+---------+------------+------------+------------+------------+------------+------------+------------+------------+
|         Event         | Counter | HWThread 0 | HWThread 1 | HWThread 2 | HWThread 3 | HWThread 4 | HWThread 5 | HWThread 6 | HWThread 7 |
+-----------------------+---------+------------+------------+------------+------------+------------+------------+------------+------------+
|   INSTR_RETIRED_ANY   |  FIXC0  |    2546586 |   20419222 |    1210823 |     661754 |  171606228 |    2161303 |    8520597 |    6634164 |
| CPU_CLK_UNHALTED_CORE |  FIXC1  |    6245282 |   34527416 |    5974344 |    2874705 |  131496959 |    7265149 |   14828422 |   13564890 |
|  CPU_CLK_UNHALTED_REF |  FIXC2  |   14937560 |   84493112 |   13432848 |    7606280 |  166314984 |   16731528 |   35405832 |   32878120 |
|       TEMP_CORE       |   TMP0  |         43 |         40 |         42 |         41 |         43 |         40 |         42 |         40 |
|     PWR_PKG_ENERGY    |   PWR0  |     2.6274 |          0 |          0 |          0 |          0 |          0 |          0 |          0 |
|     PWR_PP0_ENERGY    |   PWR1  |     0.6815 |          0 |          0 |          0 |          0 |          0 |          0 |          0 |
|     PWR_PP1_ENERGY    |   PWR2  |     0.3515 |          0 |          0 |          0 |          0 |          0 |          0 |          0 |
|    PWR_DRAM_ENERGY    |   PWR3  |     0.6724 |          0 |          0 |          0 |          0 |          0 |          0 |          0 |
+-----------------------+---------+------------+------------+------------+------------+------------+------------+------------+------------+

+----------------------------+---------+-----------+---------+-----------+--------------+
|            Event           | Counter |    Sum    |   Min   |    Max    |      Avg     |
+----------------------------+---------+-----------+---------+-----------+--------------+
|   INSTR_RETIRED_ANY STAT   |  FIXC0  | 213760677 |  661754 | 171606228 | 2.672008e+07 |
| CPU_CLK_UNHALTED_CORE STAT |  FIXC1  | 216777167 | 2874705 | 131496959 | 2.709715e+07 |
|  CPU_CLK_UNHALTED_REF STAT |  FIXC2  | 371800264 | 7606280 | 166314984 |     46475033 |
|       TEMP_CORE STAT       |   TMP0  |       331 |      40 |        43 |      41.3750 |
|     PWR_PKG_ENERGY STAT    |   PWR0  |    2.6274 |       0 |    2.6274 |       0.3284 |
|     PWR_PP0_ENERGY STAT    |   PWR1  |    0.6815 |       0 |    0.6815 |       0.0852 |
|     PWR_PP1_ENERGY STAT    |   PWR2  |    0.3515 |       0 |    0.3515 |       0.0439 |
|    PWR_DRAM_ENERGY STAT    |   PWR3  |    0.6724 |       0 |    0.6724 |       0.0840 |
+----------------------------+---------+-----------+---------+-----------+--------------+

+----------------------+------------+------------+------------+------------+------------+------------+------------+------------+
|        Metric        | HWThread 0 | HWThread 1 | HWThread 2 | HWThread 3 | HWThread 4 | HWThread 5 | HWThread 6 | HWThread 7 |
+----------------------+------------+------------+------------+------------+------------+------------+------------+------------+
|  Runtime (RDTSC) [s] |     0.9983 |     0.9983 |     0.9983 |     0.9983 |     0.9983 |     0.9983 |     0.9983 |     0.9983 |
| Runtime unhalted [s] |     0.0030 |     0.0163 |     0.0028 |     0.0014 |     0.0623 |     0.0034 |     0.0070 |     0.0064 |
|      Clock [MHz]     |   882.9878 |   863.0284 |   939.3003 |   798.1845 |  1669.8085 |   917.0463 |   884.5094 |   871.3480 |
|          CPI         |     2.4524 |     1.6909 |     4.9341 |     4.3441 |     0.7663 |     3.3615 |     1.7403 |     2.0447 |
|    Temperature [C]   |         43 |         40 |         42 |         41 |         43 |         40 |         42 |         40 |
|      Energy [J]      |     2.6274 |          0 |          0 |          0 |          0 |          0 |          0 |          0 |
|       Power [W]      |     2.6318 |          0 |          0 |          0 |          0 |          0 |          0 |          0 |
|    Energy PP0 [J]    |     0.6815 |          0 |          0 |          0 |          0 |          0 |          0 |          0 |
|     Power PP0 [W]    |     0.6826 |          0 |          0 |          0 |          0 |          0 |          0 |          0 |
|    Energy PP1 [J]    |     0.3515 |          0 |          0 |          0 |          0 |          0 |          0 |          0 |
|     Power PP1 [W]    |     0.3521 |          0 |          0 |          0 |          0 |          0 |          0 |          0 |
|    Energy DRAM [J]   |     0.6724 |          0 |          0 |          0 |          0 |          0 |          0 |          0 |
|    Power DRAM [W]    |     0.6735 |          0 |          0 |          0 |          0 |          0 |          0 |          0 |
+----------------------+------------+------------+------------+------------+------------+------------+------------+------------+

+---------------------------+-----------+----------+-----------+----------+
|           Metric          |    Sum    |    Min   |    Max    |    Avg   |
+---------------------------+-----------+----------+-----------+----------+
|  Runtime (RDTSC) [s] STAT |    7.9864 |   0.9983 |    0.9983 |   0.9983 |
| Runtime unhalted [s] STAT |    0.1026 |   0.0014 |    0.0623 |   0.0128 |
|      Clock [MHz] STAT     | 7826.2132 | 798.1845 | 1669.8085 | 978.2766 |
|          CPI STAT         |   21.3343 |   0.7663 |    4.9341 |   2.6668 |
|    Temperature [C] STAT   |       331 |       40 |        43 |  41.3750 |
|      Energy [J] STAT      |    2.6274 |        0 |    2.6274 |   0.3284 |
|       Power [W] STAT      |    2.6318 |        0 |    2.6318 |   0.3290 |
|    Energy PP0 [J] STAT    |    0.6815 |        0 |    0.6815 |   0.0852 |
|     Power PP0 [W] STAT    |    0.6826 |        0 |    0.6826 |   0.0853 |
|    Energy PP1 [J] STAT    |    0.3515 |        0 |    0.3515 |   0.0439 |
|     Power PP1 [W] STAT    |    0.3521 |        0 |    0.3521 |   0.0440 |
|    Energy DRAM [J] STAT   |    0.6724 |        0 |    0.6724 |   0.0840 |
|    Power DRAM [W] STAT    |    0.6735 |        0 |    0.6735 |   0.0842 |
+---------------------------+-----------+----------+-----------+----------+