HDMI+DP monitors

Hello, I need to configure 1 HDMI and 1 DP external monitors for my laptop Dell G5 5590.
After reading the forum I have managed to see the background on both monitors.
I have done this with optimus-manager --switch nvidia
But now:

  1. I can’t move the mouse to the second monitor
  2. I can’t see the menu bar on the bottom of the first monitor

The following is my configuration:

#inxi -Gazy

Graphics:
  Device-1: Intel CoffeeLake-H GT2 [UHD Graphics 630] vendor: Dell
    driver: i915 v: kernel ports: active: DP-1 empty: DP-2,HDMI-A-1,HDMI-A-2
    bus-ID: 00:02.0 chip-ID: 8086:3e9b class-ID: 0380
  Device-2: NVIDIA TU106BM [GeForce RTX 2070 Mobile / Max-Q] vendor: Dell
    driver: nvidia v: 510.68.02 alternate: nouveau,nvidia_drm non-free: 515.xx+
    status: current (as of 2022-05) arch: Turing pcie: gen: 3 speed: 8 GT/s
    lanes: 8 link-max: lanes: 16 ports: active: none off: HDMI-A-3,eDP-1
    empty: DP-3 bus-ID: 01:00.0 chip-ID: 10de:1f50 class-ID: 0300
  Device-3: Microdia Integrated_Webcam_HD type: USB driver: uvcvideo
    bus-ID: 1-5:3 chip-ID: 0c45:671f class-ID: 0e02
  Display: x11 server: X.Org v: 21.1.3 compositor: xfwm v: 4.16.1 driver: X:
    loaded: modesetting,nvidia gpu: i915,nvidia,nvidia-nvswitch display-ID: :0.0
    screens: 1
  Screen-1: 0 s-res: 4480x2886 s-dpi: 96 s-size: 1185x764mm (46.65x30.08")
    s-diag: 1410mm (55.51")
  Monitor-1: DP-1 mapped: DP-0 pos: primary,bottom-l
    model: Philips PHL 275E2F serial: <filter> built: 2022 res: 1920x1080
    hz: 144 dpi: 142 gamma: 1.2 size: 344x194mm (13.54x7.64")
    diag: 685mm (27") ratio: 16:9 modes: max: 2560x1440 min: 720x400
  Monitor-2: not-matched mapped: DP-1-1 pos: primary,top-left res: 2560x1440
    hz: 60 dpi: 109 size: 597x336mm (23.5x13.23") diag: 685mm (26.97")
    modes: N/A
  Monitor-3: not-matched mapped: HDMI-0 pos: middle-r res: 2560x1440 hz: 60
    dpi: 109 size: 597x336mm (23.5x13.23") diag: 685mm (26.97") modes: N/A
  OpenGL: renderer: NVIDIA GeForce RTX 2070 with Max-Q Design/PCIe/SSE2
    v: 4.6.0 NVIDIA 510.68.02 direct render: Yes

mhwd -li

> Installed PCI configs:
--------------------------------------------------------------------------------
                  NAME               VERSION          FREEDRIVER           TYPE
--------------------------------------------------------------------------------
          video-nvidia            2021.12.18               false            PCI
           video-linux            2018.05.04                true            PCI


Warning: No installed USB configs!

$ optimus-manager --status
Optimus Manager (Client) version 1.4

Current GPU mode : nvidia 
GPU mode requested for next login : no change
GPU at startup : nvidia
Temporary config path: no

post output from:
inxi -Fazy
mhwd -l

Might consider this Dell G5 5590-9340 - ArchWiki

$ inxi -Fazy
System:
  Kernel: 5.17.6-1-MANJARO arch: x86_64 bits: 64 compiler: gcc v: 11.2.0
    parameters: BOOT_IMAGE=/boot/vmlinuz-5.17-x86_64
    root=UUID=690cde85-547f-4e22-9b48-1c90b2ae589c rw quiet apparmor=1
    security=apparmor udev.log_priority=3
  Desktop: Xfce v: 4.16.0 tk: Gtk v: 3.24.29 info: xfce4-panel wm: xfwm
    v: 4.16.1 vt: 7 dm: LightDM v: 1.30.0 Distro: Manjaro Linux base: Arch Linux
Machine:
  Type: Laptop System: Dell product: G5 5590 v: N/A
    serial: <superuser required> Chassis: type: 10 serial: <superuser required>
  Mobo: Dell model: 0D2DM3 v: A00 serial: <superuser required> UEFI: Dell
    v: 1.15.3 date: 06/04/2021
Battery:
  ID-1: BAT0 charge: 56.9 Wh (100.0%) condition: 56.9/90.0 Wh (63.3%)
    volts: 12.6 min: 11.4 model: BYD DELL 6YV0V94 type: Li-poly serial: <filter>
    status: full
CPU:
  Info: model: Intel Core i7-9750H bits: 64 type: MT MCP arch: Coffee Lake
    family: 6 model-id: 0x9E (158) stepping: 0xA (10) microcode: 0xEC
  Topology: cpus: 1x cores: 6 tpc: 2 threads: 12 smt: enabled cache:
    L1: 384 KiB desc: d-6x32 KiB; i-6x32 KiB L2: 1.5 MiB desc: 6x256 KiB
    L3: 12 MiB desc: 1x12 MiB
  Speed (MHz): avg: 799 high: 800 min/max: 800/4500 scaling:
    driver: intel_pstate governor: powersave cores: 1: 800 2: 800 3: 800 4: 800
    5: 800 6: 800 7: 800 8: 800 9: 799 10: 800 11: 800 12: 800 bogomips: 62431
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx
  Vulnerabilities:
  Type: itlb_multihit status: KVM: VMX disabled
  Type: l1tf
    mitigation: PTE Inversion; VMX: conditional cache flushes, SMT vulnerable
  Type: mds mitigation: Clear CPU buffers; SMT vulnerable
  Type: meltdown mitigation: PTI
  Type: spec_store_bypass
    mitigation: Speculative Store Bypass disabled via prctl
  Type: spectre_v1
    mitigation: usercopy/swapgs barriers and __user pointer sanitization
  Type: spectre_v2 mitigation: Retpolines, IBPB: conditional, IBRS_FW,
    STIBP: conditional, RSB filling
  Type: srbds mitigation: Microcode
  Type: tsx_async_abort status: Not affected
Graphics:
  Device-1: Intel CoffeeLake-H GT2 [UHD Graphics 630] vendor: Dell
    driver: i915 v: kernel ports: active: DP-1 empty: DP-2,HDMI-A-1,HDMI-A-2
    bus-ID: 00:02.0 chip-ID: 8086:3e9b class-ID: 0380
  Device-2: NVIDIA TU106BM [GeForce RTX 2070 Mobile / Max-Q] vendor: Dell
    driver: nvidia v: 510.68.02 alternate: nouveau,nvidia_drm non-free: 515.xx+
    status: current (as of 2022-05) arch: Turing pcie: gen: 3 speed: 8 GT/s
    lanes: 8 link-max: lanes: 16 ports: active: none off: HDMI-A-3,eDP-1
    empty: DP-3 bus-ID: 01:00.0 chip-ID: 10de:1f50 class-ID: 0300
  Device-3: Microdia Integrated_Webcam_HD type: USB driver: uvcvideo
    bus-ID: 1-5:3 chip-ID: 0c45:671f class-ID: 0e02
  Display: x11 server: X.Org v: 21.1.3 compositors: 1: xfwm v: 4.16.1
    2: marco driver: X: loaded: modesetting,nvidia
    gpu: i915,nvidia,nvidia-nvswitch display-ID: :0.0 screens: 1
  Screen-1: 0 s-res: 4480x2886 s-dpi: 96 s-size: 1185x764mm (46.65x30.08")
    s-diag: 1410mm (55.51")
  Monitor-1: DP-1 mapped: DP-0 pos: primary,bottom-l
    model: Philips PHL 275E2F serial: <filter> built: 2022 res: 1920x1080
    hz: 144 dpi: 142 gamma: 1.2 size: 344x194mm (13.54x7.64")
    diag: 685mm (27") ratio: 16:9 modes: max: 2560x1440 min: 720x400
  Monitor-2: not-matched mapped: DP-1-1 pos: primary,top-left res: 2560x1440
    hz: 60 dpi: 109 size: 597x336mm (23.5x13.23") diag: 685mm (26.97")
    modes: N/A
  Monitor-3: not-matched mapped: HDMI-0 pos: middle-r res: 2560x1440 hz: 60
    dpi: 109 size: 597x336mm (23.5x13.23") diag: 685mm (26.97") modes: N/A
  OpenGL: renderer: NVIDIA GeForce RTX 2070 with Max-Q Design/PCIe/SSE2
    v: 4.6.0 NVIDIA 510.68.02 direct render: Yes
Audio:
  Device-1: Intel Cannon Lake PCH cAVS vendor: Dell driver: snd_hda_intel
    v: kernel alternate: snd_soc_skl,snd_sof_pci_intel_cnl bus-ID: 00:1f.3
    chip-ID: 8086:a348 class-ID: 0403
  Device-2: NVIDIA TU106 High Definition Audio vendor: Dell
    driver: snd_hda_intel v: kernel pcie: gen: 3 speed: 8 GT/s lanes: 8
    link-max: lanes: 16 bus-ID: 01:00.1 chip-ID: 10de:10f9 class-ID: 0403
  Device-3: GN Netcom Jabra EVOLVE Link MS type: USB
    driver: jabra,snd-usb-audio,usbhid bus-ID: 1-1.3:6 chip-ID: 0b0e:0305
    class-ID: 0300 serial: <filter>
  Sound Server-1: ALSA v: k5.17.6-1-MANJARO running: yes
  Sound Server-2: JACK v: 1.9.21 running: no
  Sound Server-3: PulseAudio v: 15.0 running: yes
  Sound Server-4: PipeWire v: 0.3.51 running: yes
Network:
  Device-1: Intel Cannon Lake PCH CNVi WiFi driver: iwlwifi v: kernel
    bus-ID: 00:14.3 chip-ID: 8086:a370 class-ID: 0280
  IF: wlo1 state: up mac: <filter>
  Device-2: Realtek vendor: Dell driver: r8169 v: kernel pcie: gen: 1
    speed: 2.5 GT/s lanes: 1 port: 3000 bus-ID: 3c:00.0 chip-ID: 10ec:2502
    class-ID: 0200
  IF: enp60s0 state: up speed: 1000 Mbps duplex: full mac: <filter>
  IF-ID-1: br-126317442d71 state: down mac: <filter>
  IF-ID-2: br-39ac8ac239cb state: down mac: <filter>
  IF-ID-3: br-40ad09582709 state: down mac: <filter>
  IF-ID-4: br-5d6f228d3eab state: up speed: 10000 Mbps duplex: unknown
    mac: <filter>
  IF-ID-5: br-94f83a267e39 state: down mac: <filter>
  IF-ID-6: br-b3ac9654bb4b state: down mac: <filter>
  IF-ID-7: br0 state: up speed: 1000 Mbps duplex: unknown mac: <filter>
  IF-ID-8: docker0 state: down mac: <filter>
  IF-ID-9: veth4a2e2d8 state: up speed: 10000 Mbps duplex: full
    mac: <filter>
  IF-ID-10: virbr0 state: down mac: <filter>
Bluetooth:
  Device-1: Intel Bluetooth 9460/9560 Jefferson Peak (JfP) type: USB
    driver: btusb v: 0.8 bus-ID: 1-14:7 chip-ID: 8087:0aaa class-ID: e001
  Report: rfkill ID: hci0 rfk-id: 1 state: up address: see --recommends
Drives:
  Local Storage: total: 1.88 TiB used: 435.69 GiB (22.7%)
  SMART Message: Required tool smartctl not installed. Check --recommends
  ID-1: /dev/nvme0n1 maj-min: 259:0 vendor: Samsung model: SSD 980 PRO 2TB
    size: 1.82 TiB block-size: physical: 512 B logical: 512 B speed: 63.2 Gb/s
    lanes: 4 type: SSD serial: <filter> rev: 3B2QGXA7 temp: 49.9 C scheme: GPT
  ID-2: /dev/sda maj-min: 8:0 type: USB vendor: SanDisk model: Ultra
    size: 57.91 GiB block-size: physical: 512 B logical: 512 B type: N/A
    serial: <filter> rev: 1.00 scheme: MBR
Partition:
  ID-1: / raw-size: 1.44 TiB size: 1.42 TiB (98.36%) used: 435.61 GiB (30.1%)
    fs: ext4 dev: /dev/nvme0n1p8 maj-min: 259:8
  ID-2: /boot/efi raw-size: 650 MiB size: 646 MiB (99.38%)
    used: 76.1 MiB (11.8%) fs: vfat dev: /dev/nvme0n1p1 maj-min: 259:1
Swap:
  Kernel: swappiness: 60 (default) cache-pressure: 100 (default)
  ID-1: swap-1 type: partition size: 16.76 GiB used: 0 KiB (0.0%)
    priority: -2 dev: /dev/nvme0n1p7 maj-min: 259:7
Sensors:
  System Temperatures: cpu: 62.0 C pch: 73.0 C mobo: N/A gpu: nvidia
    temp: 64 C
  Fan Speeds (RPM): N/A
Info:
  Processes: 368 Uptime: 0m wakeups: 3 Memory: 15.44 GiB
  used: 2.77 GiB (17.9%) Init: systemd v: 250 tool: systemctl Compilers:
  gcc: 11.2.0 alt: 10 clang: 13.0.1 Packages: pacman: 1747 lib: 453 flatpak: 0
  Shell: Bash v: 5.1.16 running-in: xfce4-terminal inxi: 3.3.16



$ mhwd -l
> 0000:01:00.0 (0300:10de:1f50) Display controller nVidia Corporation:
--------------------------------------------------------------------------------
                  NAME               VERSION          FREEDRIVER           TYPE
--------------------------------------------------------------------------------
          video-nvidia            2021.12.18               false            PCI
    video-nvidia-470xx            2021.12.18               false            PCI
           video-linux            2018.05.04                true            PCI
     video-modesetting            2020.01.13                true            PCI
            video-vesa            2017.03.12                true            PCI


> 0000:00:02.0 (0380:8086:3e9b) Display controller Intel Corporation:
--------------------------------------------------------------------------------
                  NAME               VERSION          FREEDRIVER           TYPE
--------------------------------------------------------------------------------
           video-linux            2018.05.04                true            PCI

What do you think @brahma ?

Thanks @bogdancovaciu , before I having this issue I had one external HDMI 27 inches monitor.
I did not have any issue.
Now I have two 27 inches external monitors, one connected to HDMI and the other one connected to the DP port.
The documentation is good but it does not mention configuration with two monitors.

you can create the file in x11 as is mentioned in the bogdans link:
sudo nano /etc/X11/xorg.conf.d/10-nvidia-drm-outputclass.conf
put inside it this:

Section "OutputClass"
    Identifier "nvidia"
    MatchDriver "nvidia-drm"
    Driver "nvidia"
    Option "AllowEmptyInitialConfiguration"
    Option "PrimaryGPU" "yes"
    ModulePath "/usr/lib/nvidia/xorg"
    ModulePath "/usr/lib/xorg/modules"
EndSection

save the file with ctrl+x
run this command: sudo mkinitcpio -P
then reboot and check if it helped

Done.
I am getting:

[FAILED] Failed to start Light Display Manager

so you stuck at black screen?

Sorry my bad, there was a typo in .conf file. Now it boots but it does not solve the problem.

so remove the file with:
sudo rm /etc/X11/xorg.conf.d/10-nvidia-drm-outputclass.conf
run again: sudo mkinitcpio -P

post also output from:
xrandr -q

ok!

$ xrandr -q
Screen 0: minimum 8 x 8, current 4480 x 2886, maximum 32767 x 32767
HDMI-0 connected 2560x1440+1920+1440 (normal left inverted right x axis y axis) 597mm x 336mm
   2560x1440     59.95*+
   1920x1080     60.00    59.94    50.00  
   1680x1050     59.95  
   1440x900      59.89  
   1280x1440     59.91  
   1280x1024     75.02    60.02  
   1280x960      60.00  
   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  
DP-0 connected primary 1920x1080+0+1806 (normal left inverted right x axis y axis) 344mm x 194mm
   1920x1080    144.00*+
DP-1 disconnected (normal left inverted right x axis y axis)
DP-2 disconnected (normal left inverted right x axis y axis)
DP-1-1 connected 2560x1440+0+0 (normal left inverted right x axis y axis) 597mm x 336mm
   2560x1440     59.95*+  74.97  
   1920x1080     74.97    60.00    50.00    59.94  
   1920x1080i    60.00    50.00    59.94  
   1280x1440     59.91  
   1680x1050     59.95  
   1280x1024     75.02    60.02  
   1440x900      59.89  
   1280x960      60.00  
   1280x720      60.00    50.00    59.94  
   1024x768      75.03    70.07    60.00  
   832x624       74.55  
   800x600       72.19    75.00    60.32    56.25  
   720x576       50.00  
   720x480       60.00    59.94  
   640x480       75.00    72.81    66.67    60.00    59.94  
   720x400       70.08  
HDMI-1-1 disconnected (normal left inverted right x axis y axis)
DP-1-2 disconnected (normal left inverted right x axis y axis)
HDMI-1-2 disconnected (normal left inverted right x axis y axis)
  2560x1440 (0x1bd) 241.500MHz +HSync +VSync
        h: width  2560 start 2608 end 2640 total 2720 skew    0 clock  88.79KHz
        v: height 1440 start 1443 end 1448 total 1481           clock  59.95Hz
  1920x1080 (0x1be) 148.500MHz +HSync +VSync
        h: width  1920 start 2008 end 2052 total 2200 skew    0 clock  67.50KHz
        v: height 1080 start 1084 end 1089 total 1125           clock  60.00Hz
  1920x1080 (0x1c0) 148.500MHz +HSync +VSync
        h: width  1920 start 2448 end 2492 total 2640 skew    0 clock  56.25KHz
        v: height 1080 start 1084 end 1089 total 1125           clock  50.00Hz
  1280x1440 (0x1c3) 156.000MHz -HSync +VSync
        h: width  1280 start 1376 end 1512 total 1744 skew    0 clock  89.45KHz
        v: height 1440 start 1443 end 1453 total 1493           clock  59.91Hz
  1680x1050 (0x1c1) 146.250MHz -HSync +VSync
        h: width  1680 start 1784 end 1960 total 2240 skew    0 clock  65.29KHz
        v: height 1050 start 1053 end 1059 total 1089           clock  59.95Hz
  1280x1024 (0x1c4) 135.000MHz +HSync +VSync
        h: width  1280 start 1296 end 1440 total 1688 skew    0 clock  79.98KHz
        v: height 1024 start 1025 end 1028 total 1066           clock  75.02Hz
  1280x1024 (0x1c5) 108.000MHz +HSync +VSync
        h: width  1280 start 1328 end 1440 total 1688 skew    0 clock  63.98KHz
        v: height 1024 start 1025 end 1028 total 1066           clock  60.02Hz
  1440x900 (0x1c2) 106.500MHz -HSync +VSync
        h: width  1440 start 1520 end 1672 total 1904 skew    0 clock  55.93KHz
        v: height  900 start  903 end  909 total  934           clock  59.89Hz
  1280x960 (0x1c6) 108.000MHz +HSync +VSync
        h: width  1280 start 1376 end 1488 total 1800 skew    0 clock  60.00KHz
        v: height  960 start  961 end  964 total 1000           clock  60.00Hz
  1280x720 (0x1c7) 74.250MHz +HSync +VSync
        h: width  1280 start 1390 end 1430 total 1650 skew    0 clock  45.00KHz
        v: height  720 start  725 end  730 total  750           clock  60.00Hz
  1280x720 (0x1c9) 74.250MHz +HSync +VSync
        h: width  1280 start 1720 end 1760 total 1980 skew    0 clock  37.50KHz
        v: height  720 start  725 end  730 total  750           clock  50.00Hz
  1024x768 (0x1ca) 78.750MHz +HSync +VSync
        h: width  1024 start 1040 end 1136 total 1312 skew    0 clock  60.02KHz
        v: height  768 start  769 end  772 total  800           clock  75.03Hz
  1024x768 (0x1cb) 75.000MHz -HSync -VSync
        h: width  1024 start 1048 end 1184 total 1328 skew    0 clock  56.48KHz
        v: height  768 start  771 end  777 total  806           clock  70.07Hz
  1024x768 (0x1cc) 65.000MHz -HSync -VSync
        h: width  1024 start 1048 end 1184 total 1344 skew    0 clock  48.36KHz
        v: height  768 start  771 end  777 total  806           clock  60.00Hz
  800x600 (0x1ce) 50.000MHz +HSync +VSync
        h: width   800 start  856 end  976 total 1040 skew    0 clock  48.08KHz
        v: height  600 start  637 end  643 total  666           clock  72.19Hz
  800x600 (0x1cd) 49.500MHz +HSync +VSync
        h: width   800 start  816 end  896 total 1056 skew    0 clock  46.88KHz
        v: height  600 start  601 end  604 total  625           clock  75.00Hz
  800x600 (0x1cf) 40.000MHz +HSync +VSync
        h: width   800 start  840 end  968 total 1056 skew    0 clock  37.88KHz
        v: height  600 start  601 end  605 total  628           clock  60.32Hz
  800x600 (0x1d0) 36.000MHz +HSync +VSync
        h: width   800 start  824 end  896 total 1024 skew    0 clock  35.16KHz
        v: height  600 start  601 end  603 total  625           clock  56.25Hz
  720x576 (0x1d1) 27.000MHz -HSync -VSync
        h: width   720 start  732 end  796 total  864 skew    0 clock  31.25KHz
        v: height  576 start  581 end  586 total  625           clock  50.00Hz
  720x480 (0x1d2) 27.000MHz -HSync -VSync
        h: width   720 start  736 end  798 total  858 skew    0 clock  31.47KHz
        v: height  480 start  489 end  495 total  525           clock  59.94Hz
  640x480 (0x1d3) 31.500MHz -HSync -VSync
        h: width   640 start  656 end  720 total  840 skew    0 clock  37.50KHz
        v: height  480 start  481 end  484 total  500           clock  75.00Hz
  640x480 (0x1d5) 25.175MHz -HSync -VSync
        h: width   640 start  656 end  752 total  800 skew    0 clock  31.47KHz
        v: height  480 start  490 end  492 total  525           clock  59.94Hz

Now I can only work on DP-1-1 and I can see HDMI-0. I do not use DP-0 because the lid of my laptop is closed.

and in system settings/ display and monitor, are there some options to set up your screens as you desire?

Yes I can choose resolution, scale, rotation, etc.
But the problem are still:

  1. The mouse does not move to the second monitor. So I can use only the first.
  2. I can’t see the LDM menu bar that normally it is on the bottom of the screen

check this link, maybe it will be helpfull

OK! I just needed to arrange the monitor one beside the other and now it is working.
The issue is fixed. Thank you very much!