Turning off discrete videocard systemd service
I want to turn off discrete video card on system startup. I could do it as a root with next command:
$ echo OFF > /sys/kernel/debug/vgaswitcheroo/switch
$ cat /sys/kernel/debug/vgaswitcheroo/switch
0:IGD:+:Pwr:0000:00:02.0
1:DIS: :Off:0000:01:00.0
To automate it process I've decided to create startup service:
$ cd /etc/systemd/system/
$ touch discrete-video-off.service
$ cat > discrete-video-off.service
[Unit]
Description=Turns off discrete video card
[Service]
Type=oneshot
RemainAfterExit=true
ExecStart=/usr/bin/echo OFF > /sys/kernel/debug/vgaswitcheroo/switch
ExecStop=/usr/bin/echo ON > /sys/kernel/debug/vgaswitcheroo/switch
[Install]
WantedBy=multi-user.target
^C
$ systemctl enable discrete-video-off.service
After reboot - service has been executed succesfully but discrete video card still gets power.
$ sudo systemctl status discrete-video-off.service
discrete-video-off.service - Turns off discrete video card
Loaded: loaded (/etc/systemd/system/discrete-video-off.service; enabled)
Active: active (exited) since Wed 2013-08-14 11:10:09 EEST; 4min 34s ago
Process: 420 ExecStart=/usr/bin/echo OFF > /sys/kernel/debug/vgaswitcheroo/switch (code=exited, status=0/SUCCESS)
$ sudo cat /sys/kernel/debug/vgaswitcheroo/switch
0:IGD:+:Pwr:0000:00:02.0
1:DIS: :Pwr:0000:01:00.0
Is this all even neede if I switched the discrete graphics in the BIOS? Please answer here if you know https://ask.fedoraproject.org/question/28239/how-to-make-sure-the-discrete-grahics-is-disabled/
I suppose, if you turned off your discrete graphic card in the BIOS, you shouldn't bother about "my solution" (service that uses vgaswitcheroo/switch). Just wonder what
cat /sys/kernel/debug/vgaswitcheroo/switch
returns in your case? PS my BIOS doesn't provide "turning videocards off" option@polarfish I'd rather not fiddle with switcheroo (I don't have it installed).