Hyprland not starting after upgrading to NixOS 24.05

I just upgraded to NixOS 24.05 and Hyprland won’t start anymore with the following error message:

[render/gles2/renderer.c:600] GPU reset notifications are enabled
[render/allocator/allocator.c:105] Trying to create gbm allocator
[render/allocator/gbm.c:254] Created GBM allocator with backend drm
[render/allocator/gbm.c:257] Using DRM node /dev/dri/card1
[render/egl.c:205] Supported EGL client extensions: EGL_EXT_platform_base EGL_EXT_device_base EGL_EXT_device_enumeration EGL_EXT_device_query EGL_KHR_client_get_all_proc_addresses EGL_EXT_client_extensions EGL_KHR_debug EGL_KHR_platform_x11 EGL_EXT_platform_x11 EGL_EXT_platform_device EGL_MESA_platform_surfaceless EGL_EXT_explicit_device EGL_KHR_platform_wayland EGL_EXT_platform_wayland EGL_KHR_platform_gbm EGL_MESA_platform_gbm EGL_EXT_platform_xcb
[EGL] command: eglQueryDeviceStringEXT, error: EGL_BAD_PARAMETER (0x300c), message: "eglQueryDeviceStringEXT"
[EGL] command: eglQueryDeviceStringEXT, error: EGL_BAD_PARAMETER (0x300c), message: "eglQueryDeviceStringEXT"
[render/egl.c:508] DRM device '/dev/dri/card0' has no render node, falling back to primary node
[render/egl.c:319] Software rendering detected, please use the WLR_RENDERER_ALLOW_SOFTWARE environment variable to proceed
[render/egl.c:571] Failed to initialize EGL context
[render/gles2/renderer.c:503] Could not initialize EGL
[CRITICAL] m_sWLRRenderer was NULL! This usually means wlroots could not find a GPU or enountered some issues.
[CRITICAL] Critical error thrown: wlr_gles2_renderer_create_with_drm_fd() failed!

As I presume this is some sort of driver issue i tried with the default nvidia 550.78 driver with my RTX 3080 and with the new beta 555 driver and experienced the same issue with both. Does anybody know a solution?

From a similar issue, a suggested solution was to:

remove the WLR_NO_HARDWARE_CURSORS environment variable from the hyprland config

Does this fix it for you?

Thanks for the link, but sadly it did not help. I still get the exact same error.

Strange, i updated to use the unstable kernelPackages and the unstable nvidia driver and now it works again.

1 Like

Can you share your config? Mine exploded when I updated recently and I need to fix it :^(

I copied the changes from this commit of someones config, nixos config. Hope this helps

Hello, I have this same problem.

How would I go about updating the kernel and the nvidia drivers to the unstable versions? I have made the unstable Nix Packages repo available to my configuration using flakes, so how do I actually use that to implement the above solution?

Thanks.

The original link is dead, probably because the repo was force pushed, so here are the updated ones for GPU/Nvidia.nix and Kernel/Version.nix.

First of all, you need to set up the unstable pkgs by following the Importing packages from multiple nixpkgs branches configuration. After that, you can just use pkg.unstable in your config.

Next, you don’t have to use a patched kernel like zen, so this should be enough for the latest stable:

boot.kernelPackages = pkgs.unstable.linuxPackages_latest;

You can check here for more kernel options.

Finally, for Nvidia, you can just use the beta drivers:

hardware.nvidia = {
  ...
  package = config.boot.kernelPackages.nvidiaPackages.beta;
};

You check here for a list of all available drivers.

Thanks. With your help I was able to (eventually, and with great effort) fix my system. It is now running on 24.05 with the Zen kernel (I decided to switch over while I was at it, since I read that it gives marginal performance gains and reduces lag-spikes).

For some reason there were some extra lines needed in my config in addition to those you suggested to change, those being:

boot.extraModulePackages = [ config.boot.kernelPackages.nvidia_x11_beta ];
environment.systemPackages = [ pkgs.unstable.linuxPackages.nvidia_x11_beta ];

I think the latter may be redundant with the hardware.nvidia.package option, but nvidia-smi said that there were conflicting driver and library versions (550 and 555), so by adding it the graphics now work and everything is on version 555.

There were also a lot of random packages and options that were renamed or reorganised going from 23.11 to 24.05, so it took a while getting those sorted out. Everything seems to be working fine now.

Thanks again.

1 Like

Did you have this before the change?

boot.extraModulePackages = [ config.boot.kernelPackages.nvidia_x11 ];

Because this would try to pull the stable driver which would indeed conflict with the beta one.

If not, then maybe it’s necessary to make those additions.

I did not, but I added that very line (i.e. without the “_beta”) during the process of working out how to get the system running, and once I changed it to the beta version (at the same time as adding the environment.systemPackages line) it worked. I will experiment to see if it is actually necessary, since I only checked nvidia-smi after first adding that line.

1 Like

Update: It seems that

boot.extraModulePackages = [ config.boot.kernelPackages.nvidia_x11_beta ];

was unnecessary, as I removed it and nothing changed. Thanks for catching that.

As an aside, VRR now works for my laptop using the Intel GPU as the main display driver, and also when using PRIME offload.

1 Like