GithubHelp home page GithubHelp logo

iteration about pyrapl HOT 2 OPEN

powerapi-ng avatar powerapi-ng commented on July 20, 2024 1
iteration

from pyrapl.

Comments (2)

kshivvy avatar kshivvy commented on July 20, 2024

@altor @chakib-belgaid @rouvoy

I also have the same question as @fnoorbin, I'm trying to profile energy consumption on Windows but when I end up with the following stack trace:

  File "C:\Users\kesha\Documents\NCSA\nengo.LIF_0.001_v4_nengo_synpase0.1_mp\reservoir.py", line 111, in initialize_reservoir
    pyRAPL.setup()
  File "C:\Users\kesha\Documents\NCSA\loihi\venv\lib\site-packages\pyRAPL\pyRAPL.py", line 39, in setup
    pyRAPL._sensor = Sensor(devices=devices, socket_ids=socket_ids)
  File "C:\Users\kesha\Documents\NCSA\loihi\venv\lib\site-packages\pyRAPL\sensor.py", line 59, in __init__
    self._device_api[device] = DeviceAPIFactory.create_device_api(device, socket_ids)
  File "C:\Users\kesha\Documents\NCSA\loihi\venv\lib\site-packages\pyRAPL\device_api.py", line 186, in create_device_api
    return PkgAPI(socket_ids)
  File "C:\Users\kesha\Documents\NCSA\loihi\venv\lib\site-packages\pyRAPL\device_api.py", line 137, in __init__
    DeviceAPI.__init__(self, socket_ids)
  File "C:\Users\kesha\Documents\NCSA\loihi\venv\lib\site-packages\pyRAPL\device_api.py", line 68, in __init__
    all_socket_id = get_socket_ids()
  File "C:\Users\kesha\Documents\NCSA\loihi\venv\lib\site-packages\pyRAPL\device_api.py", line 49, in get_socket_ids
    for cpu_id in cpu_ids():
  File "C:\Users\kesha\Documents\NCSA\loihi\venv\lib\site-packages\pyRAPL\device_api.py", line 31, in cpu_ids
    api_file = open('/sys/devices/system/cpu/present', 'r')
FileNotFoundError: [Errno 2] No such file or directory: '/sys/devices/system/cpu/present'

When I run the same code on a Linux system, I end up with the following stack trace:

Traceback (most recent call last):
  File "/jet/home/kshivvy/spiking_reservoir_rl_elastica/reservoir.py", line 111, in initialize_reservoir
    pyRAPL.setup()
  File "/jet/home/kshivvy/.conda/envs/venv/lib/python3.8/site-packages/pyRAPL/pyRAPL.py", line 39, in setup
    pyRAPL._sensor = Sensor(devices=devices, socket_ids=socket_ids)
  File "/jet/home/kshivvy/.conda/envs/venv/lib/python3.8/site-packages/pyRAPL/sensor.py", line 68, in __init__
    raise PyRAPLCantRecordEnergyConsumption(None)
pyRAPL.exception.PyRAPLCantRecordEnergyConsumption

Does your package support Windows, and if not do you know how I can profile how much energy certain lines of my Python code use?

from pyrapl.

fnoorbin avatar fnoorbin commented on July 20, 2024

@altor @chakib-belgaid @rouvoy

I also have the same question as @fnoorbin, I'm trying to profile energy consumption on Windows but when I end up with the following stack trace:

  File "C:\Users\kesha\Documents\NCSA\nengo.LIF_0.001_v4_nengo_synpase0.1_mp\reservoir.py", line 111, in initialize_reservoir
    pyRAPL.setup()
  File "C:\Users\kesha\Documents\NCSA\loihi\venv\lib\site-packages\pyRAPL\pyRAPL.py", line 39, in setup
    pyRAPL._sensor = Sensor(devices=devices, socket_ids=socket_ids)
  File "C:\Users\kesha\Documents\NCSA\loihi\venv\lib\site-packages\pyRAPL\sensor.py", line 59, in __init__
    self._device_api[device] = DeviceAPIFactory.create_device_api(device, socket_ids)
  File "C:\Users\kesha\Documents\NCSA\loihi\venv\lib\site-packages\pyRAPL\device_api.py", line 186, in create_device_api
    return PkgAPI(socket_ids)
  File "C:\Users\kesha\Documents\NCSA\loihi\venv\lib\site-packages\pyRAPL\device_api.py", line 137, in __init__
    DeviceAPI.__init__(self, socket_ids)
  File "C:\Users\kesha\Documents\NCSA\loihi\venv\lib\site-packages\pyRAPL\device_api.py", line 68, in __init__
    all_socket_id = get_socket_ids()
  File "C:\Users\kesha\Documents\NCSA\loihi\venv\lib\site-packages\pyRAPL\device_api.py", line 49, in get_socket_ids
    for cpu_id in cpu_ids():
  File "C:\Users\kesha\Documents\NCSA\loihi\venv\lib\site-packages\pyRAPL\device_api.py", line 31, in cpu_ids
    api_file = open('/sys/devices/system/cpu/present', 'r')
FileNotFoundError: [Errno 2] No such file or directory: '/sys/devices/system/cpu/present'

When I run the same code on a Linux system, I end up with the following stack trace:

Traceback (most recent call last):
  File "/jet/home/kshivvy/spiking_reservoir_rl_elastica/reservoir.py", line 111, in initialize_reservoir
    pyRAPL.setup()
  File "/jet/home/kshivvy/.conda/envs/venv/lib/python3.8/site-packages/pyRAPL/pyRAPL.py", line 39, in setup
    pyRAPL._sensor = Sensor(devices=devices, socket_ids=socket_ids)
  File "/jet/home/kshivvy/.conda/envs/venv/lib/python3.8/site-packages/pyRAPL/sensor.py", line 68, in __init__
    raise PyRAPLCantRecordEnergyConsumption(None)
pyRAPL.exception.PyRAPLCantRecordEnergyConsumption

Does your package support Windows, and if not do you know how I can profile how much energy certain lines of my Python code use?

@kshivvy
This package could be used only with Linux and not Windows.
But I am no more able to use it with Linux, I think some permissions have changed by the Linux updates and then it was not accessible.

from pyrapl.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.