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

cpupower needs modprobe #9611

Closed
basvandijk opened this Issue Sep 2, 2015 · 7 comments

Comments

Projects
None yet
4 participants
@basvandijk
Member

basvandijk commented Sep 2, 2015

I noticed the following errors in my journal:

Sep 02 17:58:46 hera systemd[1]: Starting CPU Frequency Governor Setup...
Sep 02 17:58:46 hera cpupower[479]: sh: modprobe: command not found
Sep 02 17:58:46 hera cpupower[479]: Setting cpu: 0
Sep 02 17:58:46 hera cpupower[479]: Error setting new values. Common errors:
Sep 02 17:58:46 hera cpupower[479]: - Do you have proper administration rights? (super-user?)
Sep 02 17:58:46 hera cpupower[479]: - Is the governor you requested available and modprobed?
Sep 02 17:58:46 hera cpupower[479]: - Trying to set an invalid policy?
Sep 02 17:58:46 hera cpupower[479]: - Trying to set a specific frequency, but userspace governor is not available,
Sep 02 17:58:46 hera cpupower[479]: for example because of hardware which cannot be set to a specific frequency
Sep 02 17:58:46 hera cpupower[479]: or because the userspace governor isn't loaded?

This is probably fixed by adding the following to systemd.services.cpufreq in nixos/modules/tasks/cpu-freq.nix:

{ path = [ config.system.sbin.modprobe ]; }

(Note I'm on a recent checkout of nixos-15.09-small)

@vcunat

This comment has been minimized.

Show comment
Hide comment
@vcunat

vcunat Sep 9, 2015

Member

Have you tested this fixes the problem? (I'm not really proficient in services, but there seems noone interested.)

Member

vcunat commented Sep 9, 2015

Have you tested this fixes the problem? (I'm not really proficient in services, but there seems noone interested.)

@joachifm

This comment has been minimized.

Show comment
Hide comment
@joachifm

joachifm Sep 9, 2015

Contributor

The cpufreq service module adds the governor module to the list of kernel modules to be loaded at bootup, so it should have been loaded by systemd before the cpufreq service runs.

I believe the error is actually a symptom that the ondemand governor is unsupported. Even with modprobe in path, I get the above error when using the ondemand governor. Trying to enable the governor manually (writing directly to /sys) fails as well. The other governors work just fine.

Contributor

joachifm commented Sep 9, 2015

The cpufreq service module adds the governor module to the list of kernel modules to be loaded at bootup, so it should have been loaded by systemd before the cpufreq service runs.

I believe the error is actually a symptom that the ondemand governor is unsupported. Even with modprobe in path, I get the above error when using the ondemand governor. Trying to enable the governor manually (writing directly to /sys) fails as well. The other governors work just fine.

@basvandijk

This comment has been minimized.

Show comment
Hide comment
@basvandijk

basvandijk Sep 9, 2015

Member

@joachifm yes that seems to be the problem.

The powermanagement module is setting the cpuFreqGovernor to ondemand by default.

But that is not supported on my system:

$ cpupower frequency-info | grep available
  available cpufreq governors: performance, powersave

I guess the FIXME in the link I posted relates to this problem.

A workaround for my system would be to set powerManagement.cpuFreqGovernor to one of the available governors. However, it would be better if NixOS would choose powersave instead of ondemand when the system has a modern Intel chip.

Member

basvandijk commented Sep 9, 2015

@joachifm yes that seems to be the problem.

The powermanagement module is setting the cpuFreqGovernor to ondemand by default.

But that is not supported on my system:

$ cpupower frequency-info | grep available
  available cpufreq governors: performance, powersave

I guess the FIXME in the link I posted relates to this problem.

A workaround for my system would be to set powerManagement.cpuFreqGovernor to one of the available governors. However, it would be better if NixOS would choose powersave instead of ondemand when the system has a modern Intel chip.

@vcunat

This comment has been minimized.

Show comment
Hide comment
@vcunat

vcunat Sep 9, 2015

Member

Then I don't know if there is a good common default.

$ cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors 
ondemand performance
Member

vcunat commented Sep 9, 2015

Then I don't know if there is a good common default.

$ cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors 
ondemand performance
@joachifm

This comment has been minimized.

Show comment
Hide comment
@joachifm

joachifm Sep 9, 2015

Contributor

Sometimes no fix is the best fix. Maybe document the issue and leave it at that. Then again, cpupower is a fairly trivial sysfs wrapper so it shouldn't be too much work to replicate what it's doing with some additional logic for choosing an appropriate default based on what's available. Not sure if it's worth it, though, but I don't use the upstream powersave module anyways, partly due to this issue.

Contributor

joachifm commented Sep 9, 2015

Sometimes no fix is the best fix. Maybe document the issue and leave it at that. Then again, cpupower is a fairly trivial sysfs wrapper so it shouldn't be too much work to replicate what it's doing with some additional logic for choosing an appropriate default based on what's available. Not sure if it's worth it, though, but I don't use the upstream powersave module anyways, partly due to this issue.

@pikajude

This comment has been minimized.

Show comment
Hide comment
@pikajude

pikajude Jan 14, 2016

Contributor

@basvandijk, @vcunat: I've also encountered this and am wondering (as somebody who doesn't know anything about cpufreq) what the appropriate fix is.

Contributor

pikajude commented Jan 14, 2016

@basvandijk, @vcunat: I've also encountered this and am wondering (as somebody who doesn't know anything about cpufreq) what the appropriate fix is.

@basvandijk

This comment has been minimized.

Show comment
Hide comment
@basvandijk

basvandijk Jan 14, 2016

Member

@pikajude as I mentioned above you can just set powerManagement.cpuFreqGovernor to one of the available govenors like:

powerManagement.cpuFreqGovernor = "powersave";
Member

basvandijk commented Jan 14, 2016

@pikajude as I mentioned above you can just set powerManagement.cpuFreqGovernor to one of the available govenors like:

powerManagement.cpuFreqGovernor = "powersave";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment