Skip to content
TheChatArchiveThe Chat Archive
o1-mini-2024-09-12· OpenAIAi2 WildChat-4.8M (AI2)

Hello there! I literally just did a fresh install of Arch Linux, with KDE Plasma on…

  1. User

    Hello there! I literally just did a fresh install of Arch Linux, with KDE Plasma on Wayland and it's "essential" applications. (+ sddm display manager)

    This is what it looks like: Operating System: Arch Linux KDE Plasma Version: 6.2.4 KDE Frameworks Version: 6.8.0 Qt Version: 6.8.0 Kernel Version: 6.12.1-arch1-1 (64-bit) Graphics Platform: Wayland Processors: 16 × 13th Gen Intel® Core™ i5-13450HX Memory: 15.3 GiB of RAM Graphics Processor: Mesa Intel® Graphics Manufacturer: Dell Inc. Product Name: Dell G15 5530

    Thing is, I should be using a NVIDIA GPU, not a Mesa Intel Graphics one, could you please help me fix this issue?

  2. Assistant

    Hello! Congratulations on your fresh Arch Linux installation. I can help you configure your system to utilize the NVIDIA GPU instead of the integrated Intel graphics. Here's a comprehensive guide to ensure your NVIDIA GPU is properly installed and activated on KDE Plasma with Wayland.

    1. Verify Hardware Detection

    First, let's confirm that your system recognizes the NVIDIA GPU.

    Open a terminal and run:

    lspci | grep -E "VGA|3D"
    

    You should see entries for both Intel and NVIDIA GPUs. For example:

    00:02.0 VGA compatible controller: Intel Corporation ... 
    01:00.0 3D controller: NVIDIA Corporation ... 
    

    If the NVIDIA GPU isn't listed, you might need to check your BIOS/UEFI settings to ensure the discrete GPU is enabled.

    2. Install NVIDIA Drivers

    Arch Linux requires manual installation of proprietary drivers. Follow these steps:

    1. Update Your System

      sudo pacman -Syu
      
    2. Install NVIDIA Packages

      For the latest NVIDIA drivers compatible with GTK/Wayland, install the following:

      sudo pacman -S nvidia nvidia-utils nvidia-settings
      

      If you're using the non-LTS kernel, ensure compatibility by checking the NVIDIA package dependencies.

    3. Install Additional Packages for PRIME (Hybrid Graphics)

      To efficiently manage hybrid graphics, install:

      sudo pacman -S mesa mesa-utils vulkan-intel libva-mesa-driver
      

    3. Configure Xorg Settings (Even Though You're Using Wayland)

    While you're using Wayland, some NVIDIA settings can still be configured via Xorg for compatibility.

    1. Generate an NVIDIA Configuration File

      sudo nvidia-xconfig
      

      This creates /etc/X11/xorg.conf with NVIDIA settings.

    2. Alternatively, Use PRIME Render Offload

      For better hybrid graphics management, you can use PRIME render offload without a full Xorg configuration. This is preferred in Wayland environments.

      Create a file /etc/environment.d/prime.conf with the following content:

      # /etc/environment.d/prime.conf
      __NV_PRIME_RENDER_OFFLOAD=1
      __GLX_VENDOR_LIBRARY_NAME=nvidia
      

      Then, reload the environment:

      sudo systemctl restart sddm
      

    4. Setup Environment for NVIDIA on Wayland

    Ensure that your system is set to use Wayland with NVIDIA support. Recent KDE Plasma versions have improved support for NVIDIA on Wayland.

    1. Enable DRM Kernel Mode Setting

      Add the nvidia-drm.modeset=1 parameter to your kernel parameters:

      • Edit /etc/default/grub:

        sudo nano /etc/default/grub
        
      • Find the line starting with GRUB_CMDLINE_LINUX_DEFAULT and append nvidia-drm.modeset=1:

        GRUB_CMDLINE_LINUX_DEFAULT="... nvidia-drm.modeset=1"
        
      • Update GRUB:

        sudo grub-mkconfig -o /boot/grub/grub.cfg
        
    2. Create Modprobe Configuration

      Create /etc/modprobe.d/nvidia.conf with the following content:

      options nvidia-drm modeset=1
      
    3. Rebuild Initramfs

      sudo mkinitcpio -P
      
    4. Enable Wayland Support in SDDM

      Ensure SDDM is configured to use Wayland sessions with NVIDIA:

      • Edit /etc/sddm.conf (create it if it doesn't exist):

        sudo nano /etc/sddm.conf
        
      • Add or modify the [General] section:

        [General]
        EnableWayland=true
        Session=plasmawayland.desktop
        

    5. Configure KDE Plasma for NVIDIA on Wayland

    KDE Plasma should automatically handle the GPU selection, but you can tweak settings for optimal performance.

    1. Open nvidia-settings

      nvidia-settings
      
      • Navigate to PRIME Profiles and select either:

        • NVIDIA (Performance Mode): Uses the NVIDIA GPU exclusively.
        • Intel (Power Saving Mode): Uses the integrated Intel GPU.
        • Hybrid: Dynamically switches between Intel and NVIDIA based on demand.
      • Apply the settings and restart your system.

    2. Set Environment Variables (Optional)

      For rendering on NVIDIA, you might want to set environment variables for individual applications. For example:

      __NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia application_name
      

      Replace application_name with the program you want to run using the NVIDIA GPU.

    6. Reboot Your System

    After performing the configurations above, reboot your system to apply all changes:

    sudo reboot
    

    7. Verify NVIDIA GPU is Active

    Once rebooted, verify that the NVIDIA GPU is in use.

    1. Check NVIDIA Status

      nvidia-smi
      

      This should display information about your NVIDIA GPU, including usage statistics.

    2. Confirm OpenGL Renderer

      glxinfo | grep "OpenGL renderer"
      

      It should indicate that the NVIDIA GPU is being used. If it still shows Intel, ensure that the configurations above are correctly applied.

    8. Troubleshooting Tips

    • Wayland Compatibility: NVIDIA's support for Wayland has improved, but some features might still have issues. If you encounter problems, consider switching to an Xorg session as a temporary workaround.

    • Check Logs: Inspect system logs for any NVIDIA-related errors.

      journalctl -b | grep -i nvidia
      
    • Secure Boot: If Secure Boot is enabled in your BIOS/UEFI, it might prevent NVIDIA drivers from loading correctly. Consider disabling Secure Boot.

    • Kernel Headers: Ensure that you have the appropriate kernel headers installed, as NVIDIA drivers need to compile kernel modules.

      sudo pacman -S linux-headers
      
    • Reinstall Drivers: If issues persist, try reinstalling the NVIDIA drivers:

      sudo pacman -S nvidia nvidia-utils nvidia-settings
      

    Additional Resources

    By following these steps, your system should utilize the NVIDIA GPU instead of the integrated Intel graphics. If you encounter any specific issues during the process, feel free to ask for further assistance!