When I try to use Hyprland "headlessly" (without a monitor plugged in), I get some weird things happening. Specifically, there are 3 symptoms: apps not rendering, log error spam, and weird fps results.
Some of my colleagues investigated and found that it seems like Hyprland tries to allocate a GBM bo with GBM_BO_USE_RENDERING and GBM_BO_USE_SCANOUT flags with the linear modifier. Currently, we can not render to a linear buffer.
Symptoms
When I use wayvnc to look at HEADLESS-2, I don't see anything except a gray screen.
This error spammed a ton:
```
[ERR] Failed to acquire swapchain buffer for HEADLESS-2
[ERR] renderer: couldn't beginRender()!
```
And, the fps is abnormally low. Here is the output of hyprctl monitors:
```
Monitor HEADLESS-2 (ID 0):
1920x1080@0.06000 at 0x0
description:
make:
model:
serial:
active workspace: 1 (1)
special workspace: 0 ()
reserved: 0 0 0 0
scale: 2.00
transform: 0
focused: yes
dpmsStatus: 1
vrr: false
solitary: 0
activelyTearing: false
disabled: false
currentFormat: Invalid
mirrorOf: none
availableModes: 1920x1080@0.06Hz
```
Something like glxgears will run at 1fps, but vkcube will run normally, I think because it doesn't try to sync with the display frame rate.
xrandr also shows some weird results:
```
Screen 0: minimum 16 x 16, current 960 x 540, maximum 32767 x 32767
HEADLESS-2 connected 960x540+0+0 (normal left inverted right x axis y axis) 0mm x 0mm
960x540 0.00*+
640x480 0.00
320x240 0.00
800x500 0.00
768x480 0.00
720x480 0.00
640x400 0.00
320x200 0.00
864x486 0.00
720x400 0.00
640x350 0.00
```
How to reproduce
This should be done on a machine with no display plugged in and an NVIDIA GPU. I was using Arch, but this may repro on other distros as well. Make sure to have at least 3 "terminal windows" open to this machine (A, B, C).
Install Hyprland, NVIDIA drivers, seatd
In a different terminal (B), run "sudo seatd -u yourusername"
Modify ~/.config/hypr/hyprland.conf and replace "monitor=,preferred,auto,auto" with "monitor=HEADLESS-2,3840x2160@60,auto,auto"
In your main terminal (A), run "Hyprland"
In a different terminal (C). run "systemd-run --user -S".
In terminal C, run " hyprctl output create headless HEADLESS-2"
You can observe some of the error spam in the main terminal.
In terminal C, run "glxgears", and observe some error spam, as well as a much lower than expected frame rate.
You can also use vkcube and see the error spam (fps is normal for some reason).
If you want, you can open a fourth terminal and run "wayvnc 0.0.0.0 -L trace -o HEADLESS-2" (-L trace optional) with an app running, to notice that the app doesn't show up on wayvnc (it does show up on sway or with an Arc A770).
You can also look at hyprctl monitors to see what hyprland thinks the headless output can output (i.e "1920x1080@0.06" or "3840x2560@60"). This does vary per driver version.
Crash reports, logs, images, videos
This is one notable part of the below log that led us to gbm bos:
some specific logs
```sh
[TRACE] [AQ] GBM: Allocating a buffer: size [Vector2D: x: 1920, y: 1080], format XR24, cursor: false, multigpu: false, scanout: true
[TRACE] [AQ] GBM: Available formats: 2
[TRACE] [AQ] GBM: Using modifier-based allocation, modifiers: 1
[TRACE] [AQ] GBM: | mod 0x0
[ERR] [AQ] GBM: Allocating with modifiers failed, falling back to modifier-less allocation
[ERR] [AQ] GBM: Failed to allocate a GBM buffer: bo null
[ERR] [AQ] Couldn't allocate a gbm buffer with size [Vector2D: x: 1920, y: 1080] and format XR24
[ERR] [AQ] Swapchain: Failed acquiring a buffer
[ERR] output HEADLESS-2 failed basic test on format DRM_FORMAT_XRGB8888
[TRACE] [AQ] GBM: Allocating a buffer: size [Vector2D: x: 1920, y: 1080], format XB24, cursor: false, multigpu: false, scanout: true
[TRACE] [AQ] GBM: Available formats: 2
[TRACE] [AQ] GBM: Using modifier-based allocation, modifiers: 1
[TRACE] [AQ] GBM: | mod 0x0
[ERR] [AQ] GBM: Allocating with modifiers failed, falling back to modifier-less allocation
[ERR] [AQ] GBM: Failed to allocate a GBM buffer: bo null
[ERR] [AQ] Couldn't allocate a gbm buffer with size [Vector2D: x: 1920, y: 1080] and format XB24
[ERR] [AQ] Swapchain: Failed acquiring a buffer
[ERR] output HEADLESS-2 failed basic test on format DRM_FORMAT_XBGR8888
[TRACE] [AQ] GBM: Allocating a buffer: size [Vector2D: x: 1920, y: 1080], format INVALID, cursor: false, multigpu: false, scanout: true
[TRACE] [AQ] GBM: Available formats: 2
[LOG] [AQ] GBM: Automatically selected format RA30 for new GBM buffer
[TRACE] [AQ] GBM: Using modifier-based allocation, modifiers: 1
[TRACE] [AQ] GBM: | mod 0x0
[ERR] [AQ] GBM: Allocating with modifiers failed, falling back to modifier-less allocation
[ERR] [AQ] GBM: Failed to allocate a GBM buffer: bo null
[ERR] [AQ] Couldn't allocate a gbm buffer with size [Vector2D: x: 1920, y: 1080] and format INVALID
[ERR] [AQ] Swapchain: Failed acquiring a buffer
[ERR] output HEADLESS-2 failed basic test on format DRM_FORMAT_INVALID
[TRACE] [AQ] CHeadlessOutput::scheduleFrame: reason 0, needsFrame true, frameScheduled true
[TRACE] [AQ] GBM: Allocating a buffer: size [Vector2D: x: 1920, y: 1080], format INVALID, cursor: false, multigpu: false, scanout: true
[TRACE] [AQ] GBM: Available formats: 2
[LOG] [AQ] GBM: Automatically selected format RA30 for new GBM buffer
[TRACE] [AQ] GBM: Using modifier-based allocation, modifiers: 1
[TRACE] [AQ] GBM: | mod 0x0
[ERR] [AQ] GBM: Allocating with modifiers failed, falling back to modifier-less allocation
[ERR] [AQ] GBM: Failed to allocate a GBM buffer: bo null
[ERR] [AQ] Couldn't allocate a gbm buffer with size [Vector2D: x: 1920, y: 1080] and format INVALID
[ERR] [AQ] Swapchain: Failed acquiring a buffer
[ERR] Couldn't commit output named HEADLESS-2
[LOG] arrangeMonitors: 1 to arrange
[LOG] arrangeMonitors: HEADLESS-2 auto [0, 0]
[LOG] arrangeMonitors: HEADLESS-2 xwayland [0, 0]
[LOG] [CXDGOutputProtocol] updating all xdg_output heads
[TRACE] [AQ] CHeadlessOutput::scheduleFrame: reason 6, needsFrame true, frameScheduled true
[TRACE] [AQ] CHeadlessOutput::scheduleFrame: reason 6, needsFrame true, frameScheduled true
[LOG] Monitor HEADLESS-2 data dump: res 1920x1080@0.06Hz, scale 2.00, transform 0, pos 0x0, 10b 0
```
Already reported ? *
Regression?
Yes
System Info and Version
System/Version info
```sh Hyprland 0.44.0 built from branch main at commit 3b66351eeb76e802bac37cc892529549efc49905 (input: Refocus window on scrolling if follows mouse (8361)). Date: Fri Nov 8 09:25:37 2024 Tag: v0.44.0-127-g3b66351e, commits: 5426 built against aquamarine 0.4.3 flags set: debug System Information: System name: Linux Node name: lnxstress-261 Release: 6.11.5-arch1-1 Version: #1 SMP PREEMPT_DYNAMIC Tue, 22 Oct 2024 18:31:38 +0000 GPU information: 01:00.0 VGA compatible controller [0300]: NVIDIA Corporation TU104 [GeForce RTX 2080 Rev. A] [10de:1e87] (rev a1) (prog-if 00 [VGA controller]) NVRM version: NVIDIA UNIX Open Kernel Module for x86_64 Thu Nov 7 11:50:09 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 plugins: ======Config-Start====== Config File: /root/nvt/log/Task1/Wayland/0/hyprland.conf: Read Succeeded debug { disable_logs = false enable_stdout_logs = true } env = XCURSOR_SIZE,24 env = HYPRCURSOR_SIZE,24 general { gaps_in = 5 gaps_out = 20 border_size = 2 col.active_border = rgba(33ccffee) rgba(00ff99ee) 45deg col.inactive_border = rgba(595959aa) resize_on_border = false allow_tearing = false layout = dwindle } decoration { rounding = 10 active_opacity = 1.0 inactive_opacity = 1.0 drop_shadow = true shadow_range = 4 shadow_render_power = 3 col.shadow = rgba(1a1a1aee) blur { enabled = true size = 3 passes = 1 vibrancy = 0.1696 } } animations { enabled = true bezier = myBezier, 0.05, 0.9, 0.1, 1.05 animation = windows, 1, 7, myBezier animation = windowsOut, 1, 7, default, popin 80% animation = border, 1, 10, default animation = borderangle, 1, 8, default animation = fade, 1, 7, default animation = workspaces, 1, 6, default } dwindle { pseudotile = true # Master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below preserve_split = true # You probably want this } master { new_status = master } misc { force_default_wallpaper = -1 # Set to 0 or 1 to disable the anime mascot wallpapers disable_hyprland_logo = false # If true disables the random hyprland logo / anime girl background. :( } input { kb_layout = us kb_variant = kb_model = kb_options = kb_rules = follow_mouse = 1 sensitivity = 0 # -1.0 - 1.0, 0 means no modification. touchpad { natural_scroll = false } } gestures { workspace_swipe = false } device { name = epic-mouse-v1 sensitivity = -0.5 } $mainMod = SUPER # Sets "Windows" key as main modifier bind = $mainMod, Q, exec, $terminal bind = $mainMod, C, killactive, bind = $mainMod, M, exit, bind = $mainMod, E, exec, $fileManager bind = $mainMod, V, togglefloating, bind = $mainMod, R, exec, $menu bind = $mainMod, P, pseudo, # dwindle bind = $mainMod, J, togglesplit, # dwindle bind = $mainMod, left, movefocus, l bind = $mainMod, right, movefocus, r bind = $mainMod, up, movefocus, u bind = $mainMod, down, movefocus, d bind = $mainMod, 1, workspace, 1 bind = $mainMod, 2, workspace, 2 bind = $mainMod, 3, workspace, 3 bind = $mainMod, 4, workspace, 4 bind = $mainMod, 5, workspace, 5 bind = $mainMod, 6, workspace, 6 bind = $mainMod, 7, workspace, 7 bind = $mainMod, 8, workspace, 8 bind = $mainMod, 9, workspace, 9 bind = $mainMod, 0, workspace, 10 bind = $mainMod SHIFT, 1, movetoworkspace, 1 bind = $mainMod SHIFT, 2, movetoworkspace, 2 bind = $mainMod SHIFT, 3, movetoworkspace, 3 bind = $mainMod SHIFT, 4, movetoworkspace, 4 bind = $mainMod SHIFT, 5, movetoworkspace, 5 bind = $mainMod SHIFT, 6, movetoworkspace, 6 bind = $mainMod SHIFT, 7, movetoworkspace, 7 bind = $mainMod SHIFT, 8, movetoworkspace, 8 bind = $mainMod SHIFT, 9, movetoworkspace, 9 bind = $mainMod SHIFT, 0, movetoworkspace, 10 bind = $mainMod, S, togglespecialworkspace, magic bind = $mainMod SHIFT, S, movetoworkspace, special:magic bind = $mainMod, mouse_down, workspace, e+1 bind = $mainMod, mouse_up, workspace, e-1 bindm = $mainMod, mouse:272, movewindow bindm = $mainMod, mouse:273, resizewindow bindel = ,XF86AudioRaiseVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+ bindel = ,XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%- bindel = ,XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle bindel = ,XF86AudioMicMute, exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle bindel = ,XF86MonBrightnessUp, exec, brightnessctl s 10%+ bindel = ,XF86MonBrightnessDown, exec, brightnessctl s 10%- bindl = , XF86AudioNext, exec, playerctl next bindl = , XF86AudioPause, exec, playerctl play-pause bindl = , XF86AudioPlay, exec, playerctl play-pause bindl = , XF86AudioPrev, exec, playerctl previous windowrulev2 = suppressevent maximize, class:.* windowrulev2 = nofocus,class:^$,title:^$,xwayland:1,floating:1,fullscreen:0,pinned:0 monitor="HEADLESS-2",1920x1080@60,auto,auto ======Config-End======== ```Description
When I try to use Hyprland "headlessly" (without a monitor plugged in), I get some weird things happening. Specifically, there are 3 symptoms: apps not rendering, log error spam, and weird fps results.
Some of my colleagues investigated and found that it seems like Hyprland tries to allocate a GBM bo with GBM_BO_USE_RENDERING and GBM_BO_USE_SCANOUT flags with the linear modifier. Currently, we can not render to a linear buffer.
Symptoms
When I use wayvnc to look at HEADLESS-2, I don't see anything except a gray screen. This error spammed a ton: ``` [ERR] Failed to acquire swapchain buffer for HEADLESS-2 [ERR] renderer: couldn't beginRender()! ``` And, the fps is abnormally low. Here is the output of hyprctl monitors: ``` Monitor HEADLESS-2 (ID 0): 1920x1080@0.06000 at 0x0 description: make: model: serial: active workspace: 1 (1) special workspace: 0 () reserved: 0 0 0 0 scale: 2.00 transform: 0 focused: yes dpmsStatus: 1 vrr: false solitary: 0 activelyTearing: false disabled: false currentFormat: Invalid mirrorOf: none availableModes: 1920x1080@0.06Hz ``` Something like glxgears will run at 1fps, but vkcube will run normally, I think because it doesn't try to sync with the display frame rate. xrandr also shows some weird results: ``` Screen 0: minimum 16 x 16, current 960 x 540, maximum 32767 x 32767 HEADLESS-2 connected 960x540+0+0 (normal left inverted right x axis y axis) 0mm x 0mm 960x540 0.00*+ 640x480 0.00 320x240 0.00 800x500 0.00 768x480 0.00 720x480 0.00 640x400 0.00 320x200 0.00 864x486 0.00 720x400 0.00 640x350 0.00 ```How to reproduce
This should be done on a machine with no display plugged in and an NVIDIA GPU. I was using Arch, but this may repro on other distros as well. Make sure to have at least 3 "terminal windows" open to this machine (A, B, C). Install Hyprland, NVIDIA drivers, seatd In a different terminal (B), run "sudo seatd -u yourusername" Modify ~/.config/hypr/hyprland.conf and replace "monitor=,preferred,auto,auto" with "monitor=HEADLESS-2,3840x2160@60,auto,auto" In your main terminal (A), run "Hyprland" In a different terminal (C). run "systemd-run --user -S". In terminal C, run " hyprctl output create headless HEADLESS-2" You can observe some of the error spam in the main terminal. In terminal C, run "glxgears", and observe some error spam, as well as a much lower than expected frame rate. You can also use vkcube and see the error spam (fps is normal for some reason). If you want, you can open a fourth terminal and run "wayvnc 0.0.0.0 -L trace -o HEADLESS-2" (-L trace optional) with an app running, to notice that the app doesn't show up on wayvnc (it does show up on sway or with an Arc A770). You can also look at hyprctl monitors to see what hyprland thinks the headless output can output (i.e "1920x1080@0.06" or "3840x2560@60"). This does vary per driver version.
Crash reports, logs, images, videos
This is one notable part of the below log that led us to gbm bos:
some specific logs
```sh [TRACE] [AQ] GBM: Allocating a buffer: size [Vector2D: x: 1920, y: 1080], format XR24, cursor: false, multigpu: false, scanout: true [TRACE] [AQ] GBM: Available formats: 2 [TRACE] [AQ] GBM: Using modifier-based allocation, modifiers: 1 [TRACE] [AQ] GBM: | mod 0x0 [ERR] [AQ] GBM: Allocating with modifiers failed, falling back to modifier-less allocation [ERR] [AQ] GBM: Failed to allocate a GBM buffer: bo null [ERR] [AQ] Couldn't allocate a gbm buffer with size [Vector2D: x: 1920, y: 1080] and format XR24 [ERR] [AQ] Swapchain: Failed acquiring a buffer [ERR] output HEADLESS-2 failed basic test on format DRM_FORMAT_XRGB8888 [TRACE] [AQ] GBM: Allocating a buffer: size [Vector2D: x: 1920, y: 1080], format XB24, cursor: false, multigpu: false, scanout: true [TRACE] [AQ] GBM: Available formats: 2 [TRACE] [AQ] GBM: Using modifier-based allocation, modifiers: 1 [TRACE] [AQ] GBM: | mod 0x0 [ERR] [AQ] GBM: Allocating with modifiers failed, falling back to modifier-less allocation [ERR] [AQ] GBM: Failed to allocate a GBM buffer: bo null [ERR] [AQ] Couldn't allocate a gbm buffer with size [Vector2D: x: 1920, y: 1080] and format XB24 [ERR] [AQ] Swapchain: Failed acquiring a buffer [ERR] output HEADLESS-2 failed basic test on format DRM_FORMAT_XBGR8888 [TRACE] [AQ] GBM: Allocating a buffer: size [Vector2D: x: 1920, y: 1080], format INVALID, cursor: false, multigpu: false, scanout: true [TRACE] [AQ] GBM: Available formats: 2 [LOG] [AQ] GBM: Automatically selected format RA30 for new GBM buffer [TRACE] [AQ] GBM: Using modifier-based allocation, modifiers: 1 [TRACE] [AQ] GBM: | mod 0x0 [ERR] [AQ] GBM: Allocating with modifiers failed, falling back to modifier-less allocation [ERR] [AQ] GBM: Failed to allocate a GBM buffer: bo null [ERR] [AQ] Couldn't allocate a gbm buffer with size [Vector2D: x: 1920, y: 1080] and format INVALID [ERR] [AQ] Swapchain: Failed acquiring a buffer [ERR] output HEADLESS-2 failed basic test on format DRM_FORMAT_INVALID [TRACE] [AQ] CHeadlessOutput::scheduleFrame: reason 0, needsFrame true, frameScheduled true [TRACE] [AQ] GBM: Allocating a buffer: size [Vector2D: x: 1920, y: 1080], format INVALID, cursor: false, multigpu: false, scanout: true [TRACE] [AQ] GBM: Available formats: 2 [LOG] [AQ] GBM: Automatically selected format RA30 for new GBM buffer [TRACE] [AQ] GBM: Using modifier-based allocation, modifiers: 1 [TRACE] [AQ] GBM: | mod 0x0 [ERR] [AQ] GBM: Allocating with modifiers failed, falling back to modifier-less allocation [ERR] [AQ] GBM: Failed to allocate a GBM buffer: bo null [ERR] [AQ] Couldn't allocate a gbm buffer with size [Vector2D: x: 1920, y: 1080] and format INVALID [ERR] [AQ] Swapchain: Failed acquiring a buffer [ERR] Couldn't commit output named HEADLESS-2 [LOG] arrangeMonitors: 1 to arrange [LOG] arrangeMonitors: HEADLESS-2 auto [0, 0] [LOG] arrangeMonitors: HEADLESS-2 xwayland [0, 0] [LOG] [CXDGOutputProtocol] updating all xdg_output heads [TRACE] [AQ] CHeadlessOutput::scheduleFrame: reason 6, needsFrame true, frameScheduled true [TRACE] [AQ] CHeadlessOutput::scheduleFrame: reason 6, needsFrame true, frameScheduled true [LOG] Monitor HEADLESS-2 data dump: res 1920x1080@0.06Hz, scale 2.00, transform 0, pos 0x0, 10b 0 ```hyprland.log