Skip to content
This repository has been archived by the owner on Nov 1, 2021. It is now read-only.

Disappearing cursor on multi-GPU setup #3030

Closed
IntinteDAO opened this issue Jun 27, 2021 · 18 comments · Fixed by #3033
Closed

Disappearing cursor on multi-GPU setup #3030

IntinteDAO opened this issue Jun 27, 2021 · 18 comments · Fixed by #3033

Comments

@IntinteDAO
Copy link

The mouse is on button (it changed a color, but invisible)
20210627_22h03m11s_grim

Here the mouse is near the menu, but also invisible)
20210627_22h03m20s_grim

@emersion
Copy link
Member

The debug logs look incomplete and only includes errors. Please submit a complete debug log.

@IntinteDAO
Copy link
Author

@emersion emersion changed the title Disappearing cursor Disappearing cursor on multi-GPU setup Jun 29, 2021
@emersion
Copy link
Member

00:00:00.671 [DEBUG] [wlr] [render/gbm_allocator.c:197] Created GBM allocator with backend drm
00:00:00.671 [DEBUG] [wlr] [render/gbm_allocator.c:200] Using DRM node /dev/dri/card1
00:00:00.671 [DEBUG] [wlr] [render/swapchain.c:105] Allocating new swapchain buffer
00:00:00.672 [DEBUG] [wlr] [render/gbm_allocator.c:128] Allocated 256x256 GBM buffer (format 0x34325241, modifier 0x200000000000901)
00:00:00.672 [DEBUG] [wlr] [render/gles2/renderer.c:138] Created GL FBO for buffer 256x256
00:00:00.672 [ERROR] [wlr] [EGL] command: eglCreateImageKHR, error: EGL_BAD_ALLOC (0x3003), message: "dri2_create_image_khr_texture"
00:00:00.672 [ERROR] [wlr] [render/egl.c:588] eglCreateImageKHR failed
00:00:00.672 [ERROR] [wlr] [render/gles2/texture.c:337] Failed to create EGL image from DMA-BUF
00:00:00.672 [DEBUG] [wlr] [types/wlr_output.c:1393] Falling back to software cursor on output 'HDMI-A-1'

@AToMiXhawK
Copy link

Same problem here after updating to version 1.6.1 on archlinux (wlroots 0.14).

@emersion
Copy link
Member

emersion commented Jul 5, 2021

Can you try #3021?

@IntinteDAO
Copy link
Author

Now on start sway I have no cursor, wdisplays restores it, but it disappears if I start wofi (so nothing has changed here).

New log:
https://0bin.net/paste/cCOY5Ep0#Nc-ZNl06MGzVi542bay5isg4bZrXhM5BUmE1hWmxPhD

@emersion
Copy link
Member

emersion commented Jul 5, 2021

OK. The errors are the same.

Do you have anything in dmesg, btw?

@emersion
Copy link
Member

emersion commented Jul 5, 2021

Does WLR_DRM_NO_MODIFIERS=1 help by any chance?

@IntinteDAO
Copy link
Author

IntinteDAO commented Jul 5, 2021

  1. sway[1791]: segfault at 0 ip 00007f00b3f83b83 sp 00007ffcff96c7e8 error 6 in libwayland-server.so.0.1.0[7f00b3f7d000+8000]
    sway[4298]: segfault at 75 ip 00007fa204289b83 sp 00007ffe84789ac8 error 6 in libwayland-server.so.0.1.0[7fa204283000+8000]
  2. Partially yes. On startup there is no cursor - (regression), but once I start wdisplays the cursor returns and does not disappear, so success

@nwg-piotr
Copy link

nwg-piotr commented Jul 5, 2021

Same here, with and without WLR_DRM_NO_MODIFIERS=1.

