I have a problem where sometimes, when logging in with gdm into sway (actually volare), there is a quick flash and then my display goes dark, requiring a reboot.
The flash appears very briefly, and appears to be a full-width horizontal white ‘band’ about half the screen in height.
It seems to mainly happen when I log in ‘too quickly’ after gdm appears, though not consistently.
It recently(ish) started happening on resume (from systemctl suspend) as well.
When this happens switching vts with ctrl+alt+f1 also no longer works.
There is a lot of ‘stuff’ in the logging, but I haven’t found anything that is clearly correlated yet.
I realize this is not really enough information to properly diagnose the issue (I’ll amend this post as I learn more), but wanted to already share this in case someone recognizes it or can help narrow it down. I’m on nixos-unstable and switched to linuxPackages_latest without luck.
I am a newbie. I am here just because I may have same condition so my solution may help.
I am also using sway. And there are two GPUs in my laptop. For some reason, sway will just ignore my iGPU and use dGPU which is NVIDIA GPU even if my gpu_mux_mode is 1. (About gpu_mux_mode, you will see details later). And if I use nouveau instead of proprietary driver, freeze will happen randomly.
And my solution here:
Install the proprietary driver.
Use a script to wrap sway, specifying it to use the iGPU when my gpu_mux_mode is 1. (This mode means both iGPU and dGPU will be enabled. For mode 0, only dGPU will be enabled.)
Adopt the script solution on this page. This will allow me to enable the dGPU only for high-performance tasks, sparing the poor Intel Iris GPU from bearing a load it shouldn’t have to carry.
These three steps were not conceived simultaneously; the first was the one I initially thought of and implemented. Therefore, before proposing the second step—the encapsulation solution, I ran sway using the --unsupported-gpu option. Although it hasn’t been running for long, no issues have been encountered. It appears this proprietary driver was working well.
My wrapper script looks like this:
services.greetd.settings.default_session.command = lib.mkIf config.services.greetd.enable (
let
sway-launcher = pkgs.writeShellScript "sway-launcher" ''
GPU_MUX_MODE=$(cat /sys/devices/platform/asus-nb-wmi/gpu_mux_mode 2>/dev/null)
case "$GPU_MUX_MODE" in
1)
INTEL_CARD=$(for card in /dev/dri/card*; do
if [ "$(cat /sys/class/drm/$(basename $card)/device/vendor 2>/dev/null)" = "0x8086" ]; then
echo $card
break
fi
done)
WLR_DRM_DEVICES="$INTEL_CARD" exec systemd-run --user --scope --unit=sway sway
;;
0) # if gpu mux mode is 0. Only dGPU enabled. iGPU will be ignore.
exec systemd-run --user --scope --unit=sway sway --unsupported-gpu
;;
*)
exit 0
;;
esac
'';
in
"${pkgs.tuigreet}/bin/tuigreet --time --cmd ${sway-launcher} --user-menu --user-menu-min-uid 1000"
);
And finally, I have something to say. I feel your post is a bit vague. Perhaps at least you could specify which GPU and driver you’re using to run Sway. Your title may imply you’re using an NVIDIA GPU with the nouveau driver. But your post doesn’t explicitly mention this. I think you could make it clearer instead of leaving people to guess.
If my earlier guess about your situation is correct, my recommendation will be, if you have an iGPU, let Sway use it. Otherwise, try the proprietary driver. At least in my case, Nouveau performed terribly. It should have retired after lighting up my monitor. For more info about installing proprietary driver, check this page.
I’m not interested in running proprietary drivers.
When I set boot.blacklistedKernelModules = [ "nouveau" ]; I can confirm it no longer gets loaded, and I can still reproduce the problem.
When I set boot.blacklistedKernelModules = [ "i915" ]; Display Manager doesn’t start anymore at all
.gnome-shell-wr[9120]: Thread 'KMS thread' will be using high priority scheduling
.gnome-shell-wr[9120]: Device '/dev/dri/card1' prefers shadow buffer
.gnome-shell-wr[9120]: Added device '/dev/dri/card1' (nouveau) using non-atomic mode setting.
.gnome-shell-wr[9120]: Failed to open gpu '/dev/dri/card0': GDBus.Error:System.Error.EBUSY: Device or resource busy
org.gnome.Shell.desktop[9120]: Failed to setup: No GPUs with outputs found
though I can start the windowmanager manually from the tty just fine.
I have to say I am just confused now. This issue appears to be complex for a newbie like me.
Seems that sway is just using your iGPU and ignoring dGPU according to this:
And I noticed this:
Maybe you could try disabling the sleep/suspend/hibernate features. I would turn those off on all devices as they can cause some weird things. But you also said this didn’t just happen when recovering from these states. So I’m not sure if this is helpful. Also, I found some info may help in arch wiki and gentoo wiki.
I am afraid I can’t suggest anymore . Good luck.