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

Run PowerJoular on Intel/AMD Linux without root/sudo #1

Open
2 tasks
adelnoureddine opened this issue Jan 13, 2023 · 0 comments
Open
2 tasks

Run PowerJoular on Intel/AMD Linux without root/sudo #1

adelnoureddine opened this issue Jan 13, 2023 · 0 comments
Assignees
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Milestone

Comments

@adelnoureddine
Copy link
Member

adelnoureddine commented Jan 13, 2023

Access to RAPL data is restricted in Linux kernel to only privileged users (sudo/root), in order to avoid the PLATYPUS vulnerability.

To avoid running PowerJoular with sudo or root, a proposed approach is to set RAPL files to read for all users. Read status is reset on reboot, so the proposition is to add this right to /etc/sysfs.conf : mode class/powercap/intel-rapl:0/energy_uj = 0444.

In PowerJoular, we read 2 files for each RAPL domain: name and energy_uj. Both files need to have read rights.

Mainly theses files (if they exist):

/sys/class/powercap/intel-rapl/intel-rapl:1/energy_uj
/sys/class/powercap/intel-rapl/intel-rapl:0/energy_uj
/sys/class/powercap/intel-rapl/intel-rapl:0/intel-rapl:0:2/energy_uj
/sys/class/powercap/intel-rapl/intel-rapl:1/name
/sys/class/powercap/intel-rapl/intel-rapl:0/name
/sys/class/powercap/intel-rapl/intel-rapl:0/intel-rapl:0:2/name

If you only use the PowerJoular systemd service, which needs to be enabled and run as root/sudo as all systemd services, then you can keep your system unchanged as the service will run with privileged rights and writes data to /tmp folder as we explained in the project's page.

  • Add workaround for sysfs.conf in documentation page & readme
  • Add a script or simpler documentation to change permissions for RAPL file on boot for sysf.conf.
@adelnoureddine adelnoureddine added the enhancement New feature or request label Jan 13, 2023
@adelnoureddine adelnoureddine self-assigned this Jan 13, 2023
@adelnoureddine adelnoureddine added the documentation Improvements or additions to documentation label Feb 15, 2023
@adelnoureddine adelnoureddine added this to the 1.0 milestone Oct 20, 2023
@adelnoureddine adelnoureddine removed this from the 1.0 milestone Jun 3, 2024
@adelnoureddine adelnoureddine added enhancement New feature or request and removed enhancement New feature or request labels Nov 22, 2024
@adelnoureddine adelnoureddine added this to the 1.1 milestone Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant