tpwrules / nixos-apple-silicon

Resources to install NixOS bare metal on Apple Silicon Macs
MIT License
743 stars 73 forks source link

logging into hyprland with GDM #149

Closed bruhderek closed 4 months ago

bruhderek commented 5 months ago

Logging into hyprland with Gnome login manager does not work. After login, there is a black screen for 0.5 seconds and then it puts me back to login. (so probably a crash)

How to reproduce:

  1. enable GDM and hyprland
  2. login with hyprland
bruhderek commented 5 months ago

Update - This does not work in SDDM as well.

cmacrae commented 5 months ago

hey @ImZedik :) i've noticed issues you're raising/comments you're posting. i would say it's important to consider if the issues you're facing are strictly related to this project.

this issue, for instance, may not have anything to do with the fact that you're using this project to run NixOS. it could easily be something else.

if after consideration you do feel an issue is related to this project, you should include as much detail as possible - like configuration details and certainly logs in the case of failure, that way people can help you.

i do hope this comment is received with the good intention it's written with :) i know demeanour can be hard to interpret over text

bruhderek commented 5 months ago

I provided reproducible steps that would have worked on any other machine, and found no online existing issues. Therefore, I conclude that this issue is related to this project.

On Wed, Jan 24, 2024 at 1:24 AM Calum MacRae @.***> wrote:

hey @ImZedik https://github.com/ImZedik :) i've noticed a couple of the issues you're raising. i would say it's important to consider if the issues you're facing are strictly related to this project.

this issue, for instance, may not have anything to do with the fact that you're using this project to run NixOS. it could easily be something else.

if after consideration you do feel an issue is related to this project, you should include as much detail as possible - like configuration details and certainly logs in the case of failure, that way people can help you.

i do hope this comment is received with the good intention it's written with :) i know demeanour can be hard to interpret over text

— Reply to this email directly, view it on GitHub https://github.com/tpwrules/nixos-apple-silicon/issues/149#issuecomment-1907720143, or unsubscribe https://github.com/notifications/unsubscribe-auth/AUCPDETGINYEJTXMJMDU773YQDHMJAVCNFSM6AAAAABCIAWVMCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMBXG4ZDAMJUGM . You are receiving this because you were mentioned.Message ID: @.***>

cmacrae commented 5 months ago

there are other issues describing similar problems on this project, pertaining to hyperland crashing. have you checked through those discussions for debugging tips/potential fixes?

bruhderek commented 5 months ago

@cmacrae Sorry for the short answer, I was on my phone. I want to clarify that Hyprland works when I launch in a terminal in gnome (with hardware acceleration as well.) When I launch it with SDDM, it gives me this:

[EGL] command: eglQueryDeviceStringEXT, error: EGL_BAD_PARAMETER (0x300c), message: "eglQueryDeviceStringEXT"
[EGL] command: eglQueryDeviceStringEXT, error: EGL_BAD_PARAMETER (0x300c), message: "eglQueryDeviceStringEXT"
[EGL] command: eglQueryDeviceStringEXT, error: EGL_BAD_PARAMETER (0x300c), message: "eglQueryDeviceStringEXT"
[EGL] command: eglQueryDeviceStringEXT, error: EGL_BAD_PARAMETER (0x300c), message: "eglQueryDeviceStringEXT"
[render/egl.c:320] Software rendering detected, please use the WLR_RENDERER_ALLOW_SOFTWARE environment variable to proceed
[render/egl.c:572] Failed to initialize EGL context
[render/gles2/renderer.c:682] Could not initialize EGL
[CRITICAL] m_sWLRRenderer was NULL!
[CRITICAL] Critical error thrown: wlr_gles2_renderer_create_with_drm_fd() failed!

Update: using software rendering works but not without.

diegobfernandez commented 5 months ago

@ImZedik It's helpful to include your entire configuration so others can reproduce it. Simple steps like "enable this and that" are not enough considering so many factors that can interfere with the functioning of software. This is specially true with window managers.

I would also like to point to what @cmacrae said. Please consider if this repository is the appropriate channel to report these issues.

diegobfernandez commented 5 months ago

I just tested GDM and SDDM as display managers with Hyprland. Both works for me, simply by enabling them.

