Centos 6.3安装bumblebee指南

来源:互联网 发布:java都要掌握什么技术 编辑:程序博客网 时间:2024/06/09 19:15

来自centos社区的一篇文章——


Here is what I needed in terms of additional software, besides regular  Xorg packages and drivers (make sure you have Mesa and Xorg Intel too):
NVIDIA proprietary drivers: to drive the NVIDIA GPU chip
bbswitch: to enable/disable NVIDIA GPU via ACPI calls, thus saving battery
- Virtual GL: to transfer rendered images from NVIDIA back to Intel GPU which then displays them
Bumblebee daemon: to control the whole process using all the software above

Since  not all this software is currently available at CentOS base  repositories, I had to get them from other places (I'm lazy and I didn't  want to recompile everything from the source...). Here are these  places:

kmod-nvidia-304.60-1.el6.elrepo.x86_64from ELRepo
nvidia-x11-drv-304.60-1.el6.elrepo.x86_64from ELRepo
kmod-bbswitch-0.4.2-1.el6.elrepo.x86_64from ELRepo-Testing
VirtualGL-2.3-20111213.1.puias6.x86_64from PUIAS 6 Computational
bumblebee-3.0-2.el6.elrepo.x86_64from ELRrepo-Testing

/*先安装好epel和elrepo两大源,去PUIAS 6 Computational下载VirtualGL.x86_64和VirtualGL-libs.x86_64,安装时先安装VirtualGL-libs,再安装VirtualGL;

*/


Before  start installing these packages and tweaking them to work in a NVIDIA  Optimus architecture, make sure you have your X environment working fine  with the integrated Intel GPU (you should also be able to run  Mesa/OpenGL applications like glxgears).

NOTE: keep in  mind that the tweaks below are necessary mainly because the  nvidia-x11-drv & kmod-nvidia packages were created assuming the  NVIDIA GPU is the mainGPU, which is not the case for laptops based on NVIDIA Optimus technology.

Ok, here we go:

1) Make a back up copy of your /etc/X11/xorg.conf(if it exists).
2) Install all the packages mentioned above.
3) Delete the file /etc/ld.so.conf.d/nvidia.confand run /sbin/ldconfig.
4) Restore your back up copy of /etc/X11/xorg.confif you originally had one. If not then just delete the one that might be there now.
5) Move the directory /usr/lib64/xorg/modules/extensions/nvidiawith all its contents to /usr/lib64/xorg/nvidia.
6) Edit the file /usr/share/applications/nvidia-settings.desktopand change the Execline to:

Exec=optirun nvidia-settings -c :8.0


7) Create a new group called bumblebeeand add your user ID to it.
8) Rename the file /etc/rc.d/init.d/bumlebeed. Its name should be /etc/rc.d/init.d/bumblebeed(maybe you got a newer bumblebee package that has this typo fixed already). After correcting the file name run chkconfig --add bumblebeed.
9) Edit /etc/bumblebee/bumblebee.conffile and make sure to set the following parameters:

ServerGroup=bumblebee    Driver=nvidia    KernelDriver=nvidia    Module=nvidia    PMMethod=bbswitch    LibraryPath=/usr/lib64/nvidia:/usr/lib64/vdpau:/usr/lib/nvidia:/usr/lib/vdpau    XorgModulePath=/usr/lib64/xorg/nvidia,/usr/lib64/xorg/modules


10) Reboot your laptop

To test if NVIDIA GPU is now accessible, log in as usual and open NVIDIA X Server Settings application (System -> Administration). If it runs ok then it's working.
You can also execute 

optirun /opt/VirtualGL/bin/glxspheres64



Want to compare the Intel and NVIDIA GPUs' performance? Open a terminal, run 

optirun /opt/VirtualGL/bin/glxspheres64 &

and 

/opt/VirtualGL/bin/glxspheres64 &     #without optirun



NOTE: steps 3, 5 and 9 are critical; make sure you execute them correctly.

WARNING! These instructions come with no warranty of any type. Follow them at your own risk.



不过,我按照上面的做法出了一点问题,解决办法是编辑/etc/bumblebee/xorg.conf.nvidia,把DFP换成CRT;


OK,搞定双显卡了~

原创粉丝点击