Configuring an eGPU with PRIME on KDE Wayland with Hybrid Graphics


I’m trying to configure my Dell XPS 15-9500 on KDE Neon 20.04 (wayland) for use with an RTX 3060 in a PRIME configuration. The laptop has integrated graphics and a discrete GTX 1650. Originally, I had the 1650 usable for PRIME render offload (via prime-select on-demand), and CUDA works on the RTX 3060 eGPU out of the box.

However, I would like to use the 3060 instead of the 1650 for PRIME. Is what I’m trying to do possible? I added the following in a new file under /usr/share/X11/xorg.conf.d:

Section "Device"
    Identifier "nvidiaegpu"
    Driver     "nvidia"
    BusID      "PCI:08:00:0"                 # Edit according to lspci, translate from hex to decimal.
    Option     "AllowExternalGpus" "True"    # Required for proprietary NVIDIA driver.

Section "Screen"
    Identifier "nvidiaegpu"
    Device "nvidiaegpu"

From nvidia-smi, I can see that Xorg is running on both GPUs. However, trying to run OpenGL or Vulkan applications with the appropriate environment variable flags only runs on the 1650. As far as I’m aware, there’s no BIOS option to disable the 1650. Is there some other configuration, Xorg or otherwise, I need to do this?

nvidia-bug-report.log.gz (513.8 KB)

Please try with this xorg.conf

Section "Device"
    Identifier "nvidiaegpu"
    Driver     "nvidia"
    BusID      "PCI:08:00:0"
    Option     "AllowExternalGpus" "True"
    Option     "PrimaryGpu" "yes"
    Option     "ProbeAllGpus" "false"

Section "Device"
    Identifier "iGPU"
    Driver "modesetting"
    BusID "PCI:0:2:0"

Hi generix, thanks for the config! Unfortunately, running the following command:


only runs on the 1650 Ti.

From /var/log/Xorg.0.log, it looks like it detects the 3060 but can’t find use its DRM device:

[    19.804] (--) NVIDIA(0): Valid display device(s) on GPU-0 at PCI:8:0:0
[    19.804] (--) NVIDIA(0):     DFP-0 (boot)
[    19.804] (--) NVIDIA(0):     DFP-1
[    19.804] (--) NVIDIA(0):     DFP-2
[    19.804] (--) NVIDIA(0):     DFP-3
[    19.804] (--) NVIDIA(0):     DFP-4
[    19.804] (--) NVIDIA(0):     DFP-5
[    19.804] (--) NVIDIA(0):     DFP-6
[    19.818] (WW) NVIDIA: No DRM device: Direct render devices found but none could be
[    19.818] (WW) NVIDIA:     used.
[    19.820] (II) NVIDIA(0): NVIDIA GPU NVIDIA GeForce RTX 3060 (GA106-A) at PCI:8:0:0

Accordingly, there’s no card under /dev/dri for the 3060, but there is for the iGPU and the 1650 Ti. Any idea what the reason for this could be?

Thanks again!