DEV Community

Cover image for ⚙️ Dual GPU Setup on Fedora: NVIDIA + Intel (Optimus) with Offloading
Kamran Khan
Kamran Khan

Posted on

⚙️ Dual GPU Setup on Fedora: NVIDIA + Intel (Optimus) with Offloading

If you're running Fedora on a laptop with NVIDIA + Intel hybrid graphics (like most modern laptops with Optimus), you're in luck — Fedora makes it easy to use GPU offloading, giving you the best of both worlds: power efficiency with Intel and performance with NVIDIA when needed.

In this guide, you'll learn how to:

  • ✅ Install NVIDIA drivers with offloading support on Fedora
  • ⚙️ Run any app using the NVIDIA GPU on demand
  • 🛠️ Create a helper script and launcher to make offloading seamless
  • 🔁 (Optional) Switch to full-time NVIDIA mode for gaming laptops

🎯 What is NVIDIA Offloading?

NVIDIA Offloading allows you to use the Intel GPU as the default (great for battery life), but launch specific apps — like Steam, Blender, or Firefox — on the NVIDIA GPU for better performance.

Unlike Windows' automatic switching with Optimus, Linux uses explicit offloading — but it’s easy and powerful when configured right.


✅ Step 1: Enable RPM Fusion

First, enable RPM Fusion repositories (Free + Non-Free) to get access to proprietary NVIDIA drivers:

sudo dnf install \
  https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm \
  https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm
Enter fullscreen mode Exit fullscreen mode

✅ Step 2: Install NVIDIA Drivers with Optimus Support

Update your system and install the required NVIDIA driver packages:

sudo dnf update --refresh
sudo dnf install akmod-nvidia xorg-x11-drv-nvidia-cuda
Enter fullscreen mode Exit fullscreen mode

If you need 32-bit support (for Steam, Wine, etc.):

sudo dnf install xorg-x11-drv-nvidia-libs.i686
Enter fullscreen mode Exit fullscreen mode

✅ Step 3: Verify Intel is the Default GPU

Fedora (with X11) uses Intel as the default renderer automatically.

To confirm:

glxinfo | grep "OpenGL renderer"
Enter fullscreen mode Exit fullscreen mode

You should see something like:

OpenGL renderer string: Mesa Intel(R) UHD Graphics ...
Enter fullscreen mode Exit fullscreen mode

✅ Step 4: Run Apps with NVIDIA Offloading

You can offload any app to the NVIDIA GPU using this command format:

__NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia <your-app>
Enter fullscreen mode Exit fullscreen mode

Example:

__NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia firefox
Enter fullscreen mode Exit fullscreen mode

To verify:

glxinfo | grep "OpenGL renderer"
Enter fullscreen mode Exit fullscreen mode

It should now say something like:

OpenGL renderer string: NVIDIA GeForce RTX 3050 ...
Enter fullscreen mode Exit fullscreen mode

✅ Step 5: Confirm with nvidia-smi

Want to make sure the NVIDIA GPU is active?

nvidia-smi
Enter fullscreen mode Exit fullscreen mode

You’ll see the process listed if it’s using the GPU.


🔄 Bonus: Make It Seamless with a Helper Script

Let’s make offloading as easy as typing nvidia-run <app>.

🔹 Create the Script

mkdir -p ~/.local/bin
nano ~/.local/bin/nvidia-run
Enter fullscreen mode Exit fullscreen mode

Paste the following:

#!/bin/bash
__NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia "$@"
Enter fullscreen mode Exit fullscreen mode

Make it executable:

chmod +x ~/.local/bin/nvidia-run
Enter fullscreen mode Exit fullscreen mode

Add to PATH (if not already):

echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
Enter fullscreen mode Exit fullscreen mode

🔹 Use It Like This:

nvidia-run blender
nvidia-run code
nvidia-run steam
Enter fullscreen mode Exit fullscreen mode

🖥️ Optional: Create App Launchers

Want to launch apps from GNOME or KDE menu using NVIDIA?

Create a .desktop file:

[Desktop Entry]
Name=Blender (NVIDIA)
Exec=nvidia-run blender
Type=Application
Categories=Graphics;
Enter fullscreen mode Exit fullscreen mode

Save it to:

~/.local/share/applications/blender-nvidia.desktop
Enter fullscreen mode Exit fullscreen mode

This will now appear in your app launcher.


🔒 Secure Boot Note

NVIDIA kernel modules are unsigned, so Secure Boot will block them by default.

You can either:

  • Disable Secure Boot in your BIOS, or
  • Use MOK (Machine Owner Key) to sign and enroll the NVIDIA module (more complex).

🔋 Want Full-Time NVIDIA Mode?

You can switch your system to always use NVIDIA for everything (great for gaming, not so much for battery life), but it requires:

  • Setting NVIDIA as the primary GPU
  • Using Xorg configs or kernel parameters

Let me know in the comments if you want a full guide on that!


📌 TL;DR Cheatsheet

Task Command Example Description
Run app on NVIDIA GPU nvidia-run <app> Offloads app to NVIDIA GPU
Check GPU used glxinfo > temp && grep "OpenGL renderer" temp
or nvidia-smi
Shows whether Intel or NVIDIA is being used
Confirm Intel is default glxinfo > temp && grep "OpenGL renderer" temp Should show "Mesa Intel..." as the renderer
Create launcher .desktop file with Exec=nvidia-run your-app Launch app with NVIDIA from desktop environment

🚀 Final Thoughts

Fedora makes hybrid GPU support smooth and developer-friendly. With just a few commands and a tiny helper script, you can run games, Blender, Steam, or CUDA tools using the power of NVIDIA — while keeping Intel as the default for efficiency.

Have questions or want help creating .desktop entries for your apps? Drop a comment!

Top comments (0)