KDE, GNOME - OS won't recognize when HDMI is unplugged

Hello Guys,

I have notebook Dell G5 with hybrid intell + nvidia RTX 2060 GPU and I’m unsing the build-in display coupled with external monitor connected over HDMI. Recently the OS stopped recognizing when I unplug the external monitor. Is there a way to force re-detection of displays? The only way of turning off that external monitor I found is to open the Display Configuration tool and untick the “enable” which is quite a hassle.

I’ve tried:
xrandr --auto
xrandr --output eDP-1 --mode 1920x1080
but none of it works.

The output of inxi -G is:

Graphics:  Device-1: Intel UHD Graphics 630 driver: i915 v: kernel 
            Device-2: NVIDIA TU106M [GeForce RTX 2060 Mobile] driver: nvidia v: 460.56 
            Device-3: Realtek Integrated_Webcam_HD type: USB driver: uvcvideo 
            Display: x11 server: X.Org 1.20.10 driver: loaded: modesetting,nvidia unloaded: intel,nouveau 
            1: 1920x1080~144Hz 2: 1920x1080 
            OpenGL: renderer: Mesa Intel UHD Graphics 630 (CFL GT2) v: 4.6 Mesa 20.3.4 

The output to mhwd -li --pci is:

 Installed PCI configs:

NAME               VERSION          FREEDRIVER           TYPE

video-linux            2018.05.04                true            PCI
video-hybrid-intel-nvidia-prime            2020.11.30               false            PCI
video-modesetting            2020.01.13                true            PCI

The output to: nvidia-smi is:

Thu Mar 11 23:25:20 2021       
 +-----------------------------------------------------------------------------+
 | NVIDIA-SMI 460.56       Driver Version: 460.56       CUDA Version: 11.2     |

FYI: tried fresh installation of manjaro-gnome, updated to latest packages and have the same problem, so this looks like some kind of bug with the drivers.

  1. In the future, when providing code/output, please copy-paste that output in-between 3 backticks ``` at the beginning and end of the code/text so that the output looks like this:

    Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
    Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
    Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
    Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
    

    instead of like this:

    Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.`

    (as that makes both our lives much easier)

  2. No need to do anything right now as I’m an editor here on this site and have fixed it for you already. However, in the future I might not see your post so review my edits by pushing the orange pencil above the post I just fixed. :wink:

  3. xset is your friend.

    xset dpms force off
    

    and that will turn off all monitors.

    When you click the mouse, only the connected one comes back.

:+1:

1 & 2. Noted.
3. Thanks for the tip, but it does nothing. I mean, it turns off the monitor and on click it turns back on, but the system still thinks the external display is connected.

As I’ve written in my previous post. I’ve to install fresh manjaro (manjaro-gnome-20.2.1-210103-linux59.iso) on new partition. And until I’ve updated the OS it seemed to work fine. Then after updating the OS, the same problem reappeared. Given that it happens on KDE as well as on Gnome, I’d say there’s some problem in either nvidia hybrid drivers or the X server - I’m no expert these areas unfortunately.

Is it possible to downgrade the Nvidia drivers perhaps?

1 Like

Full inxi --admin --verbosity=7 --filter --no-host --width, please?

P.S. :yawning_face: Going to :bed: :zzz: now, unfortunately…

No problem :slight_smile: I went to bed after sending my reply too :slight_smile:

Many thanks for the advice with the xset dpms force off. I’ve played with the it some more and it eventually works. By eventually I mean sometimes, when I unplug the hdmi and run it the screen goes black and on mouse click it wakes up and all the windows will move to the eDP. But other times, when I run the xset the screen goes black for 1-2s and comes back on its own and I still have 2 monitors. However, running the xset couple more times eventually sets it back to eDP only, so I at least have some workaround solution to the problem.
Btw. the display manager still thinks I have 2 monitors plugged in even when the xset recognizes the HDMI is unplugged. But xrandr correctly lists only eDP.

Here’s the output of inxi --admin --verbosity=7 --filter --no-host --width

System:
  Kernel: 5.9.16-1-MANJARO x86_64 bits: 64 compiler: gcc v: 10.2.1 
  parameters: BOOT_IMAGE=/boot/vmlinuz-5.9-x86_64 
  root=UUID=53daf429-2de4-483a-8c5b-fe0f3ceac68f rw quiet 
  cryptdevice=UUID=41593711-c62d-4035-ab81-3f9b87284891:luks-41593711-c62d-4035-ab81-3f9b87284891 
  root=/dev/mapper/luks-41593711-c62d-4035-ab81-3f9b87284891 
  resume=/dev/mapper/luks-41593711-c62d-4035-ab81-3f9b87284891 apparmor=1 
  security=apparmor udev.log_priority=3 
  Desktop: GNOME 3.38.3 tk: GTK 3.24.26 wm: gnome-shell dm: GDM 3.38.2.1 
  Distro: Manjaro Linux 