bruhderek commented 5 months ago

I’m doing a fresh Nixos reinstall and seeing if that makes a difference. Are you using the flake or nixos module?

ps. I tried posting an issue on the hyprland github and the dude just said asahi wasn't supported and closed it

On Sat, Jan 27, 2024 at 12:08 PM Diego B. Fernandez < @.***> wrote:

I just tested GDM and SDDM as display managers with Hyprland. Both works for me, simply by enabling them.

— Reply to this email directly, view it on GitHub https://github.com/tpwrules/nixos-apple-silicon/issues/149#issuecomment-1913322609, or unsubscribe https://github.com/notifications/unsubscribe-auth/AUCPDEXHS2DSSPWOWNMWCVTYQVNCBAVCNFSM6AAAAABCIAWVMCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMJTGMZDENRQHE . You are receiving this because you were mentioned.Message ID: @.***>

bruhderek commented 5 months ago

@diegobfernandez Just did a fresh reinstall, and it's still crashing. Are you using the flake module? Heres my config:

# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page, on
# https://search.nixos.org/options and in the NixOS manual (`nixos-help`).

{ config, lib, pkgs, ... }:

{
  imports =
    [ # Include the results of the hardware scan.
      ./hardware-configuration.nix
      ./apple-silicon-support
    ];

  # Use the systemd-boot EFI boot loader.
  boot.loader.systemd-boot.enable = true;
  boot.loader.efi.canTouchEfiVariables = false;

  # networking.hostName = "nixos"; # Define your hostname.
  # Pick only one of the below networking options.
  # networking.wireless.enable = true;  # Enables wireless support via wpa_supplicant.
  # networking.networkmanager.enable = true;  # Easiest to use and most distros use this by default.

  # Set your time zone.
  time.timeZone = "America/Los_Angeles";

  # Configure network proxy if necessary
  # networking.proxy.default = "http://user:password@proxy:port/";
  # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";

  # Select internationalisation properties.
  # i18n.defaultLocale = "en_US.UTF-8";
  # console = {
  #   font = "Lat2-Terminus16";
  #   keyMap = "us";
  #   useXkbConfig = true; # use xkb.options in tty.
  # };

  # Enable the X11 windowing system.
  services.xserver.enable = true;
  services.xserver.desktopManager.gnome.enable = true;
  services.xserver.displayManager.sddm = {
    enable = true;
    #wayland = true;
  };

  hardware.asahi.peripheralFirmwareDirectory = ./firmware;

  boot.extraModprobeConfig = ''
    options hid_apple iso_layout=0
 '';

  networking.wireless.iwd = {
    enable = true;
    settings.General.EnableNetworkConfiguration = true;
  };

  hardware.asahi = {
    withRust = true;
    addEdgeKernelConfig = true;
    useExperimentalGPUDriver = true;
    experimentalGPUInstallMode = "replace";
    setupAsahiSound = true;
  };
  hardware.opengl.enable = true;

  programs.hyprland.enable = true;

  # Configure keymap in X11 services.xserver.xkb.layout = "us"; services.xserver.xkb.options = "eurosign:e,caps:escape";

  # Enable CUPS to print documents.
  # services.printing.enable = true;

  # Enable sound.
  # sound.enable = true;
  # hardware.pulseaudio.enable = true;

  # Enable touchpad support (enabled default in most desktopManager).
  # services.xserver.libinput.enable = true;

  # Define a user account. Don't forget to set a password with ‘passwd’.
  users.users.derek = {
    isNormalUser = true;
    extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user.
    packages = with pkgs; [
      firefox
      tree
    ];
  };

  # List packages installed in system profile. To search, run:
  # $ nix search wget
  # environment.systemPackages = with pkgs; [
  #   vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
  #   wget
  # ];

  # Some programs need SUID wrappers, can be configured further or are
  # started in user sessions.
  # programs.mtr.enable = true;
  # programs.gnupg.agent = {
  #   enable = true;
  #   enableSSHSupport = true;
  # };

  # List services that you want to enable:

  # Enable the OpenSSH daemon.
  # services.openssh.enable = true;

  # Open ports in the firewall.
  # networking.firewall.allowedTCPPorts = [ ... ];
  # networking.firewall.allowedUDPPorts = [ ... ];
  # Or disable the firewall altogether.
  # networking.firewall.enable = false;

  # Copy the NixOS configuration file and link it from the resulting system
  # (/run/current-system/configuration.nix). This is useful in case you
  # accidentally delete configuration.nix.
  # system.copySystemConfiguration = true;

  # This option defines the first version of NixOS you have installed on this particular machine,
  # and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions.
  #
  # Most users should NEVER change this value after the initial install, for any reason,
  # even if you've upgraded your system to a new NixOS release.
  #
  # This value does NOT affect the Nixpkgs version your packages and OS are pulled from,
  # so changing it will NOT upgrade your system - see https://nixos.org/manual/nixos/stable/#sec-upgrading for how
  # to actually do that.
  #
  # This value being lower than the current NixOS release does NOT mean your system is
  # out of date, out of support, or vulnerable.
  #
  # Do NOT change this value unless you have manually inspected all the changes it would make to your configuration,
  # and migrated your data accordingly.
  #
  # For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion .
  system.stateVersion = "24.05"; # Did you read the comment?

}
diegobfernandez commented 5 months ago

I am NOT using flakes.

Based on your config, here are a couple of question and things for you to try:

bruhderek commented 5 months ago
  1. yes, with hardware acceleration as well.
  2. no
  3. idk. are you using it?
  4. will try
  5. Hyprland never worked.

Can you share your config?

bruhderek commented 5 months ago

@diegobfernandez kernel logs are empty.

cmacrae commented 5 months ago

@ImZedik i'd really like to implore you to lean on searching the github issues on this project and putting in a bit more time debugging. i appreciate you may be new to nix/nixos, but i don't feel that really excuses what seems to be a pretty significant lack of effort. i'm genuinely not intending this as any sort of personal attack; i just think it would be really useful for you and your future with nixos to be able to be resourceful when you need it.

further to that, open source is built on communities. people give their time freely to these projects out of passion. when you engage in an open source community, you should maybe take some time to consider how you're representing yourself. being candid, so far the picture you've painted is that you want to use tools that you haven't put the time into understanding, and rather than reading documentation and putting in effort to debug and learn, you're expecting people of this community to debug for you and just give you the answer. perhaps i'm wrong, that's just based off issues/comments you've raised on this project.

yesterday, i installed nixos on my m2 macbook air. i encountered a crash with hyprland when trying to launch too. from first experiencing that crash, to having it working took me 5 minutes. granted i likely have more experience than you with nixos, but honestly all i did was use the issue search, read the comments, and try things.

there are plenty of useful issues logged regarding hyprland and issues with configuration/crashing.

