Hyprland/WLRoots could not find GPU

Hi there. I am refactoring my repo to use Hyprland.

Now, when I did the rebuild and tried to log in, Hyland crashed. I went into the logs and found the following:

[CRITICAL] m_sWLRRenderer was NULL! This usually means wlroots could not find a GPU or encountered some issues.
[CRITICAL] Critical error thrown: wlr_gles2_renderer__create_with_drm_fd() failed!

I have an Nvidia GPU on my host.

Few questions:

  1. Has anyone seen this before?
  2. Does Hyprland “need” a GPU? I swear I had tested it on my old laptop without a GPU.

Thank you.

Yes, your old laptop likely had a GPU (although it may have been an integrated GPU that was a subcomponent of your CPU).

Yes, iirc it was an incompatibility with an nvidia driver for a while that I tracked down to a bug in wlroots which had already been fixed but not updated for hyprland since it pinned an older version of wlroots for one reason or another. This is probably a solid 6 months ago now, though, so I doubt it’s what’s wrong in your case. I’ve switched to sway in any case (other reasons, I think at the time I just downgraded my driver, to anyone chiming in let’s stay faaaar away from discussing those other reasons), so couldn’t tell you if it’s still broken. What NixOS version are you running?

If you’re also on nvidia, literally wait about a month and consider switching to wayland only when the next beta driver and all the wayland explicit sync changes have merged (and been packaged for NixOS, likely will need unstable at least until May/June). You’ll have a much better (read: not inherently broken) experience.

2 Likes

Do you by chance know which driver version this is coming in on?

Thank you so much.

I’ve been on holiday for a bit, instead of monitoring nvidia driver bugs I’ve been spending my days on the beach - so I’m a tad out of date!

Last news was the next beta driver, which is either already out or like a week or so off.

That said, changes in wayland/wlroots/X will need to land as well before any of this works, and all of this needs to make its way into nixpkgs. I’d suspect most of that hasn’t happened yet, and we may be waiting for 24.11 for it all to hit stable.

1 Like

Still experiencing this crash on a gtx 1060. I am using the latest nixpkgs/nixos-unstable flake input.

Relevant parts of my config:

{config, pkgs, ...}: {
  boot.kernelPackages = pkgs.linuxPackages_latest;
  nixpkgs.config.allowUnfree = true;

  programs.hyprland.enable = true;

  hardware.graphics.enable = true;
  services.xserver.videoDrivers = ["nvidia"];

  hardware.nvidia = {
    modesetting.enable = true;
    open = false;
    package = config.boot.kernelPackages.nvidiaPackages.beta;
  };

  system.stateVersion = "23.11";
}

I think you might be out of luck with hyprland for the foreseeable, they won’t be implementing any new wlroots apis since they’re abandoning it as a backend. Very in tune with that community. You might be able to downgrade to a version still on an older wlroots, but I don’t have a snippet ready for that.

For other wlroots compositors, support is not yet done, but seems close?

1 Like

This works for me on kernel 6.9.7:

{
  boot.kernelParams = [ "nvidia-drm.fbdev=1" ];
  hardware.graphics.enable = true;
  services.xserver.videoDrivers = ["nvidia"];

  hardware.nvidia = {
    modesetting.enable = true;
    powerManagement.enable = true;
    forceFullCompositionPipeline = true;
    open = false;
    nvidiaSettings = true;
    package = config.boot.kernelPackages.nvidiaPackages.beta;
  };
}

Key thing for me was the fbdev kernel param.
Source: https://www.reddit.com/r/hyprland/comments/1cva5g8/latest_version_crashing_on_nvidia/
The source talks about downgrading the kernel but when I found the fbdev option I didn’t investigate further.

3 Likes