Open 2m opened 5 years ago
Did a bit more testing. Hopefully this will be useful.
I have noticed the following on both - the 1.1.1
and on the latest master. I was running sway with WLR_DRM_DEVICES=/dev/dri/card1:/dev/dri/card0
(nouveau first, i915 second).
The slowness depend on the resolution of the external monitor. When running the external monitor at 4k@60Hz sway is almost unusable. Mouse moves very choppy and it takes a while for any new windows to pop up (like the quit confirmation window).
However when configuring external monitor to be 1920x1080@60Hz its gets better. Mouse movement is almost fine, except it stutters for a bit periodically every one second. Also when switching from one monitor to another it takes around 5-6 seconds for the mouse to become responsive.
While not the same laptop (Lenovo X1E) it's external outputs are similarly wired through dGPU (1050ti Max Q) and I've noticed the same crash and cursor choppiness when connected to external at 4k@60hz
Most likely the slow cursor is due to dGPU stuck at lowest frequencies as nouveau has bad support for even previous gen GPUs when ran in hybrid mode, at least if the nouveau page to be believed, it would explain why performance gets better when lowering resolution.
Tried with the latest nouveau drivers from 5.2.0
, still the same crash without a meaningful coredump.
Same results with WLR_DRM_NO_ATOMIC=1
as well.
Also noticed that even when sway successfully starts with WLR_DRM_DEVICES=/dev/dri/card0
(i915 card) and then the HDMI cable is inserted, sway crashes.
Most likely the slow cursor is due to dGPU stuck at lowest frequencies as nouveau has bad support for even previous gen GPUs when ran in hybrid mode, at least if the nouveau page to be believed, it would explain why performance gets better when lowering resolution.
I would have thought that merely pushing frames to an output would not require high clock rates - perhaps there is something else taking up time?
You can attach gdb to running processes (e.g. sway) with gdb
and then attach <PID>
. If you do that from a TTY you can pause the sway process in these slow times with p
and get some sort of sample of what it's doing with bt
/bt full
(assuming debug symbols are present on all linked binaries, e.g. sway, wlroots, nouveau, mesa). Look up instructions for your distro on how to compile packages from source with debug symbols.
I'd love to help but I don't have any of these machines (I'm interested in buying one though). As much as I'd love to avoid Nvidia its almost impossible to find a 45W CPU on a laptop without Nvidia GPU.
@hedgepigdaniel I am a total noob when it comes to any low-level stuff so the assumption of frequency affecting the performance of the output signal is a conclusion I came into after seeing the result. That being said, thx for the tip about 'gdb' I will try to spend coming weekend debugging if I manage to get sway to properly start with dGPU in hybrid mode as it does crash atm.
Sure. It will probably be easier to install debug symbols and get a stacktrace for the crash you're experiencing first - that way you can read the stacktrace after the fact - so you won't have to switch TTYs like with GDB. Depending on your distro you can probably use coredumpctl (systemd) to get them.
When I connect an external monitor to my laptop, sway does not start. It crashes immediately after printing out environment variables. I am starting sway with the following env variable:
My laptop has two GPU cards:
i915
driver, has laptop monitor connected to itnouveau
driver, has all the other external ports connected to itIf I swap the card0 and card1 in
WLR_DRM_DEVICES
then sway starts, but it is running quite slow. Mouse movement is a bit choppy on the laptop screen, but when the mouse moves to the external screen, sway becomes very unresponsive - 1 frame every couple of seconds or so.I am running sway from master, but I also noticed the same behaviour when running latest released version.
Yesterday, with some awesome help in the #sway IRC channel, we tried to get a useful coredump, but it seems to lack interesting information. I attach it here nevertheless: