hyprwm / Hyprland

Hyprland is an independent, highly customizable, dynamic tiling Wayland compositor that doesn't sacrifice on its looks.
https://hyprland.org
BSD 3-Clause "New" or "Revised" License
19.88k stars 848 forks source link

Second Monitor Chained with Thunderbolt not Working #7825

Open Balrrach opened 1 week ago

Balrrach commented 1 week ago

Already reported ? *

Regression?

No

System Info and Version

System/Version info ```sh Hyprland, built from branch at commit 0f594732b063a90d44df8c5d402d658f27471dfe (props: bump version to 0.43.0). Date: Sun Sep 8 16:48:21 2024 Tag: v0.43.0, commits: 5196 flags: (if any) System Information: System name: Linux Node name: linux-desktop Release: 6.10.10-arch1-1 Version: #1 SMP PREEMPT_DYNAMIC Thu, 12 Sep 2024 17:21:02 +0000 GPU information: 01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GA106 [GeForce RTX 3060 Lite Hash Rate] [10de:2504] (rev a1) (prog-if 00 [VGA controller]) NVRM version: NVIDIA UNIX x86_64 Kernel Module 560.35.03 Fri Aug 16 21:39:15 UTC 2024 os-release: NAME="Arch Linux" PRETTY_NAME="Arch Linux" ID=arch BUILD_ID=rolling ANSI_COLOR="38;2;23;147;209" HOME_URL="https://archlinux.org/" DOCUMENTATION_URL="https://wiki.archlinux.org/" SUPPORT_URL="https://bbs.archlinux.org/" BUG_REPORT_URL="https://gitlab.archlinux.org/groups/archlinux/-/issues" PRIVACY_POLICY_URL="https://terms.archlinux.org/docs/privacy-policy/" LOGO=archlinux-logo ```

Description

I have two monitors. A main monitor and a secondary one that is chained to the main one and receives the input from a thunderbolt cable. The setup works fine with other OS (Windows and MacOs). Often times (do not know under which circumstances) the secondary monitor presents problems.

First, Hyprland crashes on startup. The cache file is attached below. Then, when I comment my configuration for the monitors Hyprland starts, but the second monitor resolution is wrong:

Monitor DP-4 (ID 0):
    2560x1440@120.00000 at 0x0
    description: Dell Inc. DELL U2724DE 3LGNBP3
    make: Dell Inc.
    model: DELL U2724DE
    serial: 3LGNBP3
    active workspace: 5 (5)
    special workspace: 0 ()
    reserved: 0 24 0 0
    scale: 1.00
    transform: 0
    focused: yes
    dpmsStatus: 1
    vrr: 0
    activelyTearing: false
    disabled: false
    currentFormat: A XRGB8888 H XRGB8888
    availableModes: 2560x1440@120.00Hz 2560x1440@74.97Hz 2560x1440@59.95Hz 2048x1080@60.00Hz 1920x1080@119.88Hz 1920x1080@119.98Hz 1920x1080@100.00Hz 1920x1080@60.00Hz 1920x1080@59.94Hz 1920x1080@50.00Hz 1920x1080@29.97Hz 1920x1080@25.00Hz 1920x1080@23.98Hz 1600x1200@60.00Hz 1600x900@60.00Hz 1280x1024@75.03Hz 1280x1024@60.02Hz 1152x864@75.00Hz 1280x720@60.00Hz 1280x720@59.94Hz 1280x720@50.00Hz 1024x768@75.03Hz 1024x768@60.00Hz 800x600@75.00Hz 800x600@60.32Hz 720x576@50.00Hz 720x480@59.94Hz 640x480@75.00Hz 640x480@59.94Hz 

Monitor DP-5 (ID 1):
    1920x1080@29.97200 at 2560x0
    description: Dell Inc. DELL U2724DE 72YPBP3
    make: Dell Inc.
    model: DELL U2724DE
    serial: 72YPBP3
    active workspace: 2 (2)
    special workspace: 0 ()
    reserved: 0 24 0 0
    scale: 1.00
    transform: 0
    focused: no
    dpmsStatus: 1
    vrr: 0
    activelyTearing: false
    disabled: false
    currentFormat: A XRGB8888 H XRGB8888
    availableModes: 2560x1440@120.00Hz 2560x1440@74.97Hz 2560x1440@59.95Hz 2048x1080@60.00Hz 1920x1080@119.88Hz 1920x1080@119.98Hz 1920x1080@100.00Hz 1920x1080@60.00Hz 1920x1080@59.94Hz 1920x1080@50.00Hz 1920x1080@29.97Hz 1920x1080@25.00Hz 1920x1080@23.98Hz 1600x1200@60.00Hz 1600x900@60.00Hz 1280x1024@75.03Hz 1280x1024@60.02Hz 1152x864@75.00Hz 1280x720@60.00Hz 1280x720@59.94Hz 1280x720@50.00Hz 1024x768@75.03Hz 1024x768@60.00Hz 800x600@75.00Hz 800x600@60.32Hz 720x576@50.00Hz 720x480@59.94Hz 640x480@75.00Hz 640x480@59.94Hz

Also, trying to change the second monitor resolution either does not work or results in a crash.

This is my monitors current configuration.

monitor=desc:Dell Inc. DELL U2724DE 72YPBP3,2560x1440@120.0,0x0,1.0
monitor=desc:Dell Inc. DELL U2724DE 3LGNBP3,2560x1440@120.0,2560x0,1.0

At the begging I had a different configuration:

monitor=DP-4,2560x1440@120.0,0x0,1.0
monitor=DP-5:Dell Inc. DELL U2724DE 3LGNBP3,2560x1440@120.0,2560x0,1.0

With this configuration Hyprland started more often, but the second monitor resolution was almost always wrong. I thought this could be due to the port being recognized by hyprland later in the startup, but configuring it once it had booted up never changed the monitor resolution/refresh rate.

How to reproduce

  1. Connect a monitor to the PC using a Display Port cable
  2. Chain the second monitor to the first one using a Thunderbolt cable
  3. Login and launch Hyprland

Crash reports, logs, images, videos

--------------------------------------------
   Hyprland Crash Report
--------------------------------------------
Oops

Hyprland received signal 6(ABRT)
Version: 0f594732b063a90d44df8c5d402d658f27471dfe
Tag: v0.43.0
Date: Sun Sep 8 16:48:21 2024
Flags:

System info:
    System name: Linux
    Node name: linux-desktop
    Release: 6.10.10-arch1-1
    Version: #1 SMP PREEMPT_DYNAMIC Thu, 12 Sep 2024 17:21:02 +0000

GPU:
    01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GA106 [GeForce RTX 3060 Lite Hash Rate] [10de:2504] (rev a1) (prog-if 00 [VGA controller])

os-release:
    NAME="Arch Linux"
    PRETTY_NAME="Arch Linux"
    ID=arch
    BUILD_ID=rolling
    ANSI_COLOR="38;2;23;147;209"
    HOME_URL="https://archlinux.org/"
    DOCUMENTATION_URL="https://wiki.archlinux.org/"
    SUPPORT_URL="https://bbs.archlinux.org/"
    BUG_REPORT_URL="https://gitlab.archlinux.org/groups/archlinux/-/issues"
    PRIVACY_POLICY_URL="https://terms.archlinux.org/docs/privacy-policy/"
    LOGO=archlinux-logo
Backtrace:
    # | Hyprland(_Z12getBacktracev+0x61) [0x6400f28a1e81]
        getBacktrace()
        ??:?
    #1 | Hyprland(_ZN13CrashReporter18createAndSaveCrashEi+0xb88) [0x6400f2821b78]
        CrashReporter::createAndSaveCrash(int)
        ??:?
    #2 | Hyprland(_Z25handleUnrecoverableSignali+0x71) [0x6400f279f581]
        handleUnrecoverableSignal(int)
        ??:?
    #3 | /usr/lib/libc.so.6(+0x3d1d0) [0x701b2544c1d0]
        ??
        ??:0
    #4 | /usr/lib/libc.so.6(+0x963f4) [0x701b254a53f4]
        ??
        ??:0
    #5 | /usr/lib/libc.so.6(gsignal+0x20) [0x701b2544c120]
        ??
        ??:0
    #6 | Hyprland(_ZN15CHyprOpenGLImpl22renderTexturePrimitiveEN9Hyprutils6Memory14CSharedPointerI8CTextureEEPNS0_4Math4CBoxE+0x102) [0x6400f2a7e8d2]
        CHyprOpenGLImpl::renderTexturePrimitive(Hyprutils::Memory::CSharedPointer<CTexture>, Hyprutils::Math::CBox*)
        ??:?
    #7 | Hyprland(_ZN15CHyprOpenGLImpl3endEv+0x591) [0x6400f2a822d1]
        CHyprOpenGLImpl::end()
        ??:?
    #8 | Hyprland(_ZN13CHyprRenderer9endRenderEv+0x116) [0x6400f2aa79f6]
        CHyprRenderer::endRender()
        ??:?
    #9 | Hyprland(_ZN13CHyprRenderer13renderMonitorEP8CMonitor+0x896) [0x6400f2a9e3e6]
        CHyprRenderer::renderMonitor(CMonitor*)
        ??:?
    #1 | Hyprland(_ZN11CCompositor12onNewMonitorEN9Hyprutils6Memory14CSharedPointerIN10Aquamarine7IOutputEEE+0x418) [0x6400f27c1a28]
        CCompositor::onNewMonitor(Hyprutils::Memory::CSharedPointer<Aquamarine::IOutput>)
        ??:?
    #11 | Hyprland(_ZN11CCompositor10initServerENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEi+0xcaa) [0x6400f27a5d7a]
        CCompositor::initServer(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, int)
        ??:?
    #12 | Hyprland(main+0xc15) [0x6400f275c2a5]
        main
        ??:?
    #13 | /usr/lib/libc.so.6(+0x25e08) [0x701b25434e08]
        ??
        ??:0
    #14 | /usr/lib/libc.so.6(__libc_start_main+0x8c) [0x701b25434ecc]
        ??
        ??:0
    #15 | Hyprland(_start+0x25) [0x6400f279b815]
        _start
        ??:?

Log tail:
[LOG] Framebuffer created, status 36053
[ERR] createBGTextureForMonitor: failed, file "/usr/local/share/hypr/wall2.png" doesn't exist or access denied, ec: Success
[LOG] Renderer: checking for explicit KMS support for nvidia
[LOG] Renderer: Nvidia version file exists
[LOG] Renderer: Read nvidia version 560.35.03

[LOG] Renderer: Parsed nvidia major version: 560
[ERR] [AQ] drm: Cannot commit when a page-flip is awaiting
[ERR] [AQ] drm: Cannot commit when a page-flip is awaiting
[LOG] New output with name DP-5
[LOG] Applying monitor rule for DP-5
[LOG] [AQ] GBM: Allocated a new buffer with size [Vector2D: x: 2560, y: 1440] and format XR24 with modifier 216172782120099860 aka BLOCK_LINEAR_2D,HEIGHT=4,KIND=6,GEN=2,SECTOR=1,COMPRESSION=0
[LOG] [AQ] GBM: Allocated a new buffer with size [Vector2D: x: 2560, y: 1440] and format XR24 with modifier 216172782120099860 aka BLOCK_LINEAR_2D,HEIGHT=4,KIND=6,GEN=2,SECTOR=1,COMPRESSION=0
[LOG] [AQ] Swapchain: Reconfigured a swapchain to [Vector2D: x: 2560, y: 1440] XR24 of length 2
[LOG] CMonitorState::ensureBufferPresent: no buffer or mismatched format, attaching one from the swapchain for modeset being possible
[LOG] [AQ] atomic drm request: failed to commit: Invalid argument, flags: ATOMIC_ALLOW_MODESET ATOMIC_TEST_ONLY 
[LOG] Monitor DP-5: REJECTED available mode: 2560x1440@120.000000!
[LOG] [AQ] atomic drm request: failed to commit: Invalid argument, flags: ATOMIC_ALLOW_MODESET ATOMIC_TEST_ONLY 
[ERR] Custom resolution FAILED, falling back to preferred
[ERR] Monitor 1 has NO PREFERRED MODE, and an INVALID one was requested: 2560x1440@120.000000
[LOG] [AQ] drm: Modesetting DP-5 with 2560x1440@120.00Hz
[ERR] [AQ] atomic drm request: failed to commit: Invalid argument, flags: ATOMIC_ALLOW_MODESET PAGE_FLIP_EVENT 
[WARN] state.commit() failed in CMonitor::onCommit
[LOG] Added new monitor with name DP-5 at [-1, -1] with size [0, 0], pointer 64013281dac0
[LOG] New monitor: WORKSPACEID 2, exists: 0
[ERR] rbo: glCheckFramebufferStatus failed
[LOG] [AQ] GBM: Automatically selected format AR24 for new GBM buffer
[LOG] [AQ] GBM: Buffer is marked as multigpu, forcing linear
[ERR] [AQ] GBM: Allocating with modifiers and flags failed, falling back to modifiers without flags
[LOG] [AQ] GBM: Allocated a new buffer with size [Vector2D: x: 256, y: 256] and format AR24 with modifier 0 aka LINEAR
[ERR] [AQ] [GLES] Error in call at 583@Renderer.cpp: 0x502
[ERR] [AQ] [GLES] Error in call at 600@Renderer.cpp: 0x506
[LOG] [AQ] GBM: Automatically selected format AR24 for new GBM buffer
[LOG] [AQ] GBM: Buffer is marked as multigpu, forcing linear
[ERR] [AQ] GBM: Allocating with modifiers and flags failed, falling back to modifiers without flags
[LOG] [AQ] GBM: Allocated a new buffer with size [Vector2D: x: 256, y: 256] and format AR24 with modifier 0 aka LINEAR
[ERR] [AQ] [GLES] Error in call at 583@Renderer.cpp: 0x502
[ERR] [AQ] [GLES] Error in call at 600@Renderer.cpp: 0x506
[LOG] [AQ] Swapchain: Reconfigured a swapchain to [Vector2D: x: 256, y: 256] AR24 of length 2
[ERR] rbo: glCheckFramebufferStatus failed
[LOG] [IWaylandProtocol] Registered global [WLOutput (DP-5)]
[LOG] Applying monitor rule for DP-4
[LOG] Not applying a new rule to DP-4 because it's already applied!
[LOG] Applying monitor rule for DP-5
[LOG] [AQ] atomic drm request: failed to commit: Invalid argument, flags: ATOMIC_ALLOW_MODESET ATOMIC_TEST_ONLY 
[LOG] Monitor DP-5: REJECTED available mode: 2560x1440@120.000000!
[LOG] [AQ] atomic drm request: failed to commit: Invalid argument, flags: ATOMIC_ALLOW_MODESET ATOMIC_TEST_ONLY 
[ERR] Custom resolution FAILED, falling back to preferred
[ERR] Monitor 1 has NO PREFERRED MODE, and an INVALID one was requested: 2560x1440@120.000000
[ERR] [GLES] Error in call at 142@Texture.cpp: 0x502
[ERR] rbo: glCheckFramebufferStatus failed
[ERR] rbo: glCheckFramebufferStatus failed
[LOG] Shaders initialized successfully.
[CRITICAL] 
==========================================================================================
ASSERTION FAILED! 