wdisplays (didn't even know it existed) makes cursor appear on external displays, but after I close it, and e.g. open/close Firefox, cursor disappears again. Setting WLR_DRM_NO_MODIFIERS=1 changes nothing.

@AToMiXhawK

This comment has been minimized.

@emersion
Copy link
Member

emersion commented Jul 6, 2021

@AToMiXhawK, you have a different bug, fixed in wlroots master.

@emersion
Copy link
Member

emersion commented Jul 8, 2021

Does this wlroots patch help by any chance? https://l.sr.ht/-ZAc.txt

emersion added a commit to emersion/wlroots that referenced this issue Jul 8, 2021
Some buffers need to be copied across GPUs. Such buffers need to be
allocated with a format and modifier suitable for both the source
and the destination.

When explicit modifiers aren't supported, we were forcing the buffers
to be allocated with a linear layout, because implicit modifiers
aren't portable across GPUs. All is well with this case.

When explicit modifiers are supported, we were advertising the whole
list of destination modifiers, in the hope that the source might
have some in common and might be able to allocate a buffer with a
more optimized layout. This works well if the source supports explicit
modifiers. However, if the source doesn't, then wlr_drm_format_intersect
will fallback to implicit modifiers, and everything goes boom: the
source uses a GPU-specific tiling and the destination interprets it
as linear.

To avoid this, just force linear unconditionally. We'll be able to
revert this once we have a good way to indicate that an implicit modifier
isn't supported in wlr_drm_format_set, see [1].

[1]: swaywm#2815

Closes: swaywm#3030
@emersion emersion added this to the 0.14.1 milestone Jul 8, 2021
@IntinteDAO
Copy link
Author

IntinteDAO commented Jul 8, 2021

Does this wlroots patch help by any chance? https://l.sr.ht/-ZAc.txt

For me - works great! But it's nice to check @nwg-piotr also

@nwg-piotr
Copy link

check @nwg-piotr also

I'll check as soon as I'm back home.

@nwg-piotr
Copy link

nwg-piotr commented Jul 8, 2021

Works for me, too. Excellent news!

@emersion
Copy link
Member

emersion commented Jul 8, 2021

Thanks for testing!

emersion added a commit that referenced this issue Jul 8, 2021
Some buffers need to be copied across GPUs. Such buffers need to be
allocated with a format and modifier suitable for both the source
and the destination.

When explicit modifiers aren't supported, we were forcing the buffers
to be allocated with a linear layout, because implicit modifiers
aren't portable across GPUs. All is well with this case.

When explicit modifiers are supported, we were advertising the whole
list of destination modifiers, in the hope that the source might
have some in common and might be able to allocate a buffer with a
more optimized layout. This works well if the source supports explicit
modifiers. However, if the source doesn't, then wlr_drm_format_intersect
will fallback to implicit modifiers, and everything goes boom: the
source uses a GPU-specific tiling and the destination interprets it
as linear.

To avoid this, just force linear unconditionally. We'll be able to
revert this once we have a good way to indicate that an implicit modifier
isn't supported in wlr_drm_format_set, see [1].

[1]: #2815

Closes: #3030
emersion added a commit that referenced this issue Jul 8, 2021
Some buffers need to be copied across GPUs. Such buffers need to be
allocated with a format and modifier suitable for both the source
and the destination.

When explicit modifiers aren't supported, we were forcing the buffers
to be allocated with a linear layout, because implicit modifiers
aren't portable across GPUs. All is well with this case.

When explicit modifiers are supported, we were advertising the whole
list of destination modifiers, in the hope that the source might
have some in common and might be able to allocate a buffer with a
more optimized layout. This works well if the source supports explicit
modifiers. However, if the source doesn't, then wlr_drm_format_intersect
will fallback to implicit modifiers, and everything goes boom: the
source uses a GPU-specific tiling and the destination interprets it
as linear.

To avoid this, just force linear unconditionally. We'll be able to
revert this once we have a good way to indicate that an implicit modifier
isn't supported in wlr_drm_format_set, see [1].

[1]: #2815

Closes: #3030
(cherry picked from commit d71ed63)
@nwg-piotr
Copy link

nwg-piotr commented Jul 8, 2021

Just for curiosity: average CPU load measured on idle in the same conditions. Ryzen 7 + hybrid AMD graphics w/ 2 external displays.

version CPU load MEM usage
0.12.0 1.88% 490 MiB
0.13.0 3.50% 435 MiB
0.14.0 3.15% 433 MiB
0.14.1 2.82% 435 MiB

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

Successfully merging a pull request may close this issue.

4 participants