ubuntu下关闭nvidia显卡及保存屏幕亮度
2013-05-18 21:25
337 查看
由于各种原因(ps:why linux is not for desktop),linux对市场上新出的独显支持不够全面,也不够稳定。最近花了很多时间来减少ubuntu下电池使用功率,因为dell N4110是双显卡,默认全功率运行,独显很少用到,另一方面,屏幕亮度重启后总是最亮,调节很是不便。下面的方法意在用最少的代码量达到节能效果。
Requirements:ubuntu linux;nvidia显卡,;高级电源管理acpi进程开启,有/proc/sys/acpi/call 文件 本人的dell N4110是ASUS A42JV,ubuntu 12.04 内核 3.2.0-10-generic ,下面的代码亲测通过:
一.关闭独显1. git下载acpi_call模块,关闭n卡
Requirements:ubuntu linux;nvidia显卡,;高级电源管理acpi进程开启,有/proc/sys/acpi/call 文件 本人的dell N4110是ASUS A42JV,ubuntu 12.04 内核 3.2.0-10-generic ,下面的代码亲测通过:
一.关闭独显1. git下载acpi_call模块,关闭n卡
sudo aptitude install git mkdir ~/.optimus cd ~/.optimus/ git clone http://github.com/mkottman/acpi_call.git3. 下面,进入acpi_call目录,进行编译
cd acpi_call/ && make4. 现在,将模块放入内核的acpi文件夹
sudo insmod ./acpi_call.ko6. 复制模块并运行depmod
sudo cp acpi_call.ko /lib/modules/$(uname -r)*/kernel/drivers/acpi/ sudo depmod7. 编辑/etc/modules,使模块在内核启动时加载,插入 acpi_call(独立成行)
echo 'acpi_call' >> /etc/modules***********************************************************************************************ASUS U36Jc的电脑请略去横线中的步骤************************在上文创建的 acpi_call/example 目录下,执行
ubuntu@dell N4110:~/.optimus/acpi_call$ sudo sh test_off.sh +- +-- 10 lines:#{Trying _SB.PCI0.P0P3.PEGP._OFF: failedTrying _SB.PCI0.P0P2.PEGP._OFF: failedTrying _SB.PCI0.P0P1.PEGP._OFF: failedTrying _SB.PCI0.MXR0.MXM0._OFF: failedTrying _SB.PCI0.PEG1.GFX0._OFF: failedTrying _SB.PCI0.PEG0.GFX0.DOFF: failedTrying _SB.PCI0.PEG1.GFX0.DOFF: failedTrying _SB.PCI0.PEG0.PEGP._OFF: works!#}机器若跑出以上结果,可以使用‘_SB.PCI0.PEG0.PEGP._OFF’关闭,这一点将在步骤8中使用。请特别注意。其他结果请自行参照。)****************************************************************************8. 新建一个服务,使我们可以开启/关闭n卡
cat /etc/init.d/optimusoff +- +-- 43 lines:#{#! /bin/sh### BEGIN INIT INFO# Provides: optimusoff# Required-Start: $local_fs $syslog# Required-Stop: $local_fs $syslog# Default-Start: 2 3 4 5# Default-Stop: 0 1 6# Short-Description: Disables/Enables the NVidia graphics card# within the NVidia Optimus system# # Modified for the U36Jc and Ubuntu 11.04# using details from# # http://robbyx.net/blog/?p=190### END INIT INFO. /lib/lsb/init-functionsset-ecase"$1"in start)#echo'_SB.PCI0.PEG0.PEGP._OFF'> /proc/acpi/call# -- 上一行要更改为上文中 works的命令,如 非上文举例的命令请自行修改;; stop)echo'_SB.PCI0.PEG0.PEGP._ON'> /proc/acpi/call# --同上 ;; *)echo'_SB.PCI0.PEG0.PEGP._OFF'> /proc/acpi/call# --同上 N=/etc/init.d/optimusoffecho"Usage: $N {startstop}nBy default, 'start' is executed.n">&2exit1;;esacexit0#}9. 激活服务
sudo update-rc.d optimusoff defaults 9802#default runlevel 2sudo chmod a+x /etc/init.d/optimusoff sudo service optimusoff start sudo update-initramfs -u13. 将显卡驱动模块加入黑名单
echo'blacklist nouveau'>> /etc/modprobe.d/blacklist-nvidia.conf echo'blacklist nvidia'>> /etc/modprobe.d/blacklist-nvidia.conf二,保存屏幕亮度如果你的电脑在终端下可以通过:
echo VALUE > /sys/class/backlight/.../brightness***其中 VALUE 是屏幕亮度值, ...是文件brightness的相对路径,如本人 的是:***echo 220 > /sys/class/backlight/intel_backlight/brightness***读者可以测试 VALUE值,知道调节到舒适而节能的效果。那么您可以把确认好的上述代码,如:echo 220 > /sys/class/backlight/intel_backlight/brightness 插入 /etc/rc.local中,并且去掉最后一行#exit 0 中的 #
cat /etc/rc.local +- +-- 16 lines:#{#!/bin/sh -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.echo 220 > /sys/class/backlight/intel_backlight/brightnessexit0#}
相关文章推荐
- Ubuntu 14.04 LTS 安装 NVIDIA 显卡驱动后的屏幕亮度调节问题
- 解决Intel Nvidia双显卡笔记本电脑在Ubuntu、Mint下无法用Fn键调节屏幕亮度的问题
- Ubuntu 15.04 Intel/Nvidia双显卡笔记本电脑 FN屏幕亮度调整 针对性解决方案
- ubuntu 12.04 笔记本无法调节屏幕亮度 Nvidia双显卡Bumblebee 黑屏 无法开机
- 圆满解决Ubuntu 12.04屏幕亮度不能保存的问题
- 解决ubuntu无法调整和保存屏幕亮度的问题
- ubuntu 无法调节并保存屏幕亮度解决办法
- 让Ubuntu14.04"保存"屏幕亮度值
- ubuntu13.04如何修改保存屏幕亮度
- ubuntu 12.04保存屏幕亮度解决方法
- 解决Ubuntu无法保存屏幕亮度调节的办法
- 针对 ubuntu 13.04 设置屏幕亮度无法保存问题的解决方案
- ubuntu 11.10亮度无法调节和无法保存屏幕亮度解决办法gksu gedit /etc/default/grub
- 解决 Ubuntu 12.04 LTS 保存屏幕亮度的问题
- Ubuntu 12.04保存屏幕亮度解决方法
- ubuntu 12.04亮度无法调节和无法保存屏幕亮度解决办法
- ubuntu 12.04亮度无法调节和无法保存屏幕亮度解决办法(echo_brightness)
- 如何让Ubuntu 14重启后,保存屏幕亮度的设置
- 解决宏碁5750g ubuntu无法调整和保存屏幕亮度的问题
- Ubuntu开机保存屏幕亮度的最有效方法, 无需任何软件