Can't boot without setting `nomodeset`

I recently bought a new laptop (system info below), and I can’t get it to boot without setting nomodeset in the boot menu (by pressing e on the latest derivation and then adding nomodeset at the end of the line). I followed the instructoins at NVIDIA - Official NixOS Wiki but no matter how many variations of the configuration I’ve tried I just couldn’t get it to boot without that option.

Here is the the output of journalctl -b -1 --no-pager: pastebin. I had to hold the power button and force shut-down the laptop, hense the abrupt end of the file.

Here is my current configuration.nix file:

...
  hardware.graphics.enable = true;
  services.xserver.videoDrivers = [
    "nvidia"
    "modesetting"
  ];
  hardware.nvidia = {
    modesetting.enable = true;
    powerManagement.enable = true;
    open = false;
    nvidiaSettings = true;
    package = config.boot.kernelPackages.nvidiaPackages.stable;
  };
  hardware.nvidia.prime = {
    sync.enable = true;
    intelBusId = "PCI:0@0:2:0";
    nvidiaBusId = "PCI:43@0:0:0";
  };
...

System info:

OS: NixOS 25.11 (Xantusia) x86_64
Host: HP OmniBook 7 Laptop 17-dc0xxx
Kernel: Linux 6.12.76
DE: GNOME 49.2
WM: Mutter (Wayland)
CPU: Intel(R) Core(TM) Ultra 7 258V (8) @ 4.80 GHz
GPU 1: NVIDIA GeForce RTX 4050 Max-Q / Mobile [Discrete]
GPU 2: Intel Arc Graphics 130V / 140V [Integrated]
Memory: 5.33 GiB / 30.98 GiB (17%)

lscpi output:

$ lspci -D -d ::03xx
0000:00:02.0 VGA compatible controller: Intel Corporation Lunar Lake [Intel Arc Graphics 130V / 140V] (rev 04)
0000:2b:00.0 VGA compatible controller: NVIDIA Corporation AD107M [GeForce RTX 4050 Max-Q / Mobile] (rev a1)

hardware.nvidia.offload doesn’t work with wayland.

To get the effects you seem to have configured, and fix the unintended issues, as well as remove superfluous defaults, you’d want this:

{ pkgs, ... }: {
  services.xserver.videoDrivers = [ "nvidia" ];

  hardware.nvidia = {
    powerManagement.enable = true;
    open = true; # yes, this is not nouveau

    # This anyway doesn't work, the upstream module
    # needs work, see:
    # https://discourse.nixos.org/t/can-we-solve-the-nvidia-situation/73198?u=tlater
    videoAcceleration = false;
  };

  # Since you enabled `sync`, I assume you want
  # to use your nvidia GPU to render your desktop.
  #
  # For the record, this just wastes battery life.
  services.udev.packages = pkgs.writeTextDir "lib/udev/rules.d/62-gnome-gpu-priority.rules" ''
    SYMLINK=="dri/by-path/pci-0000:2b:00.0-card", TAG+="mutter-device-preferred-primary"
  '';

  # Let's get you sorted with media decoding as well
  hardware.graphics = {
    # This enable is technically unnecessary if
    # you use gnome, but the Plasma module
    # forgets to set it, so many people end
    # up confused if they switch DEs, so let's cargo
    # cult setting it anyway because otherwise you'll
    # get upset at me.
    enable = true;

    extraPackages = [
      # Yes, the intel one. Your iGPU is better at
      # media decoding.
      pkgs.intel-media-driver
    ];
  };

  environment.sessionVariables.LIBVA_DRIVER_NAME = "iHD";
}

I doubt this will fix the boot issues, but at least it will be a more correct configuration.


You’re running into some kind of kernel issue, see line 1128.

Hard to tell what’s causing that. Share the rest of your configuration if fixing the nvidia config isn’t enough.

Thank you for your response.

Here is my configuration.nix (pastebin) and my hardware-configuration.nix (pastebin). I pretty much left the out-of-the-box gnome configuration.

But isn’t according to the wiki wayland supports offloading?

PRIME offload works under Wayland […]

For testing purposes, I also tried another configuration which did not include any desktop environment at all (wanted to see if it will manage to boot into the TTY at least). And I got the same error there as well.

That wasn’t entirely on purpose. After not being able to boot, I just tried out a bunch of configuration, this was simply my latest attempt. Also, I agree that offload is preferrable.


For the time being, is it possible to fully disable the Nvidia drivers, so the system will work as if it doesn’t have a dGPU at all? I even tried disabling all the nvidia kernel modules:

  boot.blacklistedKernelModules = [
    "nvidia"
    "nvidiafb"
    "nvidia-drm"
    "nvidia-uvm"
    "nvidia-modeset"
  ];

But I’m still getting the same issue during boot:

Mar 17 20:18:33 nixos kernel: Console: switching to colour dummy device 80x25
Mar 17 20:18:34 nixos kernel: xe 0000:00:02.0: vgaarb: deactivate vga console
Mar 17 20:18:34 nixos kernel: BUG: kernel NULL pointer dereference, address: 0000000000000000
Mar 17 20:18:34 nixos kernel: #PF: supervisor read access in kernel mode
Mar 17 20:18:34 nixos kernel: #PF: error_code(0x0000) - not-present page
Mar 17 20:18:34 nixos kernel: PGD 0 P4D 0 
Mar 17 20:18:34 nixos kernel: Oops: Oops: 0000 [#1] PREEMPT SMP NOPTI

Yes, but the NixOS module is broken.

Also the wiki is filled with stupid misinformation, and any attempts at fixing it get defiled faster than I can keep up with. Treat it as if an overexcited teenager copy pasted their favorite clueless youtuber’s video.

Wayland doesn’t involve prime (exactly), multi-GPU support is native to the compositor, so the X11 prime config makes no sense in that context. The NixOS module is caught somewhere between X11 and wayland support all across its configuration, and also somewhere between nvidia driver version 480 and 530 or so.

It’s all simply poorly maintained; nvidia’a driver moves too fast and there is too much cargo culting.

My post history here has me helping a couple dozen people get this stuff to actually work, and that post I link to is my start to fixing the upstream mess.

Right, in that case the udev rule should look like this:

{ pkgs, ... }: {
  services.udev.packages = pkgs.writeTextDir "lib/udev/rules.d/62-gnome-gpu-priority.rules" ''
    SYMLINK=="0000:00:02.0", TAG+="mutter-device-preferred-primary"
  '';
}

This will make GNOME default to rendering with your iGPU. After that we’ll have to talk about how you actually get your system to offload stuff to the dGPU, and also some subtly different nvidia configuration to allow the GPU to actually turn off.

Unfortunately, here too the NixOS module is somewhat broken, and misconfigures some things by default. Hence that post where I call the upstream module broken.

Yes. Remove the blacklisting stuff, all you need to do is not put nvidia in services.xserver.videoDrivers (in other words, simply don’t set that option).

The kernel will then by default load the nouveau driver instead. That in turn will most likely in practice remain unused, assuming your laptop’s firmware chooses the iGPU as the boot VGA.

If your laptop’s firmware doesn’t choose the iGPU as the boot VGA, your firmware is subtly broken. Sometimes there’s a toggle in BIOS, but if not, you need that udev rule to tell GNOME to use the nvidia GPU.

That’s all mostly irrelevant, though, it looks like things break well before you get to GNOME. It’s possible there is a bug that involves rendering the early framebuffer on your nvidia GPU; in that case a BIOS toggle would be the only option. That, or a firmware update.

I’ll have a look at the rest of your config later (though simply pasting it on discourse in a code block would be preferred, pastebin has no syntax highlighting and I can’t quote properly).

Having had a quick peek, you seem to be using the deprecated services.xserver settings for gnome.

Not that that would be the problem, but if NixOS isn’t shouting at you to use the new stuff, that might indicate you’re using an ancient kernel that doesn’t support your hardware yet. What is your channel version?

Lol I’ll keep that in mind.

I just tried that and again, without nomodeset the boot hangs.

For the record, here is my updated config:

  services.xserver.videoDrivers = [ "modesetting" ];

  hardware.graphics = {
    enable = true;
    extraPackages = with pkgs; [
      intel-media-driver
      vpl-gpu-rt
    ];
  };
  • My CPU is from the (formely) Lunar Lake family, which is compatible with VPL (compatibility table), hence the vpl-gpu-rt package.

Right. I checked my bios and unfortunately it doesn’t have an option to disable the GPU. So this is probably a firmware issue.

According to HP, the latest bios version is F.10 Rev.A, released at Nov 10, 2025. So it does seems like my firmware is slightly out of date.

# dmidecode 3.6
Getting SMBIOS data from sysfs.
SMBIOS 3.8 present.
# SMBIOS implementations newer than version 3.7.0 are not
# fully supported by this version of dmidecode.
74 structures occupying 4430 bytes.
Table at 0x6E51B000.

Handle 0x0000, DMI type 0, 26 bytes
BIOS Information
        Vendor: Insyde
        Version: F.10
        Release Date: 10/22/2025
        ROM Size: 16 MB
        Characteristics:
                PCI is supported
                BIOS is upgradeable
                BIOS shadowing is allowed
                Boot from CD is supported
                Selectable boot is supported
                EDD is supported
                Japanese floppy for NEC 9800 1.2 MB is supported (int 13h)
                Japanese floppy for Toshiba 1.2 MB is supported (int 13h)
                5.25"/360 kB floppy services are supported (int 13h)
                5.25"/1.2 MB floppy services are supported (int 13h)
                3.5"/720 kB floppy services are supported (int 13h)
                3.5"/2.88 MB floppy services are supported (int 13h)
                8042 keyboard services are supported (int 9h)
                CGA/mono video services are supported (int 10h)
                ACPI is supported
                USB legacy is supported
                BIOS boot specification is supported
                Targeted content distribution is supported
                UEFI is supported
        BIOS Revision: 15.10
        Firmware Revision: 45.36
$ sudo nix-channel --list
nixos https://channels.nixos.org/nixos-25.11
$ sudo nixos-version 
25.11.7647.9fe1300f4360 (Xantusia)

Try removing that line entirely, please. Don’t put the modesetting driver in there manually.

The kernel will automatically load that module if it needs it.

Also, do try the firmware update. I don’t see any issues with your configuration, given the error I wouldn’t be surprised if the issue is there.

It still didn’t work.

Unfortunately for the time being I’ll use Ubuntu (which does seem to work). Not as nice as nix but as long as I’m not forced to use Windows I can live with it :slight_smile:.

Thank you for all your help.


In case any nix dev reads this who would like to run some tests / drivers on my hardware, feel free to message me, I’ll be happy to contribute.