Open mruediger opened 4 years ago
By default, it's likely that your iGPU is selected as the "primary" GPU which actually does all of the rendering, leaving the RX580 basically underutilized.
Try launching sway with WLR_DRM_DEVICES=/dev/dri/card1:/dev/dri/card0
to swap them around.
Note that doing so will cause frames displayed on the internal screen to do a roundtrip between the iGPU and the eGPU. Generally laptop eGPUs have less bandwidth available, so this could be an issue when using WLR_DRM_DEVICES=/dev/dri/card1:/dev/dri/card0
.
I don't get why you have 60FPS on the internal screen but not on the eGPU's screen. We just render everything on the first GPU (the iGPU if you don't set WLR_DRM_DEVICES
) and copy the frame to other GPUs.
Since you get 60FPS on the internal screen, you should also get 60FPS on the external screen: the only difference is a copy to the eGPU.
That copy could be slow as hell, making us miss vblank (possibly multiple) and we'll get fewer page flips, meaning fewer frame callbacks, meaning less FPS. The DRM backend multi-GPU code really needs to take damage into account.
Ah, right, that's a good point, haven't thought about damage. We should also allow DMA-BUFs to be directly scanned out, since the iGPU uses RAM for buffers it should just work in this case.
(And also other fallback mechanisms mentioned in https://gitlab.freedesktop.org/wayland/weston/issues/76)
Thanks @ascent12 and @emersion. I honestly didn't expect a reaction that quickly.
Swapping the GPUs did what you predicted. I now have ~60fps on my external but only ~18fps on my internal GPU. If I understand it correctly, the content is rendered on my eGPU now and than copied back to my iGPU using only the few PCIe lanes dedicated to Thunderbolt and hence the stuttering.
The question now is what Gnome/Mutter does differently.
The question now is what Gnome/Mutter does differently.
This comment explains what Mutter does: https://gitlab.freedesktop.org/wayland/weston/issues/76#note_239702
Just saw that as well. Sorry for commenting without reading the issue first. I will take a dive into it. Thank you!
No worries.
For reference, the current multi-GPU copy code is here: https://github.com/swaywm/wlroots/blob/master/backend/drm/renderer.c#L258
Is there any news related to implementing other multi-GPU copy strategy that could improve performance?
Edit: it seems this PR should improve the situation a lot https://github.com/swaywm/wlroots/pull/2133
I'm wondering the same thing.
How do you display the fps in sway?
I can confirm I also experience this issue with 2 AMD gpus. It's very obvious even on the desktop.
FIXED: Installed wlroots-git and sway-git, restarted the session and now the issue is gone! EDIT: It seem to improve the issue, but it's still there.
I tested with the RX 550 as main GPU and the 6700 as the secondary one, and I don't have the issue. It seems it's necessary to use two of the same GPU (or a slightly more powerful secondary one?) for optimal results.
This is for gaming, mostly. For video and productivity, about any GPU will do just fine.
Getting something like this as well.
Measurement methods:
Results:
WLR_DRM_DEVICES
), I get 15–20 fps on bothI also have a similar issue with a thunderbolt-connected egpu. My setup: Intel graphics laptop, Fedora, Wayland, thunderbolt epgu with Radeon graphics and an HDMI output connected to an egpu. This setup works fine (i.e. I can offload compute tasks to egpu for example) but the desktop performance of the external screen is not great and visually below 30fps. 3D benchmarks show low scores in line with user expereince.
Frankly speaking, this issue was there for quite a while (one or two Fedora upgrades). I am just wondering if there is any movement here. My temporary "solution" is to reboot and disable intel graphics completely via unloading the kernel module i915.modeset=0
. This also makes my laptop screen unusable.
UPD: glxgears report 90fps for the internal screen (expected) and 30fps for the HDMI output (I expect it to be 60fps). Setting to "mirror displays" will make it close to 45fps. Not sure if it is expected. Visually either setting looks poorly.
Sway Version: da0ad4c39ed91c0d485b3d519ad1631ea6a46ba2 (nixos + sway overlay https://github.com/colemickens/nixpkgs-wayland)
Debug Log: https://gist.github.com/mruediger/8168a032242d526ffe36a37aab4e3b1d
Configuration File: https://gist.github.com/mruediger/8ca73c7872d9a62c6b5ea901655ccb4a
I am using sway on my Laptop with an attached eGPU Radeon RX 580.The display attached to my eGPU feels very laggy. Running glxgears shows me ~16fps on my second display while the builtin display using the Intel card gives me ~60fps. I can only reproduce this on sway. Gnome, also with wayland, gives me 60fps on both displays.
I would love to track down the differences between Gnome and sway, but I don't know where to start.