首先在終端下執行這條命令:php
sudo cat /sys/kernel/debug/vgaswitcheroo/switch
若是相似這樣(主要是兩個狀態都是Pwr):
0:IGD:+:Pwr:0000:00:02.0 1:DIS: :Pwr:0000:01:00.0
就說明你的兩塊顯卡都開着,那麼就按照下面的步驟作吧
#!/bin/bash if [ "$(whoami)" != "root" ]; then echo "Use as root" exit 1 fi if [ -z "$1" ]; then cmd="OFF" else if [ "$1" = "-i" ]; then cmd="DIGD" elif [ "$1" = "-d" ]; then cmd="DDIS" else cmd=$1 fi fi if ([ "$cmd" != "OFF" ] && [ "$cmd" != "DDIS" ] && [ "$cmd" != "DIGD" ]); then echo "Bad Command!" exit 1 fi echo "$cmd" > /sys/kernel/debug/vgaswitcheroo/switch cat /sys/kernel/debug/vgaswitcheroo/switch而後再創建一個啓動腳本/etc/init.d/vgaswitch
#!/bin/bash if [ "$1" != "start" ]; then exit; fi /usr/local/sbin/vgaswitcher #/usr/local/sbin/vgaswitcher -i #註釋掉這句的緣由是, #在Ubuntu 11.10上使用正常, #在Ubuntu12.04系統上,首次創建文件時使用正常, #後來更改了些服務,有了這句話反而沒法禁用獨顯了都創建好之後,執行以下命令:
sudo chmod +x /usr/local/sbin/vgaswitcher /etc/init.d/vgaswitch && sudo update-rc.d vgaswitch defaults
重啓就能夠禁用掉獨顯了~
sudo cat /sys/kernel/debug/vgaswitcheroo/switch
如今應該是這樣了(一個Pwr,另外一個Off):
0:IGD:+:Pwr:0000:00:02.0 1:DIS: :Off:0000:01:00.0這樣就行了~有興趣的同窗能夠在關閉先後看看機器溫度,個人從60度降到40度左右,仍是很給力的~~~
另一種更簡便的方法:html
在/etc/rc.local文件的exit 0以前添加如下語句:linux
echo IGD > /sys/kernel/debug/vgaswitcheroo/switch #切換到集成顯卡 echo OFF > /sys/kernel/debug/vgaswitcheroo/switch #關掉沒有鏈接的其它顯卡
ps:sudo gedit /etc/rc.local
可使用以上提到的查看顯卡的命令查看顯卡狀態:shell
sudo cat /sys/kernel/debug/vgaswitcheroo/switch
參考:ubuntu
1. http://zhyu.me/linux/ubuntu-disabled-independent-graphics-card.htmlbash
2. http://forum.ubuntu.org.cn/viewtopic.php?t=366609測試