Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.
echo OFF | sudo tee /sys/kernel/debug/vgaswitcheroo/switch

In one of the questions in this forum, someone had posted this command to switch off graphics card to save power consumption and this worked like a charm almost reducing my battery consumption to less than half of what it consumed before.

The contents of sys/kernel/debug/vgawitcheroo/switch file are

0:IGD:+:Pwr:0000:00:02.0
1:DIS: :Off:0000:01:00.0

I want to know what this command actually does, the significance of vgaswitcheroo/switch file and what is the piping that is happening in the command. Can someone please explain this to me?

share|improve this question
add comment

1 Answer 1

up vote 4 down vote accepted

The command echo OFF | sudo tee /sys/kernel/debug/vgaswitcheroo/switch writes OFF to the special "file" /sys/kernel/debug/vgaswitcheroo/switch. For details on the difference with echo OFF > /sys/kernel/debug/vgaswitcheroo/switch, see sudo & redirect output

Entries in /sys are special. Those are not real files but an exported interface from the kernel space. In this case, vgaswitcheroo is an interface to the switcheroo code that can be used for toggling the power on hybrid graphics systems. More details on this can be found in the Ubuntu help pages: https://help.ubuntu.com/community/HybridGraphics#Using_vga_switcheroo.

If you are interested, the source code where this interface is exported is at http://lxr.linux.no/#linux+v3.3.4/drivers/gpu/vga/vga_switcheroo.c

share|improve this answer
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.