okay, now the lecture is out of the way 🙃 here are the relevant snippets of my configuration that got hyprland working for me (i'm using a flake, like you):

hardware.opengl.enable = true;
hardware.asahi = {
  peripheralFirmwareDirectory = ./firmware;
  addEdgeKernelConfig = true;
  useExperimentalGPUDriver = true;
  experimentalGPUInstallMode = "replace";
  withRust = true;
};

# @ImZedik don't just blindly copy/paste this, the reference for the
# overlay in your config will very likely be different as it depends how
# you imported/expose it to your configs
nixpkgs.overlays = [
  inputs.nixos-apple-silicon.overlays.apple-silicon-overlay
];

services.xserver.enable = true;
services.xserver.displayManager.sddm.enable = true;
services.xserver.displayManager.sddm.wayland.enable = true;

programs.hyprland.enable = true;

i realise this configuration pretty much mimics yours (the important parts, anyway), but I'm sharing for brevity.
what fixed my crash was changing the experimentalGPUInstallMode. this can be replace, driver, or overlay. I'd suggest you try each one.

one thing i've noticed is that you've mentioned launching hyprland from within gnome - i'd advise against that. if you want to use hyprland as your wayland compositor, that should be launching on its own; either from a TTY just running Hyprland or with a display manager (like SDDM).

i also don't see any configuration of overlays in your config, but perhaps you're managing that in your flake.nix? if not, you'll want to make sure you're using this project's overlay as it'll have important changes to packages to make them work with apple silicon architectures.

when you build & switch your configuration in your flake, are you using the --impure flag? as i see, you're using the replace option for the gpu firmware install, which should be forcing you to do so. but if not, make sure you're doing something like this:

$ cd where/you/keep/your/flake
$ sudo nixos-rebuild switch --impure --flake .

do you have your flake repo published anywhere? that might be useful to see. if not, maybe share your flake.nix too.

bruhderek commented 5 months ago

Hi macRae, I’m sorry for your frustration. I understand that I may not have as much experience, but I am trying to learn as much as I can about nixos and hyprland. For the past week I have been looking for a fix to my problem but haven’t found one yet. Furthermore, I would like to ask you whether the error you got was the same as mine or something different. btw, my nixos config is https://github.com/ImZedik/nixos-config/tree/master if that helps

On Wed, Jan 31, 2024 at 2:06 AM Calum MacRae @.***> wrote:

@ImZedik https://github.com/ImZedik i'd really like to implore you to lean on searching the github issues on this project and putting in a bit more time debugging. i appreciate you may be new to nix/nixos, but i don't feel that really excuses what seems to be a pretty significant lack of effort. i'm genuinely not intending this as any sort of personal attack; i just think it would be really useful for you and your future with nixos to be able to be resourceful when you need it.

further to that, open source is built on communities. people give their time freely to these projects out of passion. when you engage in an open source community, you should maybe take some time to consider how you're representing yourself. being candid, so far the picture you've painted is that you want to use tools that you haven't put the time into understanding, and rather than reading documentation and putting in effort to debug and learn, you're expecting people of this community to debug for you and just give you the answer. perhaps i'm wrong, that's just based off issues/comments you've raised on this project.

yesterday, i installed nixos on my m2 macbook air. i encountered a crash with hyprland when trying to launch too. from first experiencing that crash, to having it working took me 5 minutes. granted i likely have more experience than you with nixos, but honestly all i did was use the issue search, read the comments, and try things.

there are plenty of useful issues https://github.com/tpwrules/nixos-apple-silicon/issues?q=hyprland logged regarding hyprland and issues with configuration/crashing.

okay, now the lecture is out of the way 🙃 here are the relevant snippets of my configuration that got hyprland working for me (i'm using a flake, like you):

hardware.opengl.enable = true;hardware.asahi = { peripheralFirmwareDirectory = ./firmware; addEdgeKernelConfig = true; useExperimentalGPUDriver = true; experimentalGPUInstallMode = "replace"; withRust = true;}; services.xserver.enable = true;services.xserver.displayManager.sddm.enable = true;services.xserver.displayManager.sddm.wayland.enable = true; programs.hyprland.enable = true;

i realise this configuration pretty much mimics yours (the important parts, anyway), but I'm sharing for brevity. what fixed my crash was changing the experimentalGPUInstallMode. this can be replace, driver, or overlay. I'd suggest you try each one.

one thing i've noticed is that you've mentioned launching hyprland from within gnome - i'd advise against that. if you want to use hyprland as your wayland compositor, that should be launching on its own; either from a TTY just running Hyprland or with a display manager (like SDDM).

when you build & switch your configuration in your flake, are you using the --impure flag? as i see, you're using the replace option for the gpu firmware install, which should be forcing you to do so. but if not, make sure you're doing something like this:

$ cd where/you/keep/your/flake $ sudo nixos-rebuild switch --impure --flake .

do you have your flake repo published anywhere? that might be useful to see. if not, maybe share your flake.nix too.

— Reply to this email directly, view it on GitHub https://github.com/tpwrules/nixos-apple-silicon/issues/149#issuecomment-1918782217, or unsubscribe https://github.com/notifications/unsubscribe-auth/AUCPDEURBG3MKN5AHKOGTUDYRIJQVAVCNFSM6AAAAABCIAWVMCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMJYG44DEMRRG4 . You are receiving this because you were mentioned.Message ID: @.***>

bruhderek commented 5 months ago

update: I ended up installing arch which worked flawlessly. Thanks anyways!!

cmacrae commented 5 months ago

@ImZedik please close this issue