Display detected by xrandr but not KDE

I’m trying to setup an external monitor to use with my system, but I’m having trouble with making KDE recognize its plugged in.

xrandr/xorg does detect the display:

HDMI-1-0 connected (normal left inverted right x axis y axis)
   2560x1440    143.93 + 120.00    59.95  
   3840x2160     59.94    50.00    29.97    25.00    23.98  
   1920x1080    119.88    60.00    59.94    50.00  
   1280x720      59.94    50.00  
   1024x768      60.00  
   800x600       60.32  
   720x576       50.00  
   720x480       59.94  
   640x480       59.94    59.93  
Nov 28 22:07:43 nixos xserver-wrapper[1317]: (--) NVIDIA(GPU-0): LG Electronics LG ULTRAGEAR (DFP-4): 600.0 MHz maximum pixel clock
Nov 28 22:07:43 nixos xserver-wrapper[1317]: (--) NVIDIA(GPU-0): LG Electronics LG ULTRAGEAR (DFP-4): Internal TMDS
Nov 28 22:07:43 nixos xserver-wrapper[1317]: (--) NVIDIA(GPU-0): LG Electronics LG ULTRAGEAR (DFP-4): connected

And my Nvidia card seems to be working

Providers: number : 2
Provider 0: id: 0x54 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 4 outputs: 1 associated providers: 1 name:Unknown AMD Radeon GPU @ pci:0000:06:00.0
Provider 1: id: 0x1f9 cap: 0x2, Sink Output crtcs: 4 outputs: 6 associated providers: 1 name:NVIDIA-G0
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 520.56.06    Driver Version: 520.56.06    CUDA Version: 11.8     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  NVIDIA GeForce ...  Off  | 00000000:01:00.0 Off |                  N/A |
| N/A   35C    P0    N/A /  N/A |      5MiB /  8192MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|    0   N/A  N/A      1317      G   ...xorg-server-1.20.14/bin/X        4MiB |
+-----------------------------------------------------------------------------+

I’m currently running the Nvidia Prime setup (3070m, 5800H) from the wiki with offload enabled and I have also added the special configuration mentioned for external displays. Config is here.

KDE however does not detect the display or give me an option to activate it.

Hi, could you post the qdbus log (with qdbusviewer for example) when you plug the monitor in?

Also, more information would be appreciated, what the system is, the GPU, ETC.

Host is a Lenovo Legion 5 Pro 16ach6h with an AMD 5800H and 3070m dGPU.

$ nix-info -m
- system: `"x86_64-linux"`
 - host os: `Linux 6.0.9, NixOS, 22.11 (Raccoon), 22.11beta167.8690906c4d8`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.11.0`
 - channels(infinity): `""`
 - channels(root): `"home-manager-22.11.tar.gz, nixos-22.11"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`
$ uname -a
Linux nixos 6.0.9 #1-NixOS SMP PREEMPT_DYNAMIC Wed Nov 16 09:04:15 UTC 2022 x86_64 GNU/Linux
$ lspci
...
01:00.0 VGA compatible controller: NVIDIA Corporation GA104M [GeForce RTX 3070 Mobile / Max-Q] (rev a1)
01:00.1 Audio device: NVIDIA Corporation GA104 High Definition Audio Controller (rev a1)
...
06:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Cezanne (rev c5)
...

Not too sure about what part I should be looking at for this :sweat_smile:

Oh, no worries, I should have just said to post the output of dbus-monitor.

However, that is most helpful. I am not terribly familiar with that laptop, but I know other Lenovo mobile workstations have issues running external displays due to the way the graphics card is attached to the host (the display is hooked up to the GPU directly instead of routing thorough the iGPU like a normal laptop). I don’t have experience with this issue, but I can look around and see if anything pops out.

EDIT: I found a Reddit post that states you need the iGPU disabled to use external monitors. https://www.reddit.com/r/LenovoLegion/comments/miqbv4/lenovo_legion_5_pro_actual_linux_experience_and/

Ooh, yeah using the nvidia driver only does give me output on the external display. I should’ve realized this sooner based on how I switched in my other installation. Now I just need to figure out what optimus-manager does to achieve being able to keep both the builtin and external one working at the same time in the nvidia mode.

1 Like