Machine:
  Type: Laptop System: Dell product: G5 5590 v: N/A serial: <filter> Chassis: 
  type: 10 serial: <filter> 
  Mobo: Dell model: 0CNDTP v: A01 serial: <filter> UEFI: Dell v: 1.14.0 
  date: 10/20/2020 
Battery:
  ID-1: BAT0 charge: 83.3 Wh condition: 83.3/90.0 Wh (93%) volts: 12.7/11.4 
  model: BYD DELL 6YV0V94 type: Li-poly serial: <filter> status: Full 
Memory:
  RAM: total: 15.45 GiB used: 7.55 GiB (48.9%) 
  RAM Report: permissions: Unable to run dmidecode. Root privileges required. 
CPU:
  Info: 6-Core model: Intel Core i7-9750H bits: 64 type: MT MCP 
  arch: Kaby Lake note: check family: 6 model-id: 9E (158) stepping: A (10) 
  microcode: DE L2 cache: 12 MiB bogomips: 62431 
  Speed: 1908 MHz min/max: 800/4500 MHz Core speeds (MHz): 1: 1908 2: 2936 
  3: 1316 4: 1764 5: 2819 6: 1493 7: 3220 8: 1949 9: 1656 10: 2820 11: 1799 
  12: 1993 
  Flags: 3dnowprefetch abm acpi adx aes aperfmperf apic arat arch_perfmon art 
  avx avx2 bmi1 bmi2 bts clflush clflushopt cmov constant_tsc cpuid 
  cpuid_fault cx16 cx8 de ds_cpl dtes64 dtherm dts epb ept ept_ad erms est 
  f16c flexpriority flush_l1d fma fpu fsgsbase fxsr ht hwp hwp_act_window 
  hwp_epp hwp_notify ibpb ibrs ida intel_pt invpcid invpcid_single lahf_lm lm 
  mca mce md_clear mmx monitor movbe mpx msr mtrr nonstop_tsc nopl nx pae pat 
  pbe pcid pclmulqdq pdcm pdpe1gb pebs pge pln pni popcnt pse pse36 pti pts 
  rdrand rdseed rdtscp rep_good sdbg sep smap smep ss ssbd sse sse2 sse4_1 
  sse4_2 ssse3 stibp syscall tm tm2 tpr_shadow tsc tsc_adjust 
  tsc_deadline_timer vme vmx vnmi vpid x2apic xgetbv1 xsave xsavec xsaveopt 
  xsaves xtopology xtpr 
  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 and seccomp 
  Type: spectre_v1 
  mitigation: usercopy/swapgs barriers and __user pointer sanitization 
  Type: spectre_v2 mitigation: Full generic retpoline, IBPB: conditional, 
  IBRS_FW, STIBP: conditional, RSB filling 
  Type: srbds mitigation: Microcode 
  Type: tsx_async_abort status: Not affected 
