Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Is there any way to unload modules in Ubuntu (e.g., keyboard, USB, graphics etc) to save power? I don't want to use powertop for that, but I want to manually find these modules and unload them.

share|improve this question
add comment

2 Answers 2

You have two questions, joined at the middle... But each question has a different context.

Yes you can unload modules, possibly saving RAM. But doing so is rarely going to translate into lower power use, and sometimes power use could go up if the thing you unloaded were providing an efficiency boost. Unloading an optimized graphics module could have your system falling back on unaccellerated vides which uses more CPU power, for example.

There is also no guarantee that device without driver commanding it would be in any kind of idle mode. It's job of the driver to put the device into on/sleep/off modes depending on OS situation, and without the driver device might be in any of those three.

If you only connect to this system via ssh, then you can configure the server to not boot into X. Edit innittab in /etc, and set the default run level to 3, and your system will boot and load into the console prompt.

Best thing is use a utility to manage power for you, and set it to max power savings.

You are only going to be able to measure whole system power, either through the OS or at the outlet using a Kill-a-watt device. You may see the overall numbers change with experimentation to your configuration. I am not aware of a method to track power of just a hardware subsystem.

share|improve this answer
add comment

I don't know of any way to directly monitor power consumption from modules. As far as I know powertop looks for modules that are responsible for lots of wakeups. I don't know how to look for modules that are responsible for lots of wakeups. What I want to suggest is to look for loaded modules you don't need and simply unload them and then check whether that lower power consumption. The following describes how to do that.

Finding modules

Alternative 1

You can list loaded modules with lsmod and combine it with grep to find certain modules. Say, that you're looking for modules that has to do with video because you don't need them. Then you can do

lsmod | grep -i video

On my system this returns

video                  19438  1 i915

If I want to unload any modules that has to do with video I guess I'd unload the module video. But what about the module i915? We can learn about it by doing:

modinfo i915

It tells me that the module i915 is for Intel graphics so it makes sense to unload that module as well if I want to unload everything that has to do with video. Also it might make sense to do

modinfo i915 | grep depends

to see what modules i915 depends on. It might show other candidates for unloading.

Alternative 2

Another way to go is to go through all loaded modules and check whether you need them or not. First do

lsmod

Then you simply run modinfo for every module you want information about. If "module-name" is the name of the module you want to information about you do

modinfo module-name

Unloading modules

To unload a module either do

sudo rmmod module-name

or

sudo modprobe -r module-name
share|improve this answer
    
The question is, "how do I find a specific module?", e.g., I want to remove graphics module from a PC over ssh from another PC. –  umair Aug 10 '11 at 11:33
    
@umair I've edited my answer to answer that. You might want to clarify your question so that it's completely clear what you're asking for. You might also want to provide an example case. –  N.N. Aug 10 '11 at 12:11
    
Thanks for your suggestions. Actually I wanna know the power consumption of a PC. I could only measure the overall power consumed by the whole system (with a power meter). I have no way to calculate the power consumption of individual component (e.g., graphics card, processor, HDD etc). I connect to this PC via ssh over another PC. I just want to turn off all the modules (e.g., graphics) to see if they really affect the power consumption. I tried lsmod | grep -i video over ssh, but nothing shows up. –  umair Aug 10 '11 at 12:34
    
@umair You should edit your question and add that that is what you want to do (the users of this site are knowledgeable but not mind readers). Instead of doing lsmod | grep -i video you can just do lsmod and then do modinfo module-name for every module it returns and decide if that is a module you need. You can check power consumption before and after unloading modules to see if it has any effect. –  N.N. Aug 10 '11 at 12:37
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.