Greetd/agreety seems to launch before iGPU is ready

For a few weeks, my wayland window managers crash when i run them like this:

  services.greetd = {
    enable = true;
    settings = {
      initial_session = {
        # command = "${pkgs.bashInteractive}/bin/bash -c 'sleep 3 && hyprland'";
        command = "${pkgs.hyprland}/bin/hyprland";
        user = "sperber";
      };
      default_session = {
        command = ''${pkgs.greetd.tuigreet}/bin/tuigreet --user-menu'';
      };
    };
  };

The hyprland log mentions that no GPU is available during the initial launch. With the configuration above, tuigreet comes up as a fallback and it works from then on. The same happens with niri window manager.

I figured out that it works if i delay the launch of hyprland/niri by about 3 seconds (the commented out line in my config). I found this thread but didn’t find a similar option for agreety.

I wonder what the reason for this problem is and how i can solve it?

Well you might have to search for systemd launch service when device is ready - Google Suche. Or you have to find a command which waits until GPU is accessible and exits, and add it as a required service for greetd…

By the way, what GPU are you using?

I’m using the onboard GPU of an i5-11600 processor. The delay in being ready occurs when a second monitor is plugged in (i just realised that this was when the problem started). As long as there is only one monitor plugged in, there is no problem.

I’ve asked on the greetd mailing list if they have an idea.