Just made it into Fedora 32 the day before yesterday and I found it to be just as good as people say it is. I own a laptop with Dual GPUs so obviously setting up Optimus correctly was a bit of an issue until I followed this guide by the word and it worked just great.
The graphics are being detected correctly. I also followed this guide, especially the part where it talks about NVIDIA Prime and the configuration did not work the way it should have. I wanted the entire desktop session to be rendered using NVIDIA GPU but it puts it to use only when I explicitly ask it to. The GNOME ends up looking ugly and feeling jittery slow due to the abysmal performance of the Intel UHD630 graphics.
Can anyone please walk me through the steps of how I can enable the NVIDIA GPU as the primary renderer for everything that gets displayed on the screen?
P.S. I do not have an option to disable the integrated graphics in the BIOS menu.
I figured out the solution for this by myself so I though I would write it down for my own reference and for those who are facing the same issue. The instructions are available albeit in a somehow unclear manner so I will try my best to explain stuff as lucidly as possible and add references to other places if I am not able to explain correctly.
The objective is to enable NVIDIA GPU of an Optimus laptop all the time and use it for every single activity. If you are not planning on using NVIDIA GPU for rendering everything, you might want to stop reading this solution right now. You would be much better off reading the original article at RPMFusion’s NVIDIA How-to guide.
As GNOME is one hell of a demanding desktop environment, it is no-brainer to use the discrete GPU for rendering the desktop and everything else. People may this feature call it NVIDIA PRIME or a Bumbleebee derivative but to be honest, I did only few configurations and it worked fantastically after that.
Then you need to add the RPM Fusion repository for NVIDIA drivers. To do that, open up GNOME Software and click on the hamburger menu (three horizontal lines) on the top-right corner. Then click on Software Repositories from the dropdown menu. There you will see this.
Run sudo dnf install gcc kernel-headers kernel-devel akmod-nvidia xorg-x11-drv-nvidia xorg-x11-drv-nvidia-libs xorg-x11-drv-nvidia-libs.i686 to get the drivers from the RPM Fusion repository. This command will also end up installing its dependencies from both 32-bit and 64-bit architecture, taking upto almost 200-300MB of data download.
Now that the drivers are all installed, you need to do one most important thing that would decide if your installation would work or not. You need to wait for some 5-10 minutes for the kernel modules to load up NVIDIA drivers. Moving on the next commands without waiting might lead to you facing the infamous black screen issue on login screen.
After the wait, execute sudo akmods --force and sudo dracut --force in succession. This would force the configuration to be read from the updated kernel modules which now have the NVIDIA drivers in them. Also, now is the best time to turn off secure boot if you are using a UEFI system for it would not allow loading up of the updated kernel module.
Wait for 3-5 minutes for the changes to take effect and then execute sudo systemctl reboot to reboot your system. Once your system has started, go to the about page in the Settings application. You are likely to see the following output.
This effectively means that the driver installation was successful. Leading to the detection of two distinct video accelerators - internal and discrete. If you wanted to use the internal GPU for basic rendering - that is to render the desktop environment and stuff and use the discrete GPU for specific applications, you can stop here.
But if you wish to entirely use your discrete GPU for both desktop environment and applications - read on the next steps and keep on implementing them as you go.
If you were able to follow the instructions and come this far, you deserve a pat on your back. To be honest, a lot of my friends opt for Debian-based and Ubuntu-based distributions like Pop!_OS to ease the pain of installing NVIDIA drivers by themselves. Fedora is pure love and it is heart-breaking to see how limited documentation is available in this regard. As a consequence of minimal documentation and the futile pursuit of elitism, the community loses people to distributions which are much more friendlier to these aspects.
This thread would go inert due to inactivity so even if I would more than love to answer questions and queries - I would not be able to. I am attaching the reference material so that if my steps do not work out for you - maybe theirs will. But feel free to PM me in case of doubts.
First, thanks for the guide and effords you have done.
I’m coming crazy with Optimus configuration on Fedora and others distro.
I use a msi laptop (i7 9750+IntelUHD630+GTX1660ti) and the only case i met that a distro work at install from scratch using PRIME Nvidia card (for performance preference) is pop_os in multi monitor configuration.
But i want really to use Fedora because is for me a perfect mix between new features coming and solid linux background with corp needs.
My point is that i would like to know if you have tested multi monitors configurations ?
My big problem is always only one monitor work in any nvidia prime configurations i have been testing.
I did not find on web the exact way to determine the configuration mux between intel and nvidia cards and the connectors dependancies, if you have a link?!
I have seen your configuration is made of GTX 1050 nvidia card(for notebook), looking at nvidia site for my card (1660ti Notebook), the last driver available is 435.21, dependencied with kernel 5.3 !
So i’m done
I tried since one week with Fedora 32 beta, the install with Nvidia drivers and the multimonitor did not work, but i did not add PRIME gpu nvidia setting and i did not wait minutes for module kernel loads.
I think this situation for many linux users of laptop as me is really a big fear. I like linux philosophy but i’m exigent about performance gui and i want to pass 99% time in linux and not M$ anymore.
I will try again following your guide.
(sorry for my not perfect english)
The Step 9 discusses about settings a PrimaryGPU parameter to the nvidia.conf file. If you go to the RPMFusion How-to guide in Optimus and read the NVIDIA PrimaryGPU Support section, you would see that the same lines that I told about also ends up enabling the external display support. This effectively means you can select from the discrete GPU or integrated GPU to render either your plugged in display or the internal display.
I would never recommend getting drivers from the NVIDIA’s official website. The RUN file that they provide is generic for all distribution and might end up replacing and modifying multiple files in an untrackable way. Using their installer might just mess up your system pretty bad - and no, kernel 5.3 is definitely not the requirement for the GPU driver. I am running the configuration I specified about in the latest kernel 5.6.7 and things are as smooth as Amul butter.
Waiting those minutes after installation is one of the most crucial steps. You need to give some time before the kernel loads up the NVIDIA driver on itself or you might face the black screen issue on boot - That happens because the GRUB was configured to expect NVIDIA driver on the kernel but does not get it for it was not allowed to build in the first place. Adding the PrimaryGPU configuration is more of a preference thing, it just makes your discrete GPU as the primary renderer.
Please follow my guide to word and you would see pleasing results.
Downgrading your kernel to 5.3 is not at all risky but it is not recommended. Newer kernels are likely to have better updates, patches for loopholes and fixes for issues so you are much better off with having the latest kernel. Also, why are you opting for an ancient 390xx driver for a discrete card as new as 1660Ti?
Well, i admit that to know which number version i can use, is confusing me because looking nvidia driver web site, it purpose only a 435.21 for laptop version.
Rpmfusion purpose only 390xx or 440.82 (but this last it is not for laptop version following nvidia recommendation, it is only desktop version of the 1660ti).