Connecting an external monitor using HDMI disables laptop screen

Hello folks,

I have a laptop with intel and Nvidia cards, running Manjaro with KDE and Windows in a dual boot setup. My aim is to connect my laptop with my external monitor using HDMI and extend displays, i.e use both monitor and laptop screen together. I’m able to do this in Windows, but in Manjaro, I can only see my external monitor or my laptop screen (See below for configurations I tried). What should I do to ensure both external monitor and laptop screen is active?

Below is information about my system when external monitor is active but laptop screen is switched off.

$ inxi -Gazy
Graphics:
  Device-1: Intel CoffeeLake-H GT2 [UHD Graphics 630]
    vendor: Acer Incorporated ALI driver: i915 v: kernel arch: Gen-9.5
    process: Intel 14nm built: 2016-20 ports: active: none off: eDP-1
    empty: none bus-ID: 00:02.0 chip-ID: 8086:3e9b class-ID: 0300
  Device-2: NVIDIA TU116M [GeForce GTX 1660 Ti Mobile]
    vendor: Acer Incorporated ALI driver: nvidia v: 550.107.02
    alternate: nouveau,nvidia_drm non-free: 550.xx+ status: current (as of
    2024-09; EOL~2026-12-xx) arch: Turing code: TUxxx process: TSMC 12nm FF
    built: 2018-2022 pcie: gen: 1 speed: 2.5 GT/s lanes: 16 link-max: gen: 3
    speed: 8 GT/s bus-ID: 01:00.0 chip-ID: 10de:2191 class-ID: 0300
  Display: x11 server: X.Org v: 21.1.13 with: Xwayland v: 24.1.2
    compositor: kwin_x11 driver: X: loaded: modesetting failed: nvidia dri: iris
    gpu: i915 display-ID: :0 screens: 1
  Screen-1: 0 s-res: 3440x1440 s-dpi: 94 s-size: 930x389mm (36.61x15.31")
    s-diag: 1008mm (39.69")
  Monitor-1: eDP-1 mapped: HDMI-0 note: disabled model: AU Optronics 0x82ed
    built: 2018 res: 3440x1440 dpi: 110 gamma: 1.2 size: 794x340mm (31.26x13.39")
    diag: 394mm (15.5") ratio: 16:9 modes: 1920x1080
  API: EGL v: 1.5 hw: drv: intel iris drv: nvidia platforms: device: 0
    drv: nvidia device: 1 drv: iris device: 2 drv: swrast gbm: drv: iris
    surfaceless: drv: nvidia x11: drv: nvidia inactive: wayland
  API: OpenGL v: 4.6.0 compat-v: 4.5 vendor: mesa v: 24.1.6-arch1.1
    glx-v: 1.4 direct-render: yes renderer: llvmpipe (LLVM 18.1.8 256 bits)
    device-ID: ffffffff:ffffffff memory: 15.12 GiB unified: yes
  API: Vulkan v: 1.3.279 layers: 1 device: 0 type: discrete-gpu name: NVIDIA
    GeForce GTX 1660 Ti driver: nvidia v: 550.107.02 device-ID: 10de:2191
    surfaces: xcb,xlib

$ mhwd -li

Installed PCI configs:
--------------------------------------------------------------------------------
                  NAME               VERSION          FREEDRIVER           TYPE
--------------------------------------------------------------------------------
video-hybrid-intel-nvidia-prime            2023.03.23               false            PCI
     video-modesetting            2020.01.13                true            PCI
$ mhwd-kernel -li                                                             
Currently running: 5.10.224-1-MANJARO (linux510)
The following kernels are installed in your system:
   * linux510
$ xrandr -q
Screen 0: minimum 8 x 8, current 3440 x 1440, maximum 32767 x 32767
DP-0 disconnected (normal left inverted right x axis y axis)
DP-1 disconnected (normal left inverted right x axis y axis)
HDMI-0 connected primary 3440x1440+0+0 (normal left inverted right x axis y axis) 794mm x 340mm
   3440x1440     59.97 +  99.98*   74.98
   3840x2160     59.94    50.00    29.97    25.00    23.98
   1920x1080    119.88   100.00    60.00    59.94    50.00    29.97    25.00    23.98
   1680x1050     59.95
   1440x900      59.89
   1280x1024     75.02    60.02
   1280x960      60.00
   1280x800      59.81
   1280x720      60.00    59.94    50.00
   1024x768      75.03    70.07    60.00
   800x600       75.00    72.19    60.32    56.25
   720x576       50.00
   720x480       59.94
   640x480       75.00    72.81    59.94    59.93
$ xrandr --listproviders
Providers: number : 2
Provider 0: id: 0x1b7 cap: 0x0 crtcs: 4 outputs: 3 associated providers: 0 name:NVIDIA-0
Provider 1: id: 0x207 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 3 outputs: 1 associated providers: 0 name:modesetting
$ xrandr --listmonitors
Monitors: 1
 0: +*HDMI-0 3440/794x1440/340+0+0  HDMI-0
$ cat /etc/X11/xorg.conf
# Automatically generated by EnvyControl

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"
EndSection

Section "Screen"
    Identifier "intel"
    Device "intel"
EndSection
$ envycontrol --query
nvidia

Things I tried:

Initially, I could not connect to the external monitor but my laptop screen was active, however I was using video-linux drivers installed through mhwd and driver was N/A in inxi output.
After looking through solutions, I ended up installing the closed source drivers and running nvidia-xconfig to generate the xorg.conf. After this I could connect to the external monitor but my laptop screen is now turned off. I also tried deleting the config, installing envycontrol and switching from hybrid to nvidia and generating the config again. However, the effect is same.
In this scenario, during boot and when HDMI is not connected, I have to use the tty to use my system. xrandr shows display not found in tty when HDMI is disconnected.

Once, I deleted the /etc/X11/xorg.conf and rebooted the system, this time, I could not connect to external monitor but my laptop screen was working fine. I then ran nvidia-xconfig again to generate the xorg.conf again and now monitor works but laptop screen is turned off.

I see modesetting failed: nvidia in your inixi output. For nvidia cards, I believe you need to set the kernel parameter nvidia-drm.modeset=1 But I’m not an expert here, so I would review nvidia configuration.

@Fangdrasil my modprobe configurations show that modeset parameter is set to 1 for nvidia-drm module. However, there are also files which have blacklist for nvidia-modeset
I do not know about these modules and therefore don’t know if these are conflicting options.

You can see all my modprobe files below

$ ls /etc/modprobe.d/
mhwd-bbswitch.conf  mhwd-gpu.conf  mhwd-nvidia.conf  nvidia.conf

$ cat /etc/modprobe.d/mhwd-bbswitch.conf
##
## Generated by mhwd - Manjaro Hardware Detection
##


options bbswitch load_state=0 unload_state=0
$ cat /etc/modprobe.d/mhwd-gpu.conf
##
## Generated by mhwd - Manjaro Hardware Detection
##

blacklist nouveau
blacklist ttm
blacklist drm_kms_helper
blacklist drm
$ cat /etc/modprobe.d/mhwd-nvidia.conf
##
## Generated by mhwd - Manjaro Hardware Detection
##


blacklist nouveau
blacklist nvidia
blacklist nvidia-modeset
blacklist nvidia-uvm
blacklist ttm
blacklist drm_kms_helper
blacklist drm

This is the file which contains the nvidia-drm.modeset parameter

$ cat /etc/modprobe.d/nvidia.conf
# Automatically generated by EnvyControl

options nvidia-drm modeset=1
options nvidia NVreg_UsePageAttributeTable=1 NVreg_InitializeSystemMemoryAllocations=0

Is “Y” shown as output when you type the following command: cat /sys/module/nvidia_drm/parameters/modeset ? I only mentioned taking a look at the nvidia configuration because of “modesetting failed”, but perhaps that is a red herring. If you don’t get “Y” as the output to the command I mentioned, then nvidia-drm is not set (edit: and maybe that is expected for your hybrid graphical setup, in which case hopefully there is someone on this forum who can point you in a better direction).

No, the parameter is not set at all. Not sure why.

$ cat /sys/module/nvidia_drm/parameters/modeset                        
cat: /sys/module/nvidia_drm/parameters/modeset: No such file or directory

If it is not set, shouldn’t it say ‘N’?