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

Unable to use pyJoules on Windows Subsystem for Linux? #15

Open
kshivvy opened this issue Feb 24, 2021 · 1 comment
Open

Unable to use pyJoules on Windows Subsystem for Linux? #15

kshivvy opened this issue Feb 24, 2021 · 1 comment

Comments

@kshivvy
Copy link

kshivvy commented Feb 24, 2021

@altor @rouvoy @chakib-belgaid @danglotb

I have the following code snippet running on Ubuntu 20.04 on Windows Subsystem for Linux (WSL).

from pyJoules.energy_meter import measure_energy

@measure_energy
def foo():
    print("HERE")

foo()

I get the following stack trace error:

WARNING:root:pynvml not found you can't use NVIDIA devices
HERE
Traceback (most recent call last):
  File "test.py", line 7, in <module>
    foo()
  File "/home/kshivvy/venv/lib/python3.8/site-packages/pyJoules/energy_meter.py", line 298, in wrapper_measure
    handler.process(energy_meter.get_trace())
  File "/home/kshivvy/venv/lib/python3.8/site-packages/pyJoules/energy_meter.py", line 160, in get_trace
    return self._generate_trace()
  File "/home/kshivvy/venv/lib/python3.8/site-packages/pyJoules/energy_meter.py", line 169, in _generate_trace
    domains = self._get_domain_list()
  File "/home/kshivvy/venv/lib/python3.8/site-packages/pyJoules/energy_meter.py", line 166, in _get_domain_list
    return reduce(operator.add, [device.get_configured_domains() for device in self.devices])
TypeError: reduce() of empty sequence with no initial value

Doe pyJoules support WSL? Would I need to do a full Linux partition on my laptop or buy a machine with Linux preinstalled? Or is there an alternative way to profile energy used by specific lines of code?

Thanks,
Keshav

@danglotb
Copy link
Contributor

Hello @kshivvy,

I'm afraid that pyJoules does not support WSL. IHMO, it is because WSL does not provide the sysfs, which is the pseudo filesystem that allows pyJoules to measure the energy consumption, i.e. read RAPL. However, I'm not an expert, and contributors might confirm.

I think that it would be better, or easier would be more accurate, to have a complete Linux running directly on the machine.

Best,
Benjamin.

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