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

Issue monitoring i7 CPU #40

Closed
raghavian opened this issue Mar 13, 2021 · 5 comments
Closed

Issue monitoring i7 CPU #40

raghavian opened this issue Mar 13, 2021 · 5 comments

Comments

@raghavian
Copy link
Collaborator

Trying to use carbontracker on a new workstation on Ubuntu 20.04 (Intel i7-10700F CPU) and throws the following error:

with open(os.path.join(path, "energy_uj"), 'r') as f:
PermissionError: [Errno 13] Permission denied: '/sys/class/powercap/intel-rapl:0/energy_uj'

Most likely due to RAPL. Works when components="gpu" only.

@raghavian
Copy link
Collaborator Author

Looks like this is a Linux kernel update issue. To use carbontracker without this error, give read permission to the specific file:

sudo chmod 444 /sys/class/powercap/intel-rapl:0/energy_uj

If you do not have root access, ignore CPU monitoring when instantiating carbontracker:

tracker = CarbonTracker(epochs=args.num_epochs,components="gpu",
            log_dir='carbontracker/',monitor_epochs=-1)

@hrdl-github
Copy link

To make this change persistent, consider adding a udev rule, e.g.

# /etc/udev/rules.d/powercap.rules
ACTION=="add|change", SUBSYSTEM=="powercap", KERNEL=="intel-rapl:*", RUN+="/bin/chmod og+r %S%p/energy_uj"

@hrdl-github
Copy link

To immediately apply the permission changes:

sudo udevadm control --reload && sudo udevadm trigger --subsystem-match=powercap

@raghavian
Copy link
Collaborator Author

This will be an issue for users when they don't have root privileges. Will reopen the issue until we figure out a different solution.

@raghavian raghavian reopened this Dec 1, 2022
@PedramBakh
Copy link
Collaborator

PedramBakh commented Dec 6, 2022

Release 1.1.7 addresses this issue by informing the user of missing privileges and refering to this issue thread.

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

3 participants