Nvidia Hyprland
If you’re running Arch Linux with an NVIDIA GPU and want to experience the modern, tiling Wayland compositor Hyprland, you’re in for a treat. However, getting NVIDIA to play nicely with Wayland compositors requires some specific configuration. This guide will walk you through the entire setup process.
Why This Matters
NVIDIA’s proprietary drivers have historically been challenging with Wayland compositors. Thanks to recent improvements in the NVIDIA driver stack (especially with the open-source kernel modules), running Hyprland on NVIDIA hardware is now not only possible but performs quite well. The key is proper configuration.
Prerequisites
Before we begin, ensure you have:
- Arch Linux installed and updated
- An NVIDIA GPU (this guide is tested on RTX 5060 with driver version 590.48.01)
- Basic familiarity with the terminal and text editing
Step 1: Install Required Packages
First, install the necessary NVIDIA packages and dependencies:
Let’s break down what each package does:
- nvidia-open-dkms: The open-source NVIDIA kernel modules (DKMS variant for automatic rebuilding)
- nvidia-utils: NVIDIA’s user-space utilities and libraries
- egl-wayland: EGL External Platform library for Wayland support
- linux-headers: Required for building kernel modules
Step 2: Enable Kernel Mode Setting (KMS)
Kernel Mode Setting allows the NVIDIA driver to set display modes at the kernel level rather than in userspace. This is crucial for Wayland support.
As of NVIDIA driver version 570.86.16, fbdev is automatically enabled when modeset is enabled. On Arch Linux, this is already configured for you, but let’s verify the setup.
Create or edit /etc/modprobe.d/nvidia.conf:
Add the following line:
This enables DRM (Direct Rendering Manager) modesetting for NVIDIA.
Step 3: Configure Early KMS Loading
Early KMS ensures that NVIDIA modules load as early as possible in the boot sequence. This prevents display issues and improves boot reliability.
Edit /etc/mkinitcpio.conf:
Find the MODULES array and add the NVIDIA modules:
The complete line might look something like this:
After making this change, regenerate your initramfs:
Step 4: Configure Hyprland Environment Variables
Hyprland needs specific environment variables to work correctly with NVIDIA hardware. Add these to your Hyprland configuration file (typically ~/.config/hypr/hyprland.conf):
These variables ensure that:
- LIBVA_DRIVER_NAME: Hardware video acceleration uses the NVIDIA VA-API driver
- __GLX_VENDOR_LIBRARY_NAME: OpenGL applications use NVIDIA’s GLX implementation
Step 5: Reboot and Verify
After completing all the configuration steps, reboot your system:
Once logged back in, verify that everything is working correctly by checking nvidia-smi:
You should see output similar to this:
Notice the processes section showing Hyprland, Xwayland, and other applications using the GPU. This confirms that Hyprland is successfully utilizing your NVIDIA hardware.