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

[Linux] offline cpus raise NotImplementedError in cpu_freq #2254

Closed
ohsix opened this issue May 14, 2023 · 1 comment · Fixed by #2376
Closed

[Linux] offline cpus raise NotImplementedError in cpu_freq #2254

ohsix opened this issue May 14, 2023 · 1 comment · Fixed by #2376

Comments

@ohsix
Copy link

ohsix commented May 14, 2023

python3-psutil (5.9.2) on fedora 38

turn cpu1 off:
echo 0 > /sys/devices/system/cpu/cpu1/online

or every cpu but cpu0:
for i in $(seq 1 $(nproc --ignore=1)); do echo 0 > /sys/devices/system/cpu/cpu$i/online; done
cpu_freq needs one more case to skip offline cpus (or ones without the sysfs files for frequency, which means the same thing)

raise NotImplementedError(

@ohsix ohsix added the bug label May 14, 2023
@github-actions github-actions bot added the linux label May 14, 2023
@singingtelegram
Copy link

Experienced the same issue after turning some cores off.

  File "/usr/lib/python3/dist-packages/psutil/__init__.py", line 1864, in cpu_freq
    ret = _psplatform.cpu_freq()
          ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/psutil/_pslinux.py", line 742, in cpu_freq
    raise NotImplementedError(
NotImplementedError: can't find current frequency file

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

Successfully merging a pull request may close this issue.

2 participants