Note
: Make sure to Disable Secure Boot, else whatever you do it won’t work :)
Install & Switch to NVIDIA
1. Install the required dependencies
sudo dnf install akmod-nvidia xorg-x11-drv-nvidia xorg-x11-drv-nvidia-cuda
2. Edit the environment configuration file for your shell
sudo nano /etc/environment
3. Add the following lines to enable the GPU
__GLX_VENDOR_LIBRARY_NAME=nvidia
__NV_PRIME_RENDER_OFFLOAD=1
__VK_LAYER_NV_optimus=NVIDIA_only
4. Restart the system
sudo reboot
5. Check the status of the currently selected GPU
glxinfo | grep "OpenGL renderer"
thisisyaash@yaashs-fedora:~$ glxinfo | grep "OpenGL renderer"
OpenGL renderer string: NVIDIA GeForce RTX 3050 Laptop GPU/PCIe/SSE2
It will show the result something like this with the respective gpu information
If the above steps didn’t worked, then follow the below steps :)
1. Veriify the NVIDIA Kernel Module:
lsmod | grep nvidia
If no output then it’s not loaded, else Good!
2. Reinstall the NVIDIA drivers
- check whether the NVIDIA driver is connected
/sbin/lspci | grep -e VGA
- remove existing drivers
sudo dnf remove *nvidia*
- reinstall the NVIDIA driver
sudo dnf install akmod-nvidia xorg-x11-drv-nvidia xorg-x11-drv-nvidia-cuda
- rebuild the kernel
sudo akmods --force
- ensure the NVIDIA modules are loaded
sudo modprobe nvidia
lsmod | grep nvidia
- reboot
sudo reboot