I’m reaching out for help with the installation and correct configuration of drivers for hybrid graphics on my laptop. I recently installed Fedora, and I haven’t taken any actions regarding drivers yet. My system is pristine, with only a browser and messenger installed via Flatpak.
My laptop employs a combination of NVIDIA and Intel graphics cards, and I want to learn how to efficiently, seamlessly, and preferably without the need for a reboot, switch between them.
All the resources I’ve found on the Internet seem outdated or not entirely relevant to the current version of my distribution. Therefore, I turn to the community to request a guide on how to install and configure drivers for my specific setup while ensuring easy and non-disruptive graphics switching.
If any of you have experience in this matter and are willing to share, please help me understand. I would greatly appreciate a step-by-step guide and any tips on optimizing the switching between graphics cards.
My System:
Distribution: Fedora 38 Workstation GNOME
Graphics Cards: NVIDIA GTX1650 and Intel Core I5-10300H
First, as related to hardware acceleration of graphics.
I have no clue if the intel gpu even supports hardware acceleration (mine does not) but the nvidia gpu does – (though only when using the proprietary nvidia drivers.)
Next, it is standard that the system used the iGPU by default and only uses the dGPU (nvidia) when the user selects it. This can be done when an app is loaded by right mouse click on the icon.
Also at user choice the dGPU can be set to become the primary and the iGPU ignored full time.
Many systems use the iGPU for everything on the laptop screen and the dGPU for everything on an attached external monitor.
When using the default wayland desktop some apps behave differently than when the X11 (xorg) desktop is in use.
Installation of the nvidia drivers should be done by first enabling the 3rd party repos in the gnome software app, then from the command line installing the drivers with sudo dnf install akmod-nvidia xorg-x11-drv-nvidia-cuda. This installation supports the gpu with the driver as well as apps that require use of cuda. It also enables use of the hardware acceleration on the dGPU so the user gets much better performance when playing games, streaming video, etc.
If the user chooses they may also set the nvidia gpu as primary so it is used full time by following the steps here.
Note that all the steps in that reference tell how to install the nvidia drivers, up to and including step 8. The only piece that is exclusively for setting the nvidia as primary is the part of step 8 where the user is told to edit the file /etc/X11/xorg.conf.d/nvidia.conf and insert the one line option Option "PrimaryGPU" "Yes" into the file. Everything else is just related to installing and properly configuring the nvidia GPU.
Also of note is that the nvidia.conf file shown there is only used when using the X11 desktop and is ignored when using wayland.
Thank you for the detailed response! I appreciate your insights.
It’s good to know that the system typically uses the iGPU by default and switches to the dGPU (NVIDIA) when selected by the user. I’ll keep this in mind for my usage.
I’m currently using the Wayland desktop as it’s the default in Fedora 38, and everything seems to be working fine without any modifications. However, I’m curious whether the command sudo dnf install akmod-nvidia xorg-x11-drv-nvidia-cuda you mentioned will work for the Wayland environment, as that’s what I’m using by default. Could you confirm if this command is suitable for Wayland?
Certainly it will, and the nvidia driver is better for all users in my opinion.
The only difference is that with wayland it is much more difficult to get the nvidia gpu to act as primary. That was what I intended to be understood from my post above.
If not already aware, you should know that the nvidia drivers (and actually any drivers that are not from the fedora repos) will not load when secure boot is enabled. The user must take additional steps to create and enroll a signing key into bios, then ensure the locally compiled modules are properly signed if they wish to have secure boot active.