After spending the last couple of weeks trying to make my NVIDIA GPU work with CentOS 6.3 64-bit on my laptop (Alienware M14x) I finally succeeded. Now I can run OpenGL applications using either one of my GPUs, integrated Intel HD Graphics 3000 Sandy Bridge or discrete NVIDIA GeForce GT 555M. Pretty cool, heh?
My laptop uses NVIDIA Optimus technology, therefore I had to use TBP (The Bumblebee Project). Also, I've decided to use NVIDIA proprietary drivers instead of Xorg Nouveau driver, just because I wanted maximum performance.
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_64 from ELRepo
* nvidia-x11-drv-304.60-1.el6.elrepo.x86_64 from ELRepo
* kmod-bbswitch-0.4.2-1.el6.elrepo.x86_64 from ELRepo-Testing
* VirtualGL-2.3-20111213.1.puias6.x86_64 from PUIAS 6 Computational
* bumblebee-3.0-2.el6.elrepo.x86_64 from ELRrepo-Testing
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 main GPU, 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.conf and run /sbin/ldconfig.
4) Restore your back up copy of /etc/X11/xorg.conf if 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/nvidia with all its contents to /usr/lib64/xorg/nvidia.
6) Edit the file /usr/share/applications/nvidia-settings.desktop and change the Exec line to:
Code: Select all
Exec=optirun nvidia-settings -c :8.0
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.conf file and make sure to set the following parameters:
Code: Select all
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
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
Code: Select all
optirun /opt/VirtualGL/bin/glxspheres64
Code: Select all
optirun /opt/VirtualGL/bin/glxspheres64 &
Code: Select all
/opt/VirtualGL/bin/glxspheres64 & #without optirun
WARNING! These instructions come with no warranty of any type. Follow them at your own risk.
Enjoy!