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.

I would like to run the following command after every boot (or login).

echo OFF > /sys/kernel/debug/vgaswitcheroo/switch

It turns off my discrete GPU. To what script should I add this command. I would appreciate any help.

share|improve this question
    
Looks about the same as the first related question: askubuntu.com/q/814/24102 –  TLP Oct 16 '11 at 17:15

2 Answers 2

Instead of running a script you could install the package sysfsutils and add the line

kernel/debug/vgaswitcheroo/switch=OFF

to the file /etc/sysfs.conf

share|improve this answer
    
that did it. thanks all :) –  Garips Oct 16 '11 at 17:40

You need root privileges to run that command, so you can add it to /etc/rc.local (but before the exit 0 line) to have it run at the end of the boot process.

Otherwise you can add it to /etc/gdm/PostLogin/Default to have it run after any graphical login (when using GNOME GDM, default for Ubuntu before 11.10). If the file does not exist, just rename /etc/gdm/PostLogin/Default.sample and edit it.

share|improve this answer
    
i did that, but it doesn't work. I also tried to put "sleep 10" before the command, because i read somewhere it could be executed too early. do I just need to add the above mentioned line or is there more to it? –  Garips Oct 16 '11 at 17:17
    
@Garips you might want to check en.gentoo-wiki.com/wiki/Vga_switcheroo and confirm that you have the necessary options enabled in the kernel and that the /sys/kernel/debug filesystem is mounted... –  Riccardo Murri Oct 16 '11 at 17:23
    
does the /etc/gdm/PostLogin/Default work with 11.10 ? –  Garips Oct 16 '11 at 17:24
    
@Garips Likely not, as 11.10 is using LightDM, not GDM –  Riccardo Murri Oct 16 '11 at 17:26
    
i think the options should be enabled, otherwise the command would't work at all. but it does work when I run it manually in the terminal. –  Garips Oct 16 '11 at 17:27

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.