簡介
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
一、更新顯卡信息,非常重要,否則可能識別出錯
➜ ~ 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 a1,表示獨顯已經關閉。
三、拔下電源適配器,查看功耗
➜ ~ 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
不需要手動加入bumblebee組,安裝過程中已經將當前用戶加入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
注銷前:
➜ ~ groups
congbo adm cdrom sudo dip plugdev lpadmin sambashare
注銷後:
➜ ~ groups
congbo adm cdrom sudo dip plugdev lpadmin sambashare bumblebee
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特效)
相關鏈接:http://www.linuxidc.com/Linux/2012-09/69666.htm