This guide will show you how to install Nvidia driver in a hybrid graphics laptop on Linux. For this guide, we have a laptop with dual graphics adapters, or you can say (hybrid graphics), one is (intel integrated GPU), and other is (Nvidia GTX950M), and we are running CentOS 7 Linux on top of it.

This guide requires "Secure Boot" to be turned off from BIOS (if exists) before proceeding with the following, or Nvidia driver loading will fail.
Add RPMFusion Repository
First, you need to add the RPMFusion repository in your system. To enable access to these repository, execute the following command, depending on what distribution you use and then follow the default options to install.
For CentOS, RHEL 7:
For CentOS, RHEL 8:
RHEL 8 requires an additional step:
CentOS Steam 8 requires an additional step:
CentOS 8 (older version) used a case sensitive name for the PowerTools repository:
Install NVIDIA Driver
Type below command to install latest available Nvidia driver on CentOS, RHEL 7
For CentOS, RHEL 8:
You must wait 5-10 minutes for the kernel modules to load. Please do not proceed to the next steps immediately.
Execute following command to force the configuration to be read from the updated kernel modules which now have the latest Nvidia driver in them.
Wait for 3-5 minutes for the changes to take effect and then reboot your system.
Install Bumblebee
Bumblebee providing an elegant and stable means of managing optimus hybrid graphics chipsets. A primary goal of this project is to not only enable use of the discrete GPU for rendering, but also to enable smart power management of the dGPU when it's not in use.
For CentOS, RHEL 7:
For CentOS, RHEL 8:
Type below command to add your username to bumblebee group:
Reboot your system to make changes to take effect:
Once your system has started, edit bumblebee.conf with any of preferred text editor:
Save and close the editor when you are finished.
Edit nvidia-settings.desktop with any of your preferred text editor:
Make the following highlighted changes:
Save and close the editor when you are finished.
Reboot your machine to take changes into effect:
Once your system has booted, type below command to verify your Nvidia GPU rendering:
It should show your NVIDIA GPU like below.

Type below command to clone screenfetch script from github:
Execute screenfetch
It should show your NVIDIA GPU under the GPU name like below:

Type below command to open NVIDIA X Server Settings application.
You can make other configuration changes using NVIDIA X Server Settings application. Also the GPU would show activity in its utilization percentage to signify that it is actually working.

Whenever you need to run an application to be rendered using Nvidia GPU, you should run it like example below:
At this stage, your laptop is ready to be used with integrated GPU, and NVIDIA GPU at the same time depending on your applications requirements. If you don't need an application to be
rendered using Nvidia GPU, run it without optirun, and it will
automatically use intel integrated GPU.
In this guide you learn, how to install latest Nvidia driver on a hybrid graphics laptop running CentOS, RHEL or Oracle Linux on top of it. You also learn how to switch between integrated GPU and Nvidia GPU using bumblebee optirun.
Conclusion
Now that you have successfully installed latest NVIDIA driver on a CentOS, RHEL machine, you can begin testing your graphic adapter functionality with any of applications, tools, or games of your choice.
Hello. Did what you said here and as a result there's no mouse or keyboard in GUI. Any suggestions?
ReplyDeleteSolution to your problem is: yum -y install xorg-x11-drv-evdev xorg-x11-drv-synaptics
DeleteHello. Followed your instructions to the letter and the result is an error: "Bumblebee Daemon has not been started yet or the socket path /bar/run/bumblebee.socket was incorrect." Any suggestions?
ReplyDeleteYou should check your problem here https://github.com/Bumblebee-Project/Bumblebee/wiki/Troubleshooting and here https://github.com/bumblebee-project/bumblebee/issues/227 and try to fix your issues as suggested.
DeleteTry this to fix your issue:
Deleteyum -y install dkms-nvidia
Doesn't work on Centos 8 (64bit). Appears as thought the ELrepo 8 isn't as complete.
ReplyDeleteHi, and then how do I launch applications with the GPU? I tried optirun firefox and when I do nvidia-smi it is not a process. Could you explain why to me? Thanks
ReplyDeletefrom a terminal, execute the following command to open NVIDIA control panel:
Deleteoptirun nvidia-settings -c :8.0
I did and it works. My issue is that NVIDIA settings does not recognize my internal screen and shows "X Screen 0 no scannout". I am on CentOS 8 and my settings shows exactly like on the article and I followed every steps correctly. Running "optirun nvidia-settings -c :8.0" show me that it uses the GPU in nvidia-smi but running optirun firefox for example does not create any process that are shown in nvidia-smi. If you have any idea what could be causing the issue, any help would be greatly appreciated, thank you.
ReplyDeleteYour internal screen must be connected to builtin VGA card if your machine has dual graphic adapters for example, intel and your external screen is connected to your Nvidia. Try to execute firefox with GPU like below:
Deleteoptirun firefox http://google.com
Do you know how to uninstall Bumblebee?
DeleteYou can execute "yum -y remove bumblebee" on a terminal to uninstall bumblebee package, and reboot your machine to take changes into effect.
DeleteSorry, I found the problem. For some reason, the xorg.conf generated by elrepo has to be changed on a laptop. Thanks for the help
ReplyDeleteHappy to hear that you fixed it. Would you mind if you share here the changes you made in xorg.conf that helped you fixing the issue?
DeleteHello
ReplyDeleteI just update centos to rocky linux (so that is the very last version), and it the step "akmods --force" fails to build the module. Is there any update to expect ?
thanks in advance