Configuring a hybrid graphics setup on Arch Linux using AMD iGPU (integrated) and NVIDIA dGPU (discrete) involves using PRIME render offloading or reverse PRIME, as well as tools like nvidia, nvidia-prime, optimus-manager (esp. Xorg), or Wayland-compatible handling (like with gnome or sway).
Here’s a comprehensive guide to help you configure this setup.
🧰 System Summary
- iGPU: AMD (open-source
amdgpu)
- dGPU: NVIDIA (proprietary
nvidia)
- Goal: Use AMD for desktop/efficiency + NVIDIA for GPU-heavy work (gaming, CUDA).
- Desktop: Wayland preferred (e.g. GNOME, KDE), fallback to Xorg.
🔧 Step-by-step Configuration
✅ 1. Install Base Drivers
First, update your system:
sudo pacman -Syu
🔷 2. AMDGPU Driver (iGPU)
Usually enabled out of the box if you have a supported AMD CPU/APU.
Install just in case:
sudo pacman -S xf86-video-amdgpu mesa vulkan-radeon
🟨 3. NVIDIA Driver (dGPU)
Install NVIDIA drivers (for your kernel):
sudo pacman -S nvidia nvidia-utils nvidia-settings
For Vulkan support:
sudo pacman -S lib32-nvidia-utils
Optional: Install Cuda if you're doing compute:
sudo pacman -S cuda
Enable persistence daemon (optional but recommended for performance):
sudo systemctl enable nvidia-persistenced
sudo systemctl start nvidia-persistenced
🔄 4. PRIME Render Offloading Setup (Dynamic NVIDIA use)
This allows your system to default to AMD but run specific apps on NVIDIA.
Edit your kernel params:
Edit /etc/default/grub:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash nvidia_drm.modeset=1"
Then:
sudo grub-mkconfig -o /boot/grub/grub.cfg
Create /etc/modprobe.d/nvidia.conf
options nvidia NVreg_EnableGpuFirmware=0
Enable DRM Kernel Mode Setting (KMS):
Create /etc/modprobe.d/nvidia-drm.conf:
options nvidia-drm modeset=1
Rebuild initramfs:
sudo mkinitcpio -P
🔁 5. PRIME Offloading Usage
Verify with:
glxinfo | grep "OpenGL renderer"
Force using NVIDIA for apps:
__GLX_VENDOR_LIBRARY_NAME=nvidia __NV_PRIME_RENDER_OFFLOAD=1 __VK_LAYER_NV_optimus=1 appname
💡 You can alias this:
alias nvrun='__GLX_VENDOR_LIBRARY_NAME=nvidia __NV_PRIME_RENDER_OFFLOAD=1 __VK_LAYER_NV_optimus=1'
Usage:
nvrun glxgears
💻 Wayland Support (Especially GNOME or KDE Plasma)
As of now, Wayland handles hybrid graphics through PRIME render offloading in a limited way. Better support is with GNOME or KDE.
GNOME (Wayland)
- GNOME supports PRIME offloading through .desktop entries.
# Right-click App > Launch using Dedicated Graphics Card
If installed via flatpak, you need:
flatpak override --user --env=__NV_PRIME_RENDER_OFFLOAD=1 --env=__GLX_VENDOR_LIBRARY_NAME=nvidia --env=__VK_LAYER_NV_optimus=1 <app>
KDE (Wayland/X11 mix)
- Similar, via *.desktop files or manually assigning environment variables.
- You can also use
nvidia-prime for easier Wayland support.
🪟 Fallback: Using Optimus Manager (for Xorg)
If you are running Xorg and want switching between GPU modes (full NVIDIA or hybrid):
1. Install:
sudo pacman -S optimus-manager
For GTK app support (optional):
yay -S optimus-manager-qt
Enable service:
sudo systemctl enable optimus-manager.service
Now you can boot into:
- Intel/AMD (default)
- NVIDIA (gaming)
- Hybrid (render offload)
Switch using:
optimus-manager --switch hybrid
🚀 Testing GPU Load
Confirm which GPU is running your app:
nvidia-smi
✅ Summary of What You Need to Do
| Step | Description |
|---|
| 🧱 Base Setup | Install xf86-video-amdgpu, nvidia, and mesa |
| 🔌 PRIME Offload | Enable modesetting, use environment vars for offloading |
| 🖥 Display Manager | Use Wayland (GNOME/KDE), or fallback to Xorg |
| 🩺 Optional Tools | optimus-manager (Xorg), aliases for ease |
| 🔍 Test | glxinfo, nvidia-smi, vulkaninfo |
📚 Additional Tools
vulkaninfo (via vulkan-tools) – shows detailed GPU use
nvidia-settings – control power, performance states
env vblank_mode=0 – disable vsync for testing
❗ Important Notes
- DO NOT blacklist
nvidia modules.
- Avoid Bumblebee (deprecated).
- Some Wayland compositors (like Sway) do not support NVIDIA well (as of 2024). Use AMD iGPU entirely or switch to Xorg for NVIDIA.
Would you like a configs zip, or help writing .desktop files or .bashrc aliases? Or help installing GNOME/KDE with Wayland?