For people with dual graphics cards the support switcheroo function in this latest kernel will double (or more) your battery life. The problem before was that linux would initiate both cards during boot and for me this meant almost overheating and a battery life of less than 1 hour.
This is your integrated card:
Code: Select all
lspci | grep VGA | sed -n '1p' | cut -f 1 -d " "
This is your discreet card:
Code: Select all
lspci | grep VGA | sed -n '2p' | cut -f 1 -d " "
This is the card states:
Code: Select all
pci_integrated=$(lspci | grep VGA | sed -n '1p' | cut -f 1 -d " ")
pci_discrete=$(lspci | grep VGA | sed -n '2p' | cut -f 1 -d " ")
integrated=$(cat /sys/kernel/debug/vgaswitcheroo/switch | grep $pci_integrated | grep -o -P ':.:...:')
discrete=$(cat /sys/kernel/debug/vgaswitcheroo/switch | grep $pci_discrete | grep -o -P ':.:...:')
name_integrated=$(lspci | grep VGA | sed -n '1p' | sed -e "s/.* VGA compatible controller[ :]*//g" | sed -e "s/ Corporation//g" | sed -e "s/ Technologies Inc//g" | sed -e 's/\[[0-9]*\]: //g' | sed -e 's/\[[0-9:a-z]*\]//g' | sed -e 's/(rev [a-z0-9]*)//g' | sed -e "s/ Integrated Graphics Controller//g")
name_discrete=$(lspci | grep VGA | sed -n '2p' | sed -e "s/.* VGA compatible controller[ :]*//g" | sed -e "s/ Corporation//g" | sed -e "s/ Technologies Inc//g" | sed -e 's/\[[0-9]*\]: //g' | sed -e 's/\[[0-9:a-z]*\]//g' | sed -e 's/(rev [a-z0-9]*)//g' | sed -e "s/ Integrated Graphics Controller//g")
[ "$integrated" = ":+:Pwr:" ] && integrated_condition="Switched on and in use"
[ "$integrated" = ": :Pwr:" ] && integrated_condition="On but not being used"
[ "$integrated" = ": :Off:" ] && integrated_condition="Switched off"
[ "$discrete" = ":+:Pwr:" ] && discrete_condition="Switched on and in use"
[ "$discrete" = ": :Pwr:" ] && discrete_condition="On but not being used"
[ "$discrete" = ": :Off:" ] && discrete_condition="Switched off"
echo "##############################"
echo "Integrated card: $name_integrated"
echo "$integrated_condition"
echo "-------------------------------"
echo "Discreet card: $name_discrete"
echo "$discrete_condition"
echo ""
You can switch graphics cards by passing info to: /sys/kernel/debug/vgaswitcheroo/switch
If you have no file there (and you are certain your system supports switcheroo) then mount the debug fs.
Code: Select all
mount -t debugfs none /sys/kernel/debug
I will get around to writing a GUI for switching cards soon. For now you can read more about switching using CLI.
Code: Select all
echo ON > /sys/kernel/debug/vgaswitcheroo/switch
Turns on the GPU that is disconnected (not currently driving outputs), but does not switch outputs.
Code: Select all
echo IGD > /sys/kernel/debug/vgaswitcheroo/switch
Connects integrated graphics with outputs.
Code: Select all
echo DIS > /sys/kernel/debug/vgaswitcheroo/switch
Connects discrete graphics with outputs.
Code: Select all
echo OFF > /sys/kernel/debug/vgaswitcheroo/switch
Turns off the graphics card that is currently disconnected. (woohoo, save power)
There are also a couple of options that are useful from inside an X-Windows session:
Code: Select all
echo DIGD > /sys/kernel/debug/vgaswitcheroo/switch
Queues a switch to integrated graphics to occur when the X server is next restarted.
Code: Select all
echo DDIS > /sys/kernel/debug/vgaswitcheroo/switch
Queues a switch to discrete graphics to occur when the X server is next restarted.