Graphics:
  Device-1: Intel UHD Graphics 630 vendor: Dell driver: i915 v: kernel 
  bus ID: 00:02.0 chip ID: 8086:3e9b class ID: 0300 
  Device-2: NVIDIA TU106M [GeForce RTX 2060 Mobile] vendor: Dell 
  driver: nvidia v: 460.56 alternate: nouveau,nvidia_drm bus ID: 01:00.0 
  chip ID: 10de:1f11 class ID: 0300 
  Device-3: Realtek Integrated_Webcam_HD type: USB driver: uvcvideo 
  bus ID: 1-5:3 chip ID: 0bda:5521 class ID: 0e02 serial: <filter> 
  Display: x11 server: X.Org 1.20.10 compositor: gnome-shell driver: 
  loaded: modesetting,nvidia unloaded: intel,nouveau alternate: fbdev,nv,vesa 
  display ID: :1 screens: 1 
  Screen-1: 0 s-res: 3840x1080 s-dpi: 96 s-size: 1016x286mm (40.0x11.3") 
  s-diag: 1055mm (41.6") 
  Monitor-1: eDP-1 res: 1920x1080 hz: 144 dpi: 142 size: 344x194mm (13.5x7.6") 
  diag: 395mm (15.5") 
  Monitor-2: HDMI-1-0 res: 1920x1080 hz: 60 dpi: 92 
  size: 531x298mm (20.9x11.7") diag: 609mm (24") 
  OpenGL: renderer: Mesa Intel UHD Graphics 630 (CFL GT2) v: 4.6 Mesa 20.3.4 
  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 bus ID: 00:1f.3 
  chip ID: 8086:a348 class ID: 0403 
  Sound Server: ALSA v: k5.9.16-1-MANJARO 
Network:
  Device-1: Intel Wireless-AC 9560 [Jefferson Peak] driver: iwlwifi v: kernel 
  port: 5000 bus ID: 00:14.3 chip ID: 8086:a370 class ID: 0280 
  IF: wlo1 state: up mac: <filter> 
  IP v4: <filter> type: dynamic noprefixroute scope: global 
  broadcast: <filter> 
  IP v6: <filter> type: noprefixroute scope: link 
  Device-2: Realtek vendor: Dell driver: r8168 v: 8.048.03-NAPI modules: r8169 
  port: 3000 bus ID: 3c:00.0 chip ID: 10ec:2502 class ID: 0200 
  IF: enp60s0 state: down mac: <filter> 
  IF-ID-1: docker0 state: down mac: <filter> 
  IP v4: <filter> scope: global broadcast: <filter> 
  IF-ID-2: ztrf2z3eko state: unknown speed: 10 Mbps duplex: full mac: <filter> 
  IP v4: <filter> scope: global broadcast: <filter> 
  IP v6: <filter> scope: link 
  WAN IP: <filter> 
Bluetooth:
  Device-1: Intel Bluetooth 9460/9560 Jefferson Peak (JfP) type: USB 
  driver: btusb v: 0.8 bus ID: 1-14:5 chip ID: 8087:0aaa class ID: e001 
  Message: Required tool hciconfig not installed. Check --recommends 
RAID:
  Message: No RAID data was found. 
Drives:
  Local Storage: total: 476.94 GiB used: 416.58 GiB (87.3%) 
  SMART Message: Required tool smartctl not installed. Check --recommends 
  ID-1: /dev/nvme0n1 maj-min: 259:0 vendor: SK Hynix model: PC601 NVMe 512GB 
  size: 476.94 GiB block size: physical: 512 B logical: 512 B speed: 31.6 Gb/s 
  lanes: 4 rotation: SSD serial: <filter> rev: 80002111 temp: 43.9 C 
  scheme: GPT 
  Message: No Optical or Floppy data was found. 
Partition:
  ID-1: / raw size: 472.62 GiB size: 464.21 GiB (98.22%) 
  used: 415.97 GiB (89.6%) fs: ext4 dev: /dev/dm-0 maj-min: 254:0 
  mapped: luks-41593711-c62d-4035-ab81-3f9b87284891 label: N/A 
  uuid: 53daf429-2de4-483a-8c5b-fe0f3ceac68f 
  ID-2: /boot/efi raw size: 300 MiB size: 299.4 MiB (99.80%) 
  used: 15.5 MiB (5.2%) fs: vfat dev: /dev/nvme0n1p1 maj-min: 259:1 label: N/A 
  uuid: 939D-27A0 
  ID-3: /run/media/lfolta/ESP raw size: N/A size: 270.4 MiB 
  used: 68.5 MiB (25.3%) fs: vfat dev: /dev/sda1 label: N/A uuid: N/A 
Swap:
  Kernel: swappiness: 60 (default) cache pressure: 100 (default) 
  ID-1: swap-1 type: partition size: 4.02 GiB used: 540.5 MiB (13.1%) 
  priority: -2 dev: /dev/dm-1 maj-min: 254:1 
  mapped: luks-71bf355f-aba9-4678-832c-1996ea497265 label: N/A 
  uuid: d7cf9e64-918c-4080-926e-54850c4bac54 
Unmounted:
  Message: No Unmounted partitions found. 
USB:
  Hub-1: 1-0:1 info: Full speed (or root) Hub ports: 16 rev: 2.0 
  speed: 480 Mb/s chip ID: 1d6b:0002 class ID: 0900 
  Device-1: 1-1:2 info: Trust Wireless Mouse type: Mouse 
  driver: hid-generic,usbhid interfaces: 1 rev: 1.1 speed: 12 Mb/s 
  chip ID: 145f:0263 class ID: 0301 
  Device-2: 1-5:3 info: Realtek Integrated_Webcam_HD type: Video 
  driver: uvcvideo interfaces: 2 rev: 2.0 speed: 480 Mb/s chip ID: 0bda:5521 
  class ID: 0e02 serial: <filter> 
  Device-3: 1-9:4 info: Shenzhen Goodix Fingerprint Reader 
  type: <vendor specific> driver: N/A interfaces: 1 rev: 2.0 speed: 12 Mb/s 
  chip ID: 27c6:530c class ID: ff00 
  Device-4: 1-14:5 info: Intel Bluetooth 9460/9560 Jefferson Peak (JfP) 
  type: Bluetooth driver: btusb interfaces: 2 rev: 2.0 speed: 12 Mb/s 
  chip ID: 8087:0aaa class ID: e001 
  Hub-2: 2-0:1 info: Full speed (or root) Hub ports: 8 rev: 3.1 speed: 10 Gb/s 
  chip ID: 1d6b:0003 class ID: 0900 
  Hub-3: 5-0:1 info: Full speed (or root) Hub ports: 2 rev: 2.0 
  speed: 480 Mb/s chip ID: 1d6b:0002 class ID: 0900 
  Hub-4: 6-0:1 info: Full speed (or root) Hub ports: 2 rev: 3.1 speed: 10 Gb/s 
  chip ID: 1d6b:0003 class ID: 0900 
Sensors:
  System Temperatures: cpu: 57.0 C mobo: N/A 
  Fan Speeds (RPM): N/A 
Info:
  Processes: 456 Uptime: 1d 20h 42m wakeups: 39551 Init: systemd v: 247 
  Compilers: gcc: 10.2.0 Packages: pacman: 1630 lib: 471 flatpak: 0 Shell: Zsh 
  v: 5.8 running in: guake inxi: 3.3.01 

Also I’ve found another thing I have a USB-C port replicator which has HDMI and that used to work too and now it does not even recognize the monitor is plugged in. But that’s not that big of an issue since I don’t use it any more as I’m using directly the HDMI on the ntb itself (Until 450 driver the HDMI output didn’t work).

Kernel 5.9 is EOL please upgrade to 5.4 LTS (Long Time Support) and 5.10 LTS if 5.4 doesn’t work out for you.

Let’s start there before we do any further drastic things.

:+1:

ah, I’ve tried the 5.9 kernel when I was playing around trying to see what would fix that issue and forgot to revert back the 5.4. Let me revert and try again.

1 Like

So, here’s the update. With kernel 5.4, xset didn’t work at all. With 5.10 it behaves still the same but I’ve figured out the exact steps to make the monitors set correctly.

After plugging-in or unplugging the HDMI in order to force the re-detection of active monitors I have to run:
xrandr --listmonitors
and then
xset dpms force off
in this exact order.

I’ve tried xrandr --auto when I plugged in the HDMI but got xrandr: Configure crtc 3 failed and nothing happened. When I tried the xrandr --auto when I unplugged the HDMI, no error appeared and nothing happened but the command took like 1ms opposed to the first scenario where it took couple seconds to generate that error and finish.

Any ideas what might be happening?
P.S.:
Also noticed one surprising thing - with the 5.10 kernel the GPU temp fell down from 75-80C to 50-55C under load.

Assuming you want to turn off HDMI-1 execute this:

xrandr --output HDMI-1 --off

(Obviously if eDP-1, use that instead)

If any error messages, please report them.

:crossed_fingers:

That did nothing.

Checked the dmesg and I can see:

[31670.931482] nvidia-modeset: WARNING: GPU:0: Unable to read EDID for display device HDMI-0
[31779.205424] nvidia-modeset: WARNING: GPU:0: Unable to read EDID for display device BenQ GL2450H (HDMI-0)

Update the firmware of your monitors as they don’t support the full HDMI standard.

If there is no firmware update for your monitors, I’m officially giving up and blaming it on Cheap! :tm: Chinese! :tm: Crap! :tm: Inc! :tm:.

Sorry!

:sob:

It’s old-ish monitor and there are no firmware updates. Strangely though that until one of the latest updates it worked just fine. OOTB manjaro - w/o updates works just fine. I’ve tried different machines with Windows and Ubuntu 20 and it worked as well. Usually when I have these kinds of problems, it turns out to be the nvidia drivers, so I guess I’ll wait patiently and pray to nvidia devs to fix up the issue in the coming releases.

I’ve scripted the force re-detection so it’s not that much of an issue now.

Anyway thanks for your assistance!

1 Like