Linux Battery Optimization. Switchable Graphics for Intel HD (integrated) + Radeon/Nvidia (discrete)


E-mail Facebook VKontakte Google Digg del.icio.us BlinkList NewsVine Reddit YahooMyWeb LiveJournal Blogmarks TwitThis Live News2.ru BobrDobr.ru Memori.ru MoeMesto.ru

[ Replies ] [ Leave reply ] [ Proxy list bulletin board ] [ New Message ]

Posted by Intel HD/Radeon/NVidia 178.120.41.118 December 25, 2011 at 13:42:27:



Let us assume your laptop contains inbuilt Intel HD & Radeon/Nvidia discrete graphics adapters with 2.6.35+ Linux kernel with vgaswitcheroo support enabled. The Intel HD graphics adapter is optimized for low power consumption which Radeon/Nvidia consumes high power.

To use Linux kernel's "Laptop Hybrid Graphics - GPU switching support" add following to /etc/fstab

none/sys/kernel/debug debugfs defaults 0 0

then reboot,

or execute as root:

#mount -t debugfs debugfs /sys/kernel/debug

This will enable /sys/kernel/debug/vgaswitcheroo/switch

# cat /sys/kernel/debug/vgaswitcheroo/switch

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

IGD - denotes integrated Intel graphics. DIS - denotes discrete Radeon/Nvidia discrete graphics.
"IGD:+:" means that the Integrate Graphics Device is the current controller.

Sending the OFF command turns off the non-controlling device, so If I do

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

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

which powers off the Discrete Radeon/Nvidia controller. But the OFF command powers off whichever device is not controlling.

So it's probably best to select the integrated graphics and then power off the 'other' like

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

and that needs to be executed before the X-session starts (or else restart an Xsession w/ ctrl+alt+bksp).

FWIW the curent driver commands thru the debugfs 'switch' pseudo file are:
OFF - power of the unused vid
ON - power on the nuused vid.
DIGD - delayed switch to intergrated graphcs (on the next xsession start)
DDIS - delayed switch to discrete Nvidia on next Xsession
IDG - immediate switch to integrated vid
DIS - immediate switch to discrete vid
MIGD - mux switch to integrated vid
MDIS - mux switch to discrete vid

The Mux switch options are new - and I haven't played with them. - mux switch to integrated vid
MDIS - mux switch to discrete vid

To switch-off Radeon/NVidia, do following -

# echo "DIGD" > /sys/kernel/debug/vgaswitcheroo/switch
# 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 switch-on both graphics chips, do following -

# echo "DIGD" > /sys/kernel/debug/vgaswitcheroo/switch
# echo "DDIS" > /sys/kernel/debug/vgaswitcheroo/switch

Init script for switching off the Radeon/NVidia card -

# cat /etc/rc.d/discrete_off

#!/bin/bash

. /etc/rc.conf
. /etc/rc.d/functions

case "$1" in

start)
echo "DIGD" > /sys/kernel/debug/vgaswitcheroo/switch
echo "OFF" > /sys/kernel/debug/vgaswitcheroo/switch
;;

stop)
echo "DIGD" > /sys/kernel/debug/vgaswitcheroo/switch
echo "DDIS" > /sys/kernel/debug/vgaswitcheroo/switch
;;

restart)
stat_busy "Restarting discrete_off ..."
$0 stop
$0 start
stat_done
;;

*)
echo "usage: $0 {start|stop|restart}"
esac


# chmod +x /etc/rc.d/discrete_off

Switch the Radeon/NVidia off while booting. Add following at the end of the file : /etc/rc.sysinit

#Switch-off discrete graphics
/etc/rc.d/discrete_off restart

Tags: Radeon, Nvidia, graphics card, INTEL HD, integrated, linux, integrated, discrete, linux, kernel, VGAswitcheroo, fstab, mount, debug, notebook, laptop



Replies:

Leave reply:

Name:

E-Mail:

Subject: Re: Linux Battery Optimization. Switchable Graphics for Intel HD (integrated) + Radeon/Nvidia (discrete)

Message:

Optional link, URL:

Link description:

Optional picture URL:


[ Replies ] [ Leave reply ] [ Proxy list bulletin board ] [ New Message ]