Attempted to draw NULL texture!

at: line 1547 in OpenGL.cpp
ikalco commented 1 week ago

try this env = AQ_NO_MODIFIERS,1 if it doesn't work the give the drm log (howto is in link also)

also does this work on sway?

Balrrach commented 1 week ago

The environment variable did not work. In fact, when I set it to 1 I get a black screen after launching hyprland, it does not matter which monitor configuration I use.

This is the drm log when I boot the computer with the default configuration: dmesg_wrong_resolution_setting.log

In this case I have a strange resolution in the second monitor and it does not obey any attempt to change the resolution/refresh rate, as explained previously.

This is the drm log when I configure the monitors explicitly: dmesg_system_crash_setting.log

On sway I had no problem with the second monitor, but when I used the Nvidia drivers the active monitor started flickering and showing artifacts. I cannot use the open source drivers because they crashed eventually.

techyporcupine commented 4 days ago

I'm still having this issue as well.

coffebar commented 3 days ago

I have this too.

conf

monitor=,preferred,auto,auto
# this one crashes over usb-c, but working with HDMI
monitor= desc:BNQ BenQ PD2705U 89P03368019,3840x2160@60,0x0,1.5 
monitor= desc:BOE 0x094C,1920x1200@60,0x1440,1 # X1 Carbon

Logs just before the crash:

[LOG] New output with name DP-3
[LOG] Applying monitor rule for DP-3
[LOG] [AQ] GBM: Allocated a new buffer with size [Vector2D: x: 3840, y: 2160] and format XR24 with modifier 72057594037927944 aka Y_TILED_GEN12_RC_CCS_CC
[LOG] [AQ] GBM: Allocated a new buffer with size [Vector2D: x: 3840, y: 2160] and format XR24 with modifier 72057594037927944 aka Y_TILED_GEN12_RC_CCS_CC
[LOG] [AQ] Swapchain: Reconfigured a swapchain to [Vector2D: x: 3840, y: 2160] XR24 of length 2
[LOG] CMonitorState::ensureBufferPresent: no buffer or mismatched format, attaching one from the swapchain for modeset being possible
[LOG] [AQ] atomic drm request: failed to commit: Invalid argument, flags: ATOMIC_ALLOW_MODESET ATOMIC_TEST_ONLY
[ERR] Custom resolution FAILED, falling back to preferred
[ERR] Monitor 1 has NO PREFERRED MODE, and an INVALID one was requested: 3840x2160@60.000000
[LOG] [AQ] drm: Modesetting DP-3 with 3840x2160@60.00Hz
[ERR] [AQ] atomic drm request: failed to commit: Invalid argument, flags: ATOMIC_ALLOW_MODESET PAGE_FLIP_EVENT
[WARN] state.commit() failed in CMonitor::onCommit
[LOG] Added new monitor with name DP-3 at [-1, -1] with size [0, 0], pointer 62ed6bab3a40
[LOG] New monitor: WORKSPACEID 5, exists: 0
[LOG] [AQ] drm: Cursor buffer imported into KMS with id 378
[LOG] [AQ] GBM: Automatically selected format AR24 for new GBM buffer
[LOG] [AQ] GBM: Buffer is marked as multigpu, forcing linear
[LOG] [AQ] GBM: Allocated a new buffer with size [Vector2D: x: 256, y: 256] and format AR24 with modifier 0 aka LINEAR
[LOG] [AQ] GBM: Automatically selected format AR24 for new GBM buffer
[LOG] [AQ] GBM: Buffer is marked as multigpu, forcing linear
[LOG] [AQ] GBM: Allocated a new buffer with size [Vector2D: x: 256, y: 256] and format AR24 with modifier 0 aka LINEAR
[LOG] [AQ] Swapchain: Reconfigured a swapchain to [Vector2D: x: 256, y: 256] AR24 of length 2
[LOG] Shaders initialized successfully.
[LOG] [AQ] drm: Cursor buffer imported into KMS with id 381
[LOG] [IWaylandProtocol] Registered global [WLOutput (DP-3)]
[LOG] Applying monitor rule for eDP-1
[LOG] Not applying a new rule to eDP-1 because it's already applied!
[LOG] Applying monitor rule for DP-3
[LOG] [AQ] atomic drm request: failed to commit: Invalid argument, flags: ATOMIC_ALLOW_MODESET ATOMIC_TEST_ONLY
[ERR] Custom resolution FAILED, falling back to preferred
[ERR] Monitor 1 has NO PREFERRED MODE, and an INVALID one was requested: 3840x2160@60.000000
[hc] loadThemeStyle: loading for size 48
[hc] getShapesC: found 1 images for left_ptr
[LOG] [AQ] drm: Cursor buffer imported into KMS with id 378
[LOG] [AQ] drm: Cursor buffer imported into KMS with id 381
[CRITICAL]
==========================================================================================
ASSERTION FAILED!

Attempted to draw NULL texture!

at: line 1547 in OpenGL.cpp
coffebar commented 2 days ago

My steps to reproduce are different. I don't have a chained monitor, just connected to Thunderbolt, but resolution set in config (3840x2160@60,0x0,1.5) for some reason is not supported via this port. I can use it over HDMI only. But with Thunderbolt I only have these:

~ hyprctl monitors
...
availableModes: 3840x2160@30.00Hz 3840x2160@29.97Hz 3840x2160@25.00Hz 3840x2160@24.00Hz 3840x2160@23.98Hz 1920x2160@59.99Hz 2560x1440@59.95Hz 1920x1080@60.00Hz 1920x1080@60.00Hz 1920x1080@59.94Hz 1920x1080@50.00Hz 1920x1080@30.00Hz 1920x1080@29.97Hz 1920x1080@25.00Hz 1920x1080@24.00Hz 1920x1080@23.98Hz 1680x1050@59.95Hz 1600x900@60.00Hz 1280x1024@75.03Hz 1280x1024@60.02Hz 1280x800@59.81Hz 1152x864@75.00Hz 1280x720@60.00Hz 1280x720@60.00Hz 1280x720@59.94Hz 1280x720@50.00Hz 1024x768@75.03Hz 1024x768@60.00Hz 832x624@74.55Hz 800x600@75.00Hz 800x600@60.32Hz 720x576@50.00Hz 720x480@60.00Hz 720x480@59.94Hz 640x480@75.00Hz 640x480@60.00Hz 640x480@59.94Hz 640x480@59.94Hz 720x400@70.08Hz

There is no crash when resolution is 3840x2160@30.00Hz (but refresh rate is too low)

So, I believe this crash can be reproduced by setting unsupported resolution in config.