双显卡笔记本ubuntu下禁用独显

个人笔记本是Dell VOSTRO 3350,有集成的i卡,还有独立的ATI HD6630,可是在运行Ubuntu的时候,由于没有什么须要独显的应用,就想到要关闭独显,只使用集显,省电又降温~

如下操做在个人Dell VOSTRO 3350上是有效的(系统ubuntu 10.10,内核3.0.0-12),理论上适合相似的双显卡切换的笔记本,使用其余笔记本的同窗请自行测试可用性,也欢迎反馈~~
准备工做:安装了ATI闭源驱动的请先卸载,在BIOS里禁用了双显卡切换的请先开启

首先在终端下执行这条命令:php

sudo cat /sys/kernel/debug/vgaswitcheroo/switch

若是相似这样(主要是两个状态都是Pwr):
0:IGD:+:Pwr:0000:00:02.0
1:DIS: :Pwr:0000:01:00.0

就说明你的两块显卡都开着,那么就按照下面的步骤作吧
 创建一个脚本/usr/local/sbin/vgaswitcher
#!/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测试

相关文章
相关标签/搜索