debianhdmixrandr

Cannot join external monitor with laptop display


I have a problem with connecting an external monitor to my Debian laptop.

Can you help me joining display of the laptop and the external monitor to use it both? What should be configured and checked?

HDMI cable and external monitor tested and are ok

Thanks everyone for help!

root@V:/etc/X11# sudo dmidecode | grep -A 9 "System Information"
System Information
    Manufacturer: HP
    Product Name: Victus by HP Gaming Laptop 15-fa0xxx
    
root@V:/etc/X11# lspci | grep VGA
00:02.0 VGA compatible controller: Intel Corporation Device 46a3 (rev 0c)
01:00.0 VGA compatible controller: NVIDIA Corporation Device 25a0 (rev a1)  

root@V:/home/system# cat /etc/os-release 
PRETTY_NAME="Debian GNU/Linux 11 (bullseye)"

If I disable secure boot in BIOS, external monitor start working, but laptop`s display doesnt show any image

With this config, only external monitor works

root@V:/etc/X11# cat xorg.conf
Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0" 0 0
    Option         "Xinerama" "0"
EndSection

Section "Monitor"
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "Unknown"
EndSection

Section "Monitor"
    Identifier     "Monitor1"
    VendorName     "Unknown"
    ModelName      "Unknown"
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    Option         "AllowEmptyInitialConfiguration" "true"
    Option         "ConnectedMonitor" "Monitor0"
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

Section "Screen"
    Identifier     "Screen1"
    Device         "Device0"
    Monitor        "Monitor1"
    DefaultDepth    24
    Option         "AllowEmptyInitialConfiguration" "true"
    Option         "ConnectedMonitor" "Monitor1"
    SubSection     "Display"
        Depth       24
    EndSubSection

When I had this config, display worked, but external monitor didnt show any image

system@V:~$ xrandr
Screen 0: minimum 320 x 200, current 1920 x 1080, maximum 16384 x 16384
eDP-1 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 344mm x 193mm
   1920x1080    144.00*+  60.01    60.02    59.97    59.96    59.93  
   1680x1050     84.94    74.89    69.88    59.95    59.88  
   1600x1024     60.17  
   1400x1050     85.00    74.76    70.00    59.98  
   1600x900      59.99    59.94    59.95    59.82  
   1280x1024     85.02    75.02    60.02  
   1440x900      59.89  
   1400x900      59.96    59.88  
   1280x960      85.00    60.00  
   1440x810      60.00    59.97  
   1368x768      59.88    59.85  
   1360x768      59.80    59.96  
   1280x800      59.99    59.97    59.81    59.91  
   1152x864     100.00    85.06    85.00    75.00    75.00    70.00    60.00  
   1280x720      60.00    59.99    59.86    59.74  
   1024x768      85.00    75.05    60.04    85.00    75.03    70.07    60.00  
   1024x768i     86.96  
   960x720       85.00    75.00    60.00  
   928x696       75.00    60.05  
   896x672       75.05    60.01  
   1024x576      59.95    59.96    59.90    59.82  
   960x600       59.93    60.00  
   832x624       74.55  
   960x540       59.96    59.99    59.63    59.82  
   800x600       85.00    75.00    70.00    65.00    60.00    85.14    72.19    75.00    60.32    56.25  
   840x525       85.02    74.96    69.88    60.01    59.88  
   864x486       59.92    59.57  
   800x512       60.17  
   700x525       85.08    74.76    70.06    59.98  
   800x450       59.95    59.82  
   640x512       85.02    75.02    60.02  
   720x450       59.89  
   700x450       59.96    59.88  
   640x480       85.09    60.00    85.01    72.81    75.00    59.94  
   720x405       59.51    58.99  
   720x400       85.04  
   684x384       59.88    59.85  
   680x384       59.80    59.96  
   640x400       59.88    59.98    85.08  
   576x432      100.11    85.15    85.09    75.00    75.00    70.00    60.06  
   640x360       59.86    59.83    59.84    59.32  
   640x350       85.08  
   512x384       85.00    75.03    70.07    60.00  
   512x384i      87.06  
   512x288       60.00    59.92  
   416x312       74.66  
   480x270       59.63    59.82  
   400x300       85.27    72.19    75.12    60.32    56.34  
   432x243       59.92    59.57  
   320x240       85.18    72.81    75.00    60.05  
   360x202       59.51    59.13  
   360x200       85.04  
   320x200       85.27  
   320x180       59.84    59.32  
   320x175       85.27  
DP-1 disconnected (normal left inverted right x axis y axis)
DP-2 disconnected (normal left inverted right x axis y axis)
DP-3 disconnected (normal left inverted right x axis y axis)
DP-4 disconnected (normal left inverted right x axis y axis)





root@V:/etc/X11# cat xorg.conf.backup7-notworking 
Section "Device"
    Identifier "Device0"
    Driver "nvidia"
EndSection

Section "Screen"
    Identifier "Screen0"
    Device "Device0"
    Monitor "Monitor0"
    DefaultDepth 24
    SubSection "Display"
        Depth 24
        Modes "1920x1080"
    EndSubSection
EndSection

Section "Device"
    Identifier "intel"
    Driver "modesetting"
    Option "AccelMethod" "None"
    Option "TearFree" "True"
EndSection

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

Section "ServerLayout"
    Identifier "layout"
    Screen 0 "intel"
    Screen 1 "nvidia" RightOf "intel"
EndSection

No updates need to be installed

sudo apt update

sudo apt upgrade

sudo apt upgrade linux-image-amd64

Nvidia modules are loaded

root@V:/home/system# lsmod | grep nvidia

nvidia_drm             73728  5

nvidia_modeset       1204224  10 nvidia_drm

nvidia              35532800  457 nvidia_modeset

drm_kms_helper        204800  3 drm_display_helper,nvidia_drm,i915

drm                   614400  14 drm_kms_helper,drm_display_helper,nvidia,drm_buddy,nvidia_drm,i915,ttm

video                  65536  2 i915,nvidia_modeset
root@V:/home/system# nvidia-smi
Sun Jul  2 14:32:49 2023       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 470.182.03   Driver Version: 470.182.03   CUDA Version: 11.4     |
|-------------------------------+----------------------+----------------------+
| 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 ...  On   | 00000000:01:00.0  On |                  N/A |
| N/A   39C    P8     3W /  N/A |    264MiB /  3910MiB |      1%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|    0   N/A  N/A      2571      G   /usr/lib/xorg/Xorg                 89MiB |
|    0   N/A  N/A      2685      G   /usr/bin/gnome-shell               41MiB |
|    0   N/A  N/A      3528      G   gnome-control-center                1MiB |
|    0   N/A  N/A      3589      G   ...b/firefox-esr/firefox-esr      128MiB |
+-----------------------------------------------------------------------------+

Also if I configure with nvidia-xconfig, only external display works

Because it creates this config:

root@V:/etc/X11# cat xorg.conf.backup5-xconfig 
# nvidia-xconfig: X configuration file generated by nvidia-xconfig
# nvidia-xconfig:  version 470.103.01

Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0"
    InputDevice    "Keyboard0" "CoreKeyboard"
    InputDevice    "Mouse0" "CorePointer"
EndSection

Section "Files"
EndSection

Section "InputDevice"
    # generated from default
    Identifier     "Mouse0"
    Driver         "mouse"
    Option         "Protocol" "auto"
    Option         "Device" "/dev/psaux"
    Option         "Emulate3Buttons" "no"
    Option         "ZAxisMapping" "4 5"
EndSection

Section "InputDevice"
    # generated from default
    Identifier     "Keyboard0"
    Driver         "kbd"
EndSection

Section "Monitor"
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "Unknown"
    Option         "DPMS"
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection



root@V:/etc/X11/xorg.conf.d# ls -l
total 8
-rw-r--r-- 1 root root 258 Jul  1 17:42 10-monitor.conf
-rw-r--r-- 1 root root 235 Jul  1 21:05 20-nvidia.conf
root@V:/etc/X11/xorg.conf.d# cat 20-nvidia.conf 
Section "OutputClass"
    Identifier "nvidia"
    MatchDriver "nvidia-drm"
    Driver "nvidia"
    Option "AllowEmptyInitialConfiguration"
    Option "PrimaryGPU" "yes"
    ModulePath "/usr/lib/x86_64-linux-gnu/nvidia/xorg"
EndSection
root@V:/etc/X11/xorg.conf.d# cat 10-monitor.conf 
Section "Monitor"
### Monitor Identity - Typically HDMI-0 or DisplayPort-0
    Identifier    "HDMI1" 
    Option        "PreferredMode" "1920x1080"
    Option        "TargetRefresh" "60"
    Option    "Position" "0 0"
    Option    "Enable" "true"
EndSection 

This log is when only internal monitor of laptop work

I had this logs

    root@V:/var/log# cat /var/log/Xorg.0.log
    [     6.241] (--) Log file renamed from "/var/log/Xorg.pid-1375.log" to "/var/log/Xorg.0.log"
    [     6.242] 
    X.Org X Server 1.20.11
    X Protocol Version 11, Revision 0
    [     6.242] Build Operating System: linux Debian
    [     6.242] Current Operating System: Linux V 6.1.0-0.deb11.7-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.20-2~bpo11+1 (2023-04-23) x86_64
    [     6.242] Kernel command line: BOOT_IMAGE=/boot/vmlinuz-6.1.0-0.deb11.7-amd64 root=UUID=83cc76f1-52dc-4d53-8972-2c2dcf53da15 ro quiet splash
    [     6.242] Build Date: 23 March 2023  10:25:56AM
    [     6.242] xorg-server 2:1.20.11-1+deb11u6 (https://www.debian.org/support) 
    [     6.242] Current version of pixman: 0.40.0
    [     6.242]    Before reporting problems, check http://wiki.x.org
        to make sure that you have the latest version.
    [     6.242] Markers: (--) probed, (**) from config file, (==) default setting,
        (++) from command line, (!!) notice, (II) informational,
        (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
    [     6.242] (==) Log file: "/var/log/Xorg.0.log", Time: Sun Jul  2 11:21:14 2023
    [     6.243] (==) Using config file: "/etc/X11/xorg.conf"
    [     6.243] (==) Using config directory: "/etc/X11/xorg.conf.d"
    [     6.243] (==) Using system config directory "/usr/share/X11/xorg.conf.d"
    [     6.246] (==) ServerLayout "layout"
    [     6.246] (**) |-->Screen "intel" (0)
    [     6.246] (**) |   |-->Monitor "<default monitor>"
    [     6.246] (**) |   |-->Device "intel"
    [     6.246] (==) No monitor specified for screen "intel".
        Using a default monitor configuration.
    [     6.246] (**) |-->Screen "nvidia" (1)
    [     6.246] (**) |   |-->Monitor "<default monitor>"
    [     6.246] (**) |   |-->Device "nvidia"
    [     6.246] (==) No monitor specified for screen "nvidia".
        Using a default monitor configuration.
    [     6.246] (==) Automatically adding devices
    [     6.246] (==) Automatically enabling devices
    [     6.246] (==) Automatically adding GPU devices
    [     6.246] (==) Max clients allowed: 256, resource mask: 0x1fffff
    [     6.248] (WW) The directory "/usr/share/fonts/X11/cyrillic" does not exist.
    
    [     6.266] (II) Loading /usr/lib/xorg/modules/libglamoregl.so
    [     6.271] (II) Module glamoregl: vendor="X.Org Foundation"
    [     6.271]    compiled for 1.20.11, module version = 1.0.1
    [     6.271]    ABI class: X.Org ANSI C Emulation, version 0.4
    [     6.421] (II) modeset(0): Refusing to try glamor on llvmpipe
    [     6.422] (EE) modeset(0): glamor initialization failed
    [     6.422] (II) modeset(0): ShadowFB: preferred YES, enabled YES
    [     6.422] (II) modeset(0): Double-buffered shadow updates: off
    [     6.423] (II) modeset(0): Output eDP-1 has no monitor section
    [     6.424] (II) modeset(0): Output DP-1 has no monitor section
    [     6.427] (II) modeset(0): Output DP-2 has no monitor section
    [     6.430] (II) modeset(0): Output DP-3 has no monitor section
    [     6.432] (II) modeset(0): Output DP-4 has no monitor section
    [     6.434] (II) modeset(0): EDID for output eDP-1
    ```
    
    This log is when only external monitor work
    
    
    root@V:/var/log# cat Xorg.0.log
    
    
    
    [     5.900] (--) Log file renamed from "/var/log/Xorg.pid-1428.log" to "/var/log/Xorg.0.log"
    
    
    
    [     5.901] 
    
    
    
    X.Org X Server 1.20.11
    
    
    
    X Protocol Version 11, Revision 0
    
    
    
    [     5.901] Build Operating System: linux Debian
    
    
    
    [     5.901] Current Operating System: Linux V 6.1.0-0.deb11.7-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.20-2~bpo11+1 (2023-04-23) x86_64
    
    
    
    [     5.901] Kernel command line: BOOT_IMAGE=/boot/vmlinuz-6.1.0-0.deb11.7-amd64 root=UUID=83cc76f1-52dc-4d53-8972-2c2dcf53da15 ro quiet splash
    
    
    
    [     5.901] Build Date: 23 March 2023  10:25:56AM
    
    
    
    [     5.901] xorg-server 2:1.20.11-1+deb11u6 (https://www.debian.org/support) 
    
    
    
    [     6.127] (II) Loader magic: 0x557b6e707e40
    
    
    
    [     6.127] (II) Module ABI versions:
    
    
    
    [     6.127]    X.Org ANSI C Emulation: 0.4
    
    
    
    [     6.127]    X.Org Video Driver: 24.1
    
    
    
    [     6.127]    X.Org XInput driver : 24.1
    
    
    
    [     6.127]    X.Org Server Extension : 10.0
    
    
    
    [     6.127] (++) using VT number 1
    
    
    
    [     6.128] (II) systemd-logind: took control of session /org/freedesktop/login1/session/c1
    
    
    
    [     6.129] (II) xfree86: Adding drm device (/dev/dri/card1)
    
    
    
    [     6.129] (II) systemd-logind: got fd for /dev/dri/card1 226:1 fd 14 paused 0
    
    
    
    [     6.129] (II) xfree86: Adding drm device (/dev/dri/card0)
    
    
    
    [     6.129] (II) systemd-logind: got fd for /dev/dri/card0 226:0 fd 15 paused 0
    
    
    
    [     6.130] (**) OutputClass "nvidia" ModulePath extended to "/usr/lib/x86_64-linux-gnu/nvidia/xorg,/usr/lib/xorg/modules"
    
    
    
    [     6.130] (**) OutputClass "nvidia" setting /dev/dri/card1 as PrimaryGPU
    
    
    
    [     6.130] (--) PCI: (0@0:2:0) 8086:46a3:103c:8a4f rev 12, Mem @ 0x6103000000/16777216, 0x4000000000/268435456, I/O @ 0x00005000/64, BIOS @ 0x????????/131072
    
    
    
    [     6.130] (--) PCI:*(1@0:0:0) 10de:25a0:103c:8a4f rev 161, Mem @ 0x81000000/16777216, 0x6000000000/4294967296, 0x6100000000/33554432, I/O @ 0x00004000/128, BIOS @ 0x????????/524288
    
    
    
    [     6.130] (II) LoadModule: "glx"
    
    
    
    [     6.131] (II) Loading /usr/lib/xorg/modules/extensions/libglx.so
    
    
    
    [     6.132] (II) Module glx: vendor="X.Org Foundation"
    
    
    
    [     6.132]    compiled for 1.20.11, module version = 1.0.0
    
    
    
    [     6.132]    ABI class: X.Org Server Extension, version 10.0
    
    
    
    [     6.132] (II) LoadModule: "nvidia"
    
    
    
    [     6.132] (II) Loading /usr/lib/xorg/modules/drivers/nvidia_drv.so
    
    
    
    [     6.136] (II) Module nvidia: vendor="NVIDIA Corporation"
    
    
    
    [     6.136]    compiled for 1.6.99.901, module version = 1.0.0
    
    
    
    [     6.136]    Module class: X.Org Video Driver
    
    
    
    [     6.136] (II) NVIDIA dlloader X Driver  470.182.03  Fri Feb 24 03:24:48 UTC 2023
    
    
    
    [     6.136] (II) NVIDIA Unified Driver for all Supported NVIDIA GPUs
    
    
    
    [     6.136] (II) systemd-logind: releasing fd for 226:1
    
    
    
    [     6.137] (II) Loading sub module "fb"
    
    
    
    [     6.137] (II) LoadModule: "fb"
    
    
    
    [     6.138] (II) Loading /usr/lib/xorg/modules/libfb.so
    
    
    
    [     6.138] (II) Module fb: vendor="X.Org Foundation"
    
    
    
    [     6.138]    compiled for 1.20.11, module version = 1.0.0
    
    
    
    [     6.138]    ABI class: X.Org ANSI C Emulation, version 0.4
    
    
    
    [     6.138] (II) Loading sub module "wfb"
    
    
    
    [     6.138] (II) LoadModule: "wfb"
    
    
    
    [     6.138] (II) Loading /usr/lib/xorg/modules/libwfb.so
    
    
    
    [     6.139] (II) Module wfb: vendor="X.Org Foundation"
    
    
    
    [     6.139]    compiled for 1.20.11, module version = 1.0.0
    
    
    
    [     6.139]    ABI class: X.Org ANSI C Emulation, version 0.4
    
    
    
    [     6.139] (II) Loading sub module "ramdac"
    
    
    
    [     6.139] (II) LoadModule: "ramdac"
    
    
    
    [     6.139] (II) Module "ramdac" already built-in
    
    
    
    [     6.173] (**) NVIDIA(0): Depth 24, (--) framebuffer bpp 32
    
    
    
    [     6.173] (==) NVIDIA(0): RGB weight 888
    
    
    
    [     6.173] (==) NVIDIA(0): Default visual is TrueColor
    
    
    
    [     6.173] (==) NVIDIA(0): Using gamma correction (1.0, 1.0, 1.0)
    
    
    
    [     6.173] (II) Applying OutputClass "nvidia" options to /dev/dri/card1
    
    
    
    [     6.173] (**) NVIDIA(0): Option "AllowEmptyInitialConfiguration" "true"
    
    
    
    [     6.173] (**) NVIDIA(0): Option "ConnectedMonitor" "Monitor0"
    
    
    
    [     6.173] (**) NVIDIA(0): Enabling 2D acceleration
    
    
    
    [     6.173] (**) NVIDIA(0): ConnectedMonitor string: "Monitor0"
    
    
    
    [     6.173] (II) Loading sub module "glxserver_nvidia"
    
    
    
    [     6.173] (II) LoadModule: "glxserver_nvidia"
    
    
    
    [     6.173] (II) Loading /usr/lib/xorg/modules/extensions/libglxserver_nvidia.so
    
    
    
    [     6.199] (II) Module glxserver_nvidia: vendor="NVIDIA Corporation"
    
    
    
    [     6.199]    compiled for 1.6.99.901, module version = 1.0.0
    
    
    
    [     6.199]    Module class: X.Org Server Extension
    
    
    
    [     6.199] (II) NVIDIA GLX Module  470.182.03  Fri Feb 24 03:21:43 UTC 2023
    
    
    
    [     6.200] (II) NVIDIA: The X server supports PRIME Render Offload.
    
    
    
    [     6.231] (--) NVIDIA(0): Valid display device(s) on GPU-0 at PCI:1:0:0
    
    
    
    [     6.231] (--) NVIDIA(0):     DFP-0 (boot)
    
    
    
    [     6.231] (II) NVIDIA(0): NVIDIA GPU NVIDIA GeForce RTX 3050 Ti Laptop GPU (GA107-A) at
    
    
    
    [     6.231] (II) NVIDIA(0):     PCI:1:0:0 (GPU-0)
    
    
    
    [     6.231] (--) NVIDIA(0): Memory: 4194304 kBytes
    
    
    
    [     6.231] (--) NVIDIA(0): VideoBIOS: 94.07.56.40.16
    
    
    
    [     6.231] (II) NVIDIA(0): Detected PCI Express Link width: 16X
    
    
    
    [     6.276] (--) NVIDIA(GPU-0): XMI Mi Monitor (DFP-0): connected
    
    
    
    [     6.276] (--) NVIDIA(GPU-0): XMI Mi Monitor (DFP-0): Internal TMDS
    
    
    
    [     6.276] (--) NVIDIA(GPU-0): XMI Mi Monitor (DFP-0): 600.0 MHz maximum pixel clock
    
    
    
    root@V:/var/log# cat Xorg.1.log
    
    
    
     87.878] (==) Using config file: "/etc/X11/xorg.conf"
    
    
    
    [    87.878] (==) Using config directory: "/etc/X11/xorg.conf.d"
    
    
    
    [    87.878] (==) Using system config directory "/usr/share/X11/xorg.conf.d"
    
    
    
    [    87.878] (==) ServerLayout "Layout0"
    
    
    
    [    87.878] (**) |-->Screen "Screen0" (0)
    
    
    
    [    87.878] (**) |   |-->Monitor "Monitor0"
    
    
    
    [    87.878] (**) |   |-->Device "Device0"
    
    
    
    [    87.878] (**) Option "Xinerama" "0"
    
    
    
    [    87.878] (==) Automatically adding devices
    
    
    
    [    87.878] (==) Automatically enabling devices
    
    
    
    [    87.878] (==) Automatically adding GPU devices
    
    
    
    [    87.878] (==) Max clients allowed: 256, resource mask: 0x1fffff
    
    
    
    [    87.878] (WW) The directory "/usr/share/fonts/X11/cyrillic" does not exist.
    
    
    
    [    87.878]    Entry deleted from font path.
    
    
    
    [    88.665] (--) NVIDIA(GPU-0): XMI Mi Monitor (DFP-0): connected
    
    
    
    [    88.665] (--) NVIDIA(GPU-0): XMI Mi Monitor (DFP-0): Internal TMDS
    
    
    
    [    88.665] (--) NVIDIA(GPU-0): XMI Mi Monitor (DFP-0): 600.0 MHz maximum pixel clock


Solution

  • Deleted nvidia driver and external monitor started working!