用bbswitch关闭nVIDIA OPTIMUS独显

笔记本/便携移动设备,手机平板等软硬件
回复
头像
bigsun
帖子: 301
注册时间: 2009-01-11 16:05

用bbswitch关闭nVIDIA OPTIMUS独显

#1

帖子 bigsun »

https://github.com/Bumblebee-Project/bbswitch
上下载https://github.com/downloads/Bumblebee- ... 4.1.tar.gz
解压,make
cp bbswitch.ko /home/xxx
vi /etc/rc.local

代码: 全选

#!/bin/bash -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

/sbin/insmod /home/xxx/bbswitch.ko
tee /proc/acpi/bbswitch <<<OFF
exit 0
注意将首行/bin/sh改成/bin/bash,
否则会/etc/rc.local: 16: Syntax error: redirection unexpected
原因是:
Does your script reference /bin/bash or /bin/sh in its hash bang line? The default system shell in Ubuntu is dash, not bash, so if you have #!/bin/sh then your script will be using a different shell than you expect. Dash does not have the <<< redirection operator.
头像
lovelyzlf
帖子: 946
注册时间: 2009-11-04 13:03
联系:

Re: 用bbswitch关闭nVIDIA OPTIMUS独显

#2

帖子 lovelyzlf »

does it really work??
linux for human beings!
SAMSUNG Q460,CPU intel i3 2330,RAM 8G,HDD640G,Graphic card GT540 1G
Debian-testing(wheezy)+KDE
头像
bigsun
帖子: 301
注册时间: 2009-01-11 16:05

Re: 用bbswitch关闭nVIDIA OPTIMUS独显

#3

帖子 bigsun »

好象有点用。

tee /proc/acpi/bbswitch <<<ON
打开时:
grep rate /proc/acpi/battery/BAT0/state
present rate: 20809 mW

tee /proc/acpi/bbswitch <<<OFF
关闭时:
grep rate /proc/acpi/battery/BAT0/state
present rate: 17320 mW=

能省15%。

http://billhsu.me/?p=103上测试能省20-30%
回复