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

cpupower needs modprobe #9611

Closed
basvandijk opened this issue Sep 2, 2015 · 7 comments · Fixed by #21423
Closed

cpupower needs modprobe #9611

basvandijk opened this issue Sep 2, 2015 · 7 comments · Fixed by #21423
Labels
0.kind: bug Something is broken 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 9.needs: module (update) This needs a module to be changed

Comments

@basvandijk
Copy link
Member

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
Copy link
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.)

@vcunat vcunat added 0.kind: bug Something is broken 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS labels Sep 9, 2015
@joachifm
Copy link
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
Copy link
Member Author

@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
Copy link
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
Copy link
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
Copy link
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.

@basvandijk
Copy link
Member Author

@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
Labels
0.kind: bug Something is broken 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 9.needs: module (update) This needs a module to be changed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants