Dual monitor issues

Hello guys.

I’m back to linux last weekend and I’m having some weird problem to find out how to tell to the linux system wich one is my primary monitor.

During the boot setup, for some reason, my lightdm loads on the main monitor, but my mouse on the second one, wich is 90º twisted in the phisical support, it also loads in the wrong side of the main monitor.

My default configuration inside a GUI is my main monitor on the right, and the second in the left twisted in 90º, in boot screen, the second monitor load on the right and no 90º twist on it.

When the GUI it’s loaded, they go to the right place, but another situation occurs, because most of the applications load into the second monitor for the first time, in some exceptional cases like GDEVELOP, I have to create a windows rule to force the application to go to the main monitor.

This behavior occurs in other distros to (I’ve tryied some until I reach Manjaro) and with different GUI, I’m using Plasma for now, but I’ve tested on Gnome either.

Just have in mind that I’ve completely wipped the disks, so there is no broken configuration files on / or /home folders from other instals.

Ryzen 3600x with GeForce 1060 6GB with propietary drivers from Manaro repo, ASUS TUF X570
KDE / Gnome runing on X11

Tryed to force the composition pipeline in nvidia utils like a post suggests, but doens’t work and by some reason it’s disabled after reboot / shutdown, and obsviouly use the GUI control panel doesn’t affect the login screen configuration.

Tryied to switch the cables in the VGA HDMI phisical outputs.

Searching, I’ve seen some more experienced users asking for the output of the some files, here it is what I’ve found:

/ETC/X11/MHWD.D/NVIDIA.CONF

# nvidia-xconfig: X configuration file generated by nvidia-xconfig
# nvidia-xconfig:  version 515.48.07

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"
	Option "NoLogo" "1"
EndSection

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

Section "Extensions"
    Option         "COMPOSITE" "Enable"
EndSection


Section "InputClass"
    Identifier          "Keyboard Defaults"
    MatchIsKeyboard        "yes"
    Option              "XkbOptions" "terminate:ctrl_alt_bksp"
EndSection

/ETC/X11/XORG.CONF

# nvidia-settings: X configuration file generated by nvidia-settings
# nvidia-settings:  version 515.48.07

Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0" 0 0
    InputDevice    "Keyboard0" "CoreKeyboard"
    InputDevice    "Mouse0" "CorePointer"
    Option         "Xinerama" "0"
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"
    # HorizSync source: edid, VertRefresh source: edid
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "DELL UP2716D"
    HorizSync       30.0 - 88.0
    VertRefresh     50.0 - 75.0
    Option         "DPMS"
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "NVIDIA GeForce GTX 1060 6GB"
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    Option         "Stereo" "0"
    Option         "nvidiaXineramaInfoOrder" "DFP-1"
    Option         "metamodes" "HDMI-0: nvidia-auto-select +1440+560 {ForceCompositionPipeline=On}, HDMI-1: 2560x1440 +0+0 {rotation=right, ForceCompositionPipeline=On}"
    Option         "SLI" "Off"
    Option         "MultiGPU" "Off"
    Option         "BaseMosaic" "off"
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

And sorry for some misspelled or confusing explanation, english it’s not my default language.

provide output from:
inxi -Fazy
find /etc/X11/ -name "*.conf"
mhwd -l && mhwd -li

inxi -Fazy

System:
  Kernel: 5.15.49-1-MANJARO arch: x86_64 bits: 64 compiler: gcc v: 12.1.0
    parameters: BOOT_IMAGE=/boot/vmlinuz-5.15-x86_64
    root=UUID=668d3ffd-1619-4f8c-8024-7d78d46fae82 rw quiet apparmor=1
    security=apparmor udev.log_priority=3
  Desktop: KDE Plasma v: 5.24.5 tk: Qt v: 5.15.5 info: latte-dock
    wm: kwin_x11 vt: 7 dm: 1: GDM v: 42.0 note: stopped 2: LightDM v: 1.30.0
    Distro: Manjaro Linux base: Arch Linux
Machine:
  Type: Desktop Mobo: ASUSTeK model: TUF GAMING X570-PLUS v: Rev X.0x
    serial: <superuser required> UEFI: American Megatrends v: 2802
    date: 10/21/2020
CPU:
  Info: model: AMD Ryzen 5 3600X bits: 64 type: MT MCP arch: Zen 2 gen: 3
    built: 2020-22 process: TSMC n7 (7nm) family: 0x17 (23) model-id: 0x71 (113)
    stepping: 0 microcode: 0x8701021
  Topology: cpus: 1x cores: 6 tpc: 2 threads: 12 smt: enabled cache:
    L1: 384 KiB desc: d-6x32 KiB; i-6x32 KiB L2: 3 MiB desc: 6x512 KiB
    L3: 32 MiB desc: 2x16 MiB
  Speed (MHz): avg: 2449 high: 3593 min/max: 2200/4409 boost: enabled
    scaling: driver: acpi-cpufreq governor: schedutil cores: 1: 3574 2: 2177
    3: 2057 4: 2053 5: 2057 6: 2799 7: 2868 8: 2052 9: 2052 10: 2053 11: 2053
    12: 3593 bogomips: 91062
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm
  Vulnerabilities:
  Type: itlb_multihit status: Not affected
  Type: l1tf status: Not affected
  Type: mds status: Not affected
  Type: meltdown status: Not affected
  Type: mmio_stale_data status: Not affected
  Type: spec_store_bypass
    mitigation: Speculative Store Bypass disabled via prctl and seccomp
  Type: spectre_v1
    mitigation: usercopy/swapgs barriers and __user pointer sanitization
  Type: spectre_v2
    mitigation: Retpolines, IBPB: conditional, STIBP: conditional, RSB filling
  Type: srbds status: Not affected
  Type: tsx_async_abort status: Not affected
Graphics:
  Device-1: NVIDIA GP106 [GeForce GTX 1060 6GB]
    vendor: ASUSTeK DUAL-GTX1060-O6G driver: nvidia v: 515.48.07
    alternate: nouveau,nvidia_drm non-free: 515.xx+
    status: current (as of 2022-06) arch: Pascal process: TSMC 16nm
    built: 2016-21 pcie: gen: 3 speed: 8 GT/s lanes: 16 bus-ID: 0a:00.0
    chip-ID: 10de:1c03 class-ID: 0300
  Display: x11 server: X.Org v: 21.1.3 with: Xwayland v: 22.1.2
    compositor: kwin_x11 driver: X: loaded: nvidia gpu: nvidia display-ID: :0
    screens: 1
  Screen-1: 0 s-res: 4720x3840 s-dpi: 107 s-size: 1121x912mm (44.13x35.91")
    s-diag: 1445mm (56.89")
  Monitor-1: HDMI-0 pos: primary,bottom-r res: 2560x1440 hz: 60 dpi: 109
    size: 597x336mm (23.5x13.23") diag: 685mm (26.97") modes: N/A
  Monitor-2: HDMI-1 pos: primary,top-left res: 2160x3840 hz: 60 dpi: 161
    size: 340x600mm (13.39x23.62") diag: 690mm (27.15") modes: N/A
  OpenGL: renderer: NVIDIA GeForce GTX 1060 6GB/PCIe/SSE2
    v: 4.6.0 NVIDIA 515.48.07 direct render: Yes
Audio:
  Device-1: NVIDIA GP106 High Definition Audio
    vendor: ASUSTeK DUAL-GTX1060-O6G driver: snd_hda_intel bus-ID: 7-3:4
    v: kernel chip-ID: 0951:16df pcie: gen: 3 class-ID: 0300 serial: <filter>
    speed: 8 GT/s lanes: 16 bus-ID: 0a:00.1 chip-ID: 10de:10f1 class-ID: 0403
  Device-2: AMD Starship/Matisse HD Audio vendor: ASUSTeK
    driver: snd_hda_intel v: kernel pcie: gen: 4 speed: 16 GT/s lanes: 16
    bus-ID: 0c:00.4 chip-ID: 1022:1487 class-ID: 0403
  Device-3: Kingston HyperX QuadCast type: USB
    driver: hid-generic,snd-usb-audio,usbhid
  Device-4: Kingston HyperX Cloud Orbit 3D 8Ch type: USB
    driver: hid-generic,snd-usb-audio,usbhid bus-ID: 7-4:5 chip-ID: 0951:16fe
    class-ID: 0300 serial: <filter>
  Sound Server-1: ALSA v: k5.15.49-1-MANJARO running: yes
  Sound Server-2: JACK v: 1.9.21 running: no
  Sound Server-3: PulseAudio v: 16.1 running: yes
  Sound Server-4: PipeWire v: 0.3.52 running: yes
Network:
  Device-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet
    vendor: ASUSTeK driver: r8169 v: kernel pcie: gen: 1 speed: 2.5 GT/s
    lanes: 1 port: f000 bus-ID: 06:00.0 chip-ID: 10ec:8168 class-ID: 0200
  IF: enp6s0 state: up speed: 1000 Mbps duplex: full mac: <filter>
Bluetooth:
  Device-1: Realtek Bluetooth Radio type: USB driver: btusb v: 0.8
    bus-ID: 3-5:3 chip-ID: 0bda:8771 class-ID: e001 serial: <filter>
  Report: rfkill ID: hci0 rfk-id: 0 state: up address: see --recommends
Drives:
  Local Storage: total: 10.22 TiB used: 3.4 TiB (33.3%)
  SMART Message: Unable to run smartctl. Root privileges required.
  ID-1: /dev/nvme0n1 maj-min: 259:2 vendor: Samsung
    model: SSD 970 EVO Plus 250GB size: 232.89 GiB block-size: physical: 512 B
    logical: 512 B speed: 31.6 Gb/s lanes: 4 type: SSD serial: <filter>
    rev: 2B2QEXM7 temp: 44.9 C scheme: GPT
  ID-2: /dev/nvme1n1 maj-min: 259:0 vendor: Western Digital
    model: WDS500G3X0C-00SJG0 size: 465.76 GiB block-size: physical: 512 B
    logical: 512 B speed: 31.6 Gb/s lanes: 4 type: SSD serial: <filter>
    rev: 111110WD temp: 47.9 C scheme: GPT
  ID-3: /dev/sda maj-min: 8:0 vendor: PNY model: CS900 480GB SSD
    size: 447.13 GiB block-size: physical: 512 B logical: 512 B speed: 6.0 Gb/s
    type: SSD serial: <filter> rev: 0BB3 scheme: GPT
  ID-4: /dev/sdb maj-min: 8:16 vendor: Western Digital
    model: WD20EZAZ-00GGJB0 size: 1.82 TiB block-size: physical: 4096 B
    logical: 512 B speed: 6.0 Gb/s type: HDD rpm: 5400 serial: <filter>
    rev: 0A80 scheme: GPT
  ID-5: /dev/sdc maj-min: 8:32 vendor: Western Digital
    model: WD40PURZ-85TTDY0 size: 3.64 TiB block-size: physical: 4096 B
    logical: 512 B speed: 6.0 Gb/s type: HDD rpm: 5400 serial: <filter>
    rev: 0A80 scheme: GPT
  ID-6: /dev/sdd maj-min: 8:48 vendor: Western Digital
    model: WD40PURZ-85TTDY0 size: 3.64 TiB block-size: physical: 4096 B
    logical: 512 B speed: 6.0 Gb/s type: HDD rpm: 5400 serial: <filter>
    rev: 0A80 scheme: GPT
Partition:
  ID-1: / raw-size: 232.38 GiB size: 227.68 GiB (97.97%)
    used: 84.62 GiB (37.2%) fs: ext4 dev: /dev/nvme0n1p1 maj-min: 259:3
  ID-2: /boot/efi raw-size: 512 MiB size: 511 MiB (99.80%)
    used: 312 KiB (0.1%) fs: vfat dev: /dev/nvme0n1p2 maj-min: 259:4
  ID-3: /home raw-size: 465.76 GiB size: 457.38 GiB (98.20%)
    used: 208.4 GiB (45.6%) fs: ext4 dev: /dev/nvme1n1p1 maj-min: 259:1
Swap:
  Kernel: swappiness: 60 (default) cache-pressure: 100 (default)
  ID-1: swap-1 type: file size: 60 GiB used: 0 KiB (0.0%) priority: -2
    file: /swapfile
Sensors:
  System Temperatures: cpu: N/A mobo: N/A gpu: nvidia temp: 54 C
  Fan Speeds (RPM): N/A gpu: nvidia fan: 27%
Info:
  Processes: 312 Uptime: 7m wakeups: 0 Memory: 31.26 GiB used: 2.89 GiB (9.3%)
  Init: systemd v: 251 default: graphical tool: systemctl Compilers:
  gcc: 12.1.0 clang: 13.0.1 Packages: 1541 pacman: 1536 lib: 383 flatpak: 5
  Shell: Bash v: 5.1.16 running-in: konsole inxi: 3.3.19

find /etc/X11 -name “*.conf”

/etc/X11/xorg.conf.d/90-mhwd.conf
/etc/X11/xorg.conf.d/00-keyboard.conf
/etc/X11/xorg.conf.d/30-touchpad.conf
/etc/X11/mhwd.d/nvidia.conf
/etc/X11/xorg.conf

mhwd -l && mhwd -li

> 0000:0a:00.0 (0300:10de:1c03) Display controller nVidia Corporation:
--------------------------------------------------------------------------------
                  NAME               VERSION          FREEDRIVER           TYPE
--------------------------------------------------------------------------------
          video-nvidia            2021.12.18               false            PCI
    video-nvidia-470xx            2021.12.18               false            PCI
    video-nvidia-390xx            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:06:00.0 (0200:10ec:8168) Network controller Realtek Semiconductor Co., Ltd.:
--------------------------------------------------------------------------------
                  NAME               VERSION          FREEDRIVER           TYPE
--------------------------------------------------------------------------------
         network-r8168            2016.04.20                true            PCI


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


Warning: No installed USB configs!

why do you have this file there:

/etc/X11/xorg.conf

did you created it for some reason?

It was a mistake, I’ve forget to explain in the main post that I’ve tryied to use nvidia utils to try to “override” any previous settings of any other files, so I’ve used the “save to x configuration file” in the utils GUI.

Some random post comment about this file, but the problem was older than the file in there.

so remove it:
sudo rm /etc/X11/xorg.conf
reboot
rearange your monitors, then go to system settings/compositor, and uncheck enable on startup, click apply, reboot again and see if this helped

Still the same, the video configuration is loaded on GUI but not outside of it. Even on loggof the configuration is lost.

so disabling compositor didnt help? if not enable it again in system settings

Already done, also and rebooted after it. Any other suggestion is welcome.

There is a way to set a “workaround” like “force the mouse” to be in monitor 0 instead of 1?

no i dont, but its interesting, that the same issue happens also on other distros/desktops… lets summon @bogdancovaciu for help…

1 Like

TYVM for your help until now.

This is wrong, mixing auto with fixed in the layout … also the presence the xorg.conf file is no go on manjaro as we use MHWD.
Regarding the rotation, i do not recommend doing it from xorg, so that line rotation=right is also off.
Also, according to this

in comparison with the config, the ports seem to be inverted … making this quite confusing.
Another thing.

What is doing GDM and LightDM on KDE Plasma install?
My proposal, use a simple fixed config, and rotate the screen via randr once the mapping of the layout and the connection ports is done correct and the config matches the hardware …
Chapter 15. Support for the X Resize and Rotate Extension

Here is a basic config, side by side. Tweak it accordingly … You can also redefine it via Nvidia Server Settings, but only copy the missing info once you tweak it. Do not create new file, but keep a backup.

Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0" 0 0
    InputDevice    "Keyboard0" "CoreKeyboard"
    InputDevice    "Mouse0" "CorePointer"
    Option         "Xinerama" "0"
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     "DELL"
    ModelName      "DELL UP2716D"
    HorizSync       30.0 - 88.0
    VertRefresh     50.0 - 75.0
    Option         "DPMS"
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "NVIDIA GeForce GTX 1060 6GB"
    Option  "ConnectToAcpid"    "Off"
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    Option         "Stereo" "0"
    Option         "nvidiaXineramaInfoOrder" "DFP-0"
    Option         "metamodes" "HDMI-0: 2560x1440_60 +0+0 {ForceCompositionPipeline=On}, HDMI-1: 2160x3840_60 +1920+0 {ForceCompositionPipeline=On}"
    Option         "SLI" "Off"
    Option         "MultiGPU" "Off"
    Option         "BaseMosaic" "off"
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

Section "Extensions"
    Option         "COMPOSITE" "Enable"
EndSection


Section "InputClass"
    Identifier          "Keyboard Defaults"
    MatchIsKeyboard        "yes"
    Option              "XkbOptions" "terminate:ctrl_alt_bksp"
EndSection

Once you modify it, run this command from terminal:

sudo mhwd-gpu --setmod nvidia --setxorg /etc/X11/mhwd.d/nvidia.conf

I’ve installed plasma just to try it out, since I’ve moved back to Linux after 4 years of mmo under Windows and the customize capabilities are really great, but I got some weird issues, like missing desktop background picture on boot, only in primary monitor by some reason and weird performance whilhe oppening some Plasma apps, so I’ve installed Gnome to see if the wallpaper problem was only with Plasma or a more deep system issue. LightDM is there because I like more of the WebKit themes, so I’ve replaced SDDM with LightDM. GMD it’s a non invited guest.

But I’ve reinstaled Manjaro with Gnome desktop this time, not my favourite desktop flavor, but it’s work fine and no desktop background issue.

I copied the “missing content” to my file under /etc/X11/mhwd.d/nvidia.conf
I’ve saved the file and runed the mhwd-gpu command and nothings different, monitors still messed up.

Do you mean the cables on the video card ow what? I really don’t get it.

The randr (1.6 installed) command should be something like this?:

  nvidia-settings --assign CurrentMetaMode="
  
    #DELL MONITOR, the 1440+560 it's my assumption that  is the XY axis position, I've taken this value from nvidia-settings
  	HDMI=0: 2560x1440 +1440+560, \ { Rotation=none }, 
  	
  	#LG MONITOR, this the 90º twisted, I reduce the resolution due to some performance lack on 3D apps.
  	HDMI=1: 1440X2560 +0+0 { Rotation=right }"

Just type in terminal or include in a file?

After the gnome fresh install, my login screen is the 90º monitor, a GDM customized “side-login”.

EDIT: I’ve upgraded the kernel to 5.18.6-1, decided to do so, while I’m trying to install VMware Workstation and got some problems with vmmon, linux-headers and a github file that fix all this. No changes at the desktop issues.

I don’t know what happen, but after gave up on Gnome, and with the commands and things done above, the problem was gone when I switched back to Plasma. Now my boot screen is in the right monitor.

TY all for the help.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.