• 使用 Bumblebee 控制 NVIDIA 双显卡


    简介

    Nvidia的双显卡切换技术叫Optimus(擎天柱),可惜只能在win7、vista下实现。Linux下没有对应的技术,当然苹果也没有。这导致独立显卡一直在启用,显卡发热升温,风扇狂转,却没有正常工作输入。平时笔记本电池在 Win7 能使用4小时,到了 Ubuntu 两个小时左右就耗光了。AMD早已经为ATI显卡开发出Linux下的催化剂,支持A卡与intel集显之间切换,N卡的用户只能嘴馋。


    Optimus 技术是不依赖于硬件复杂结构的交火显卡实现。独立显卡按需渲染,并传输给集成显卡,集成显卡则负责显示功能。当笔记本通过电源供电时,独立显卡将关闭,以延长电池寿命。


    Bumblebee 试图模拟 Optimus 技术的行为;当需要的时候,使用独立显卡进行渲染,不使用的时候则关闭。当前的版本仅支持按需渲染,电源管理功能仍然在开发之中。

    测试环境:

    Acer Aspire 5750G
    NVIDIA GeForce GT630M
    ubuntu 12.04 x86_64 / archlinux x86_64

    一、更新显卡信息,否则可能识别出错

    ➜  ~  sudo update-pciids
    [sudo] password for congbo:
    Downloaded daily snapshot dated 2012-09-06 03:15:02

    二、查看显卡信息

    更新前:

    ➜  ~  lspci | grep -i vga
    00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09)
    01:00.0 VGA compatible controller: NVIDIA Corporation Device 0de9 (rev a1)

    更新后:

    ➜  ~  lspci | grep -i vga
    00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09)
    01:00.0 VGA compatible controller: NVIDIA Corporation GeForce GT 630M (rev a1)

    更新后正确识别出了显卡型号。

    Nvidia 卡信息的末尾不是 rev ff,表示独显是开启的。

     

    三、拔下电源适配器,查看功耗

    ➜  ~  grep rate /proc/acpi/battery/BAT0/state
    present rate:            2613 mA

    平均2000左右

     

    四、安装bumblebee

    sudo add-apt-repository ppa:bumblebee/stable
    sudo apt-get update
    sudo apt-get install bumblebee bumblebee-nvidia

    加入bumblebee组

    sudo usermod -a -G bumblebee $USER

    ubuntu 在安装过程中会将当前用户加入bumblebee组,注销或重启后生效

    复制代码
    ➜  ~  grep congbo /etc/group
    adm:x:4:congbo
    cdrom:x:24:congbo
    sudo:x:27:congbo
    dip:x:30:congbo
    plugdev:x:46:congbo
    lpadmin:x:109:congbo
    congbo:x:1000:
    sambashare:x:124:congbo
    bumblebee:x:1001:congbo
    复制代码

    bumblebee 版本:

    复制代码
    ➜  ~  bumblebeed --version
    bumblebeed (Bumblebee) 3.0.1
    Copyright (C) 2011 The Bumblebee Project
    License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
    This is free software: you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law.
    复制代码

    五、测试效果

    ➜  ~  lspci| grep -i vga
    00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09)
    01:00.0 VGA compatible controller: NVIDIA Corporation GeForce GT 630M (rev ff)

    Nvidia 卡信息的末尾是 rev ff,表示独显已经关闭。

    再次拔下电源适配器,查看功耗。

    ➜  ~  grep rate /proc/acpi/battery/BAT0/state
    present rate:            1523 mA

    平均1000左右,2000->1000,风扇以前一直狂转,现在基本没动静。

    bumblebee的作用是禁用nvidia独立显卡,需要使用独显时,使用”optirun 程序名“手动开启nvidia来运行需要加速的程序,如optirun vmware。

    集显、独显分别运行 glxgears 或 glxspheres 测试,以glxgears为例:

    复制代码
    ➜  ~  glxgears
    Running synchronized to the vertical refresh.  The framerate should be
    approximately the same as the monitor refresh rate.
    301 frames in 5.0 seconds = 60.107 FPS
    300 frames in 5.0 seconds = 59.869 FPS
    300 frames in 5.0 seconds = 59.856 FPS
    复制代码
    ➜  ~  optirun glxgears
    2284 frames in 5.0 seconds = 456.677 FPS
    2358 frames in 5.0 seconds = 471.540 FPS
    2275 frames in 5.0 seconds = 454.942 FPS

    打开N卡设置:

    optirun nvidia-settings -c :8

    tips:

    现在i系列的一般都是双显卡配置,请勿自行安装nvidia驱动。双显卡的机器,必须停止集成显卡才能正确安装nvidia驱动。
    不要用root用户运行,最好是用sudo运行。
    如果安装失败,可能无法进入任何一个界面,包括文字界面。解决办法,固定该主机IP,开启ssh服务,确保可以在局域网的另一台主机ssh进该主机。之后然后再折腾,如果失败,ssh进该主机,卸载掉nv的驱动(sudo apt-get autoremove nvidia-current),然后重启。
    双显卡台式机折腾这个的时候注意把显示器连接到主板的输出端口上,否则没用。
    安装好以后 , “系统->系统管理->NVIDIA X Server Settings“ 不要乱动。

    有的bios里可以关掉独显,桌面渲染3D等,i卡能够胜任。(i卡虚拟机里运行win7无法开启aero特效)

    NVIDIA Optimus独显集显切换将支持Linux

    http://linux.solidot.org/article.pl?sid=12/09/04/1013238&from=rss

    NVIDIA的Optimus技术可让笔记本根据性能需要在英特尔集成显卡和NVIDIA独显之间自动切换,节省电力。但这项技术不支持Linux。2个多月前,Linux作者Linus Torvalds在芬兰的一个活动中因此对NVIDIA竖起了中指。现在,NVIDIA工程师透露他们正致力于实现Linux支持。NVIDIA的Aaron Plattner在邮件列表上,他已经在新的Linux版驱动上概念验证了Optimus,未来Linux笔记本用户有望获得Optimus支持。

  • 相关阅读:
    生成大小字母以及数字混乱的6位验证码
    重写吃货联盟
    集合练习:登录注册功能
    出现并解决Navicat 报错:1130-host ... is not allowed to connect to this MySql server,MySQL
    mysql在linux的安装
    Spring4分别整合mongo2.X和3.0
    oracle数据库使用plsql(64位)时出现的问题
    spring的CXF远程服务
    spring的定时任务或者说自动任务
    jquery节点查询
  • 原文地址:https://www.cnblogs.com/adjk/p/5148790.html
Copyright © 2020-2023  润新知