Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to add event 'RAPL_ENERGY_PKG' to group 'rapl' #96

Closed
SamuelPelissier opened this issue Nov 27, 2024 · 2 comments
Closed

Failed to add event 'RAPL_ENERGY_PKG' to group 'rapl' #96

SamuelPelissier opened this issue Nov 27, 2024 · 2 comments

Comments

@SamuelPelissier
Copy link

SamuelPelissier commented Nov 27, 2024

Hello,
I am currently trying to deploy SmartWatts and it seems the HWPC Sensor fails to add the RAPL_ENERGY_PKG event to the group rapl:

powerapi-sensor               | I: 24-11-27 15:55:46 build: version unknown (rev: unknown)
powerapi-sensor               | I: 24-11-27 15:55:46 uname: Linux 6.12.1-arch1-1 #1 SMP PREEMPT_DYNAMIC Fri, 22 Nov 2024 16:04:27 +0000 x86_64
powerapi-sensor               | I: 24-11-27 15:55:46 pmu: found ix86arch 'Intel X86 architectural PMU' having 7 events, 11 counters (8 general, 3 fixed)
powerapi-sensor               | I: 24-11-27 15:55:46 pmu: found perf 'perf_events generic PMU' having 82 events, 0 counters (0 general, 0 fixed)
powerapi-sensor               | I: 24-11-27 15:55:46 pmu: found perf_raw 'perf_events raw PMU' having 1 events, 0 counters (0 general, 0 fixed)
powerapi-sensor               | I: 24-11-27 15:55:46 pmu: found intel_msr 'Intel MSR' having 6 events, 6 counters (0 general, 6 fixed)
powerapi-sensor               | E: 24-11-27 15:55:46 config: json: Failed to add event 'RAPL_ENERGY_PKG' to group 'rapl'
powerapi-sensor               | E: 24-11-27 15:55:46 config: json: Failed to process the given configuration file
powerapi-sensor               | E: 24-11-27 15:55:46 config: failed to parse the provided command-line arguments

I am running the following docker-compose setup with mongo as input and influxDB 2 as output:

services:
  mongo:
    image: mongo
    container_name: powerapi-mongodb
    restart: always
    env_file:
      - .env_mongodb
    ports:
      - 27017:27017
    volumes:
      - ./data/mongodb-storage:/data/db

  influxdb:
    restart: always
    container_name: powerapi-influxdb
    image: influxdb:2
    ports:
      - 8086:8086
    network_mode: "host"
    env_file:
      - .env_influxdb
    volumes:
      - ./data/influxdb-storage:/var/lib/influxdb

  grafana:
    restart: always
    image: grafana/grafana
    container_name: powerapi-grafana
    depends_on:
      - influxdb
    ports:
      - 3000:3000
    network_mode: "host"
    env_file:
      - .env_grafana
    user: "$UID:$GID"
    volumes:
      - ./data/grafana-storage:/var/lib/grafana

  powerapi-hwpc-sensor:
    image: powerapi/hwpc-sensor
    container_name: powerapi-sensor
    restart: always
    volumes:
      - /sys:/sys
      - /var/lib/docker/containers:/var/lib/docker/containers:ro
      - ./config_files/config_file_hwpc.json:/config_file_hwpc.json
    network_mode: "host"
    privileged: true
    command: ["-n", "powerapi/hwpc-sensor" ,"--config-file" ,"/config_file_hwpc.json"]

  powerapi-smartwatts:
    image: powerapi/smartwatts-formula
    container_name: powerapi-smarttwatts-formula
    restart: always
    network_mode: "host"
    volumes:
      - ./config_files/config_file_sw.json:/config_file_sw.json
    command: ["powerapi/smartwatts-formula" ,"--config-file", "/config_file_sw.json"]

With the following config files.

  • For the sensor (output.uri modified, rest is the default) :
{
  "name": "sensor",
  "verbose": true,
  "frequency": 500,
  "output": {
    "type": "mongodb",
    "uri": "mongodb://admin:[email protected]:27017",
    "database": "db_sensor",
    "collection": "hwpc_report"
  },
  "system": {
    "rapl": {
      "events": ["RAPL_ENERGY_PKG"],
      "monitoring_type": "MONITOR_ONE_CPU_PER_SOCKET"
    },
    "msr": {
      "events": ["TSC", "APERF", "MPERF"]
    }
  },
  "container": {
    "core": {
      "events": [
        "CPU_CLK_THREAD_UNHALTED:REF_P",
        "CPU_CLK_THREAD_UNHALTED:THREAD_P",
        "LLC_MISSES",
        "INSTRUCTIONS_RETIRED"
      ]
    }
  }
}
  • For Smartwatts :
{
  "verbose": false,
  "stream": true,
  "input": {
    "puller": {
      "model": "HWPCReport",
      "type": "mongodb",
      "uri": "mongodb://admin:[email protected]:27017",
      "db": "db_sensor",
      "collection": "hwpc_report"
    }
  },
  "output": {
    "pusher_power": {
      "type": "influxdb2",
      "uri": "127.0.0.1",
      "port": 8086,
      "db": "power_consumption",
      "org": "my-org",
      "token": "5up3r-S3cr3t-auth-t0k3n"
    }
  },
  "cpu-base-freq": 1900,
  "cpu-error-threshold": 2.0,
  "disable-dram-formula": true,
  "sensor-reports-frequency": 999
}

Other information:

sudo perf stat -a -e "power/energy-cores/" /bin/ls 
 Performance counter stats for 'system wide':

              0,02 Joules power/energy-cores/                                                  
       0,001212952 seconds time elapsed

Thanks in advance!

@gfieni
Copy link
Collaborator

gfieni commented Nov 28, 2024

Hello,
Thanks a lot for the complete report.
Unfortunately, the Meteor Lake CPUs are currently not supported by the library (libpfm4) we are using to setup the performance counters. Hence, you won't be able to deploy SmartWatts for this machine.

@SamuelPelissier
Copy link
Author

Hello,
Thank you for your quick answer, that explains a lot.
Have a nice day.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants