Can't switch to NVIDIA graphics card on Wayland KDE (Integrated NVIDIA/Intel)

cool, now X11 doesn’t use NVIDIA either

@JabaTheFrog that’s because the driver is probably not loaded… what does inxi -GSaz show?

Here’s the situation, I’ve found a solution. Only I decided to test it first on my previous Fedora KDE 40 distribution. Out of desperation I decided to ask ChatGPT, and following his instructions I got everything working. My goal was to have both the shell and all programs running from NVIDIA by default. The drivers themselves worked for me, but I had to configure each program separately to run from NVIDIA, which did not suit me. Anyway, here are the instructions that solved my problem:

Disclamer: I have not tried this on OpenSuse, only on Fedora 40 KDE Spin (Wayland).

Based on your lspci output, you have the following GPUs:

  • Intel UHD Graphics 620 (BusID 00:02.0)
  • NVIDIA GeForce MX150 (BusID 01:00.0)

Step 1: Create Xorg Configuration File

  1. Create or edit the configuration file /etc/X11/xorg.conf.d/10-nvidia.conf:
sudo nano /etc/X11/xorg.conf.d/10-nvidia.conf
  1. Add the following content to the file, using the correct BusIDs:
Section "ServerLayout"
    Identifier "layout"
    Screen 0 "nvidia"
    Inactive "intel"
EndSection

Section "Device"
    Identifier "nvidia"
    Driver "nvidia"
    BusID "PCI:1:0:0"
EndSection

Section "Screen"
    Identifier "nvidia"
    Device "nvidia"
    Option "AllowEmptyInitialConfiguration"
EndSection

Section "Device"
    Identifier "intel"
    Driver "modesetting"
    BusID "PCI:0:2:0"
    Option "AccelMethod" "none"
EndSection

Section "Screen"
    Identifier "intel"
    Device "intel"
EndSection

Step 2: Configure SDDM for NVIDIA

  1. Create or edit /etc/sddm.conf:
sudo nano /etc/sddm.conf
  1. Add the following lines to ensure the display manager uses the NVIDIA GPU:
[General]
DisplayCommand=/usr/bin/nvidia-xconfig --prime

Step 3: Set Environment Variables for Wayland

  1. Create or edit /etc/environment:
sudo nano /etc/environment
  1. Add the following lines:
__GLX_VENDOR_LIBRARY_NAME=nvidia
__NV_PRIME_RENDER_OFFLOAD=1
__GLX_VENDOR_LIBRARY_NAME=nvidia
__VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/nvidia_icd.json

Step 4: Reboot and Verify

Reboot your system to apply the changes:

sudo reboot

Step 5: Verify GPU Usage

After rebooting, check which GPU is being used by the desktop session:

glxinfo | grep "OpenGL renderer"

You should see your NVIDIA GPU listed.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.