Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 86 lines (78 sloc) 2.68 KB
#!/bin/bash
rmmod -w nvidia &>/dev/null
# Trying bbswitch method
if [ -f /proc/acpi/bbswitch ]; then
echo 'OFF' > /proc/acpi/bbswitch \
&& a=`cat /proc/acpi/bbswitch` \
&& [ OFF == ${a##* } ] \
&& echo "nVidia chip powered off using bbswitch" \
&& exit 0
echo "Cann't power off nVidia chip using bbswitch"
exit -1
fi
# Trying acpi_call method
if [ -f /proc/acpi/call ]; then
model=`dmidecode -s system-product-name`
case "$model" in
M11XR2)
echo '\_SB.PCI0.P0P2.PEGP.NVOP 0 0x100 0x1A {255,255,255,255}' > /proc/acpi/call \
&& echo '\_SB.PCI0.P0P2.PEGP._PS3' > /proc/acpi/call
;;
1015PN)
echo '\OSGS 0x03' > /proc/acpi/call
;;
1215N)
echo '\_SB.PCI0.P0P4.GFX0._DSM {0xF8,0xD8,0x86,0xA4,0xDA,0x0B,0x1B,0x47,0xA7,0x2B,0x60,0x42,0xA6,0xB5,0xBE,0xE0} 0x100 0x1A {0x1,0x0,0x0,0x3}' > /proc/acpi/call \
&& echo '\_SB.PCI0.P0P4.GFX0._PS3' > /proc/acpi/call
;;
K42Jc|K52Jc|N53Jf|N53Jg|N71Jv|N73Jf|P52Jc|PL80Jt|U30Jc|U33Jc|U35Jc|U36Jc|UL80Jt)
echo '\_SB.PCI0.PEG1.GFX0.DOFF' > /proc/acpi/call
;;
N61Jv|N73Sv)
echo '\_SB.PCI0.PEGR.GFX0.DOFF' > /proc/acpi/call
;;
P31Jg)
echo '\_SB.PCI0.PEG1.GFX0._PS3' > /proc/acpi/call
;;
U43Jc)
echo '\_SB.PCI0.RP00.VGA._DSM {0xF8,0xD8,0x86,0xA4,0xDA,0x0B,0x1B,0x47,0xA7,0x2B,0x60,0x42,0xA6,0xB5,0xBE,0xE0} 0x100 0x1A {0x1,0x0,0x0,0x3}' > /proc/acpi/call \
&& echo '\_SB.PCI0.RP00.VGA._PS3' > /proc/acpi/call
;;
UL30Vt)
echo '\_SB.PCI0.P0P1.VGA._OFF' > /proc/acpi/call
;;
E6420)
echo '\_SB.PCI0.PEG0.VID._OFF' > /proc/acpi/call
;;
InspironN5110|XPSL702X)
echo '\_SB.PCI0.PEG0.PEGP._DSM {0xF8,0xD8,0x86,0xA4,0xDA,0x0B,0x1B,0x47,0xA7,0x2B,0x60,0x42,0xA6,0xB5,0xBE,0xE0} 0x100 0x1A {0x1,0x0,0x0,0x3}' > /proc/acpi/call \
&& echo '\_SB.PCI0.PEG0.PEGP._PS3' > /proc/acpi/call
;;
Vostro3300|Vostro3500)
echo '\_SB.PCI0.P0P1.PEGP._OFF' > /proc/acpi/call
;;
XPS15)
echo '\_SB.PCI0.PEG0.PEGP._OFF' > /proc/acpi/call
;;
ThinkPadT410)
echo '\_SB.PCI0.PEG.VID._PS3' > /proc/acpi/call \
&& echo '\_SB.PCI0.PEG.VID._OFF' > /proc/acpi/call
;;
ThinkPadT420|41786VU)
echo '\_SB.PCI0.PEG.VID._DSM {0xF8,0xD8,0x86,0xA4,0xDA,0x0B,0x1B,0x47,0xA7,0x2B,0x60,0x42,0xA6,0xB5,0xBE,0xE0} 0x100 0x1A {0x1,0x0,0x0,0x3}' > /proc/acpi/call \
&& echo '\_SB.PCI0.PEG.VID._PS3' > /proc/acpi/call
;;
*) echo "Snail: unknown Notebook model: $model"; exit -1
;;
esac
echo "acpi_call used to power OFF nVidia chip"
exit 0
fi
# Trying vgaswitcheroo method
if [ -f /sys/kernel/debug/vgaswitcheroo/switch ]; then
echo 'OFF' > /sys/kernel/debug/vgaswitcheroo/switch \
&& echo "nVidia chip powered off using vgaswitcheroo" \
&& exit 0
echo "Cann't power off nVidia chip using vgaswitcheroo"
exit -1
fi
You can’t perform that action at this time.