NixOS hangs during boot on new machine

I’m trying to install NixOS on a new laptop.

Booting into nixos-gnome-21.05.3892.70904d4a992-x86_64-linux.iso hangs at

nouveau 0000:01:00.0: unknown chipset (b76000a1)

or

Found device Ultra_Fit nixos-gnome-21.05-x86-64.

or

Finished mount-pstore.service

or … some other message.

OTOH, booting into ubuntu-20.04.3-desktop-amd64.iso goes smoothly every time. Inside the ubuntu live image, I can install Nix, and use that to install NixOS (I have tried both 20.09 and 21.05) onto the machine’s drive, and booting into that, hangs at similar sorts of places.

I have tried the debug option on the NixOS installer image, which seems to spew extra information to the screen during boot, but I am not able to extract anything meaningful from it.

All the messages at which it gets stuck are reports of success ([ OK ]), except

nouveau 0000:01:00.0: unknown chipset (b76000a1)

so this is my prime suspect, but it means very little to me. A quick search suggests that nouveau is an Accelerated Open Source driver for nVidia cards.

What should I do to get around this hurdle?

Noveau is the open source and not very feature complete nvidia hardware driver. Unless your nvidia card is fairly old, then you should probably use the proprietary nvidia driver anyway to get the most out of the card. I’m not sure there is any way to boot the binary driver from the official ISO, but you could build your own iso if needed, or if you’ve already installed NixOS successfully from the ubuntu image, try to set the binary driver services.xserver.videoDrivers = [ "nvidia" ].

The wiki may also be of some help.

That doesn’t seem to have had any noticeable effect.

Curiously enough, I’ve spotted the same

nouveau 0000:01:00.0: unknown chipset (b76000a1)

error while Ubuntu boots successfully, so perhaps that’s not what is causing it to hang after all.

Picking the nomodeset version the NixOS installer, the boot succeeds, but the screen goes blank immediately after booting completes.

Attempting to switch virtual console (with ALT + F{2…7}) flashes up (for a fraction of a second) a logged in session for user nixos. The information that flashes past, includes the statement that an ssh server is running and that both root and nixos have empty passwords, which would need to be set before sshing in.

So I tried to set the password blind, without seeing what is on the screen, and noticed that what I type shows up extremely faintly (only visible with ambient light turned off). I managed to set a password and ssh in to the machine. This gives me access to dmesg, but I don’t really know what to look for, and nothing stands out.

First of all, you haven’t provided any details on what machine you have, other than that it’s a laptop. That’s pretty useful to do in general…

That said, if it’s a new (2021) laptop the first thing you’ll want to do in case of non-booting images is to make sure you’re booting the iso image with the latest (5.14) kernel instead of the current 21.05 default kernel (5.10). See if that gets you anywhere - do note it’s a minimal iso, so it won’t boot to GNOME.

In case the latest_kernel iso doesn’t help: sounds like your backlight doesn’t work. So that’s what you’ll want to look for - and moreso, consult Arch Wiki’s page about it.

TongFang GM5TG0W.

What other information could be useful?

It is.

This boots without any problems (and even mentions something about setting backlight brightness towards the end, but this stays on the screen very briefly, so I didn’t catch the details).

Thank you!

I edited configuration.nix on the system I installed earlier, adding

boot.kernelPackages = pkgs.linuxPackages_latest;

After another nixos-install --root /mnt, booting into the installed NixOS appears to get past the backlight problem, as I see

         Starting Load/Save Screen Backlight Brightness of backlight:intel_backlight...
[  OK  ] Finished Load/Save Screen Backlight Brightness of backlight:intel_backlight...

but all attempts to boot include, somewhere along the line

[FAILED] Failed to start X11 Server

and hang. Everything else that remains visible on the screen is [ OK ].

That’ll do, I think.

You’ll want to attempt to switch to a usable VT so you can check the logs (journalctl) to figure out why your display manager fails to start.

If I had to guess I’d say the issue might be that it’s trying to initialize the nvidia adapter - which fails according to your kernel log excerpt (probably requires proprietary drivers). Arch Wiki: NVIDIA Optimus. NixOS wiki: Nvidia

Your laptop also has an intel adapter - these generally work out of the box, so the easiest way (for now) might be to disable the discrete graphics adapter (BIOS or blacklist the module) to see if that helps. Or try enabling the proprietary module for your nvidia card (as suggested by @nrdxp).

facepalm … there I was, thinking that it was failing to boot. I guess I’ve been banging my head against a brick wall for too long. Thank you!

Apart from repetitions of

 display-manager.service: Failed with result 'exit-code'.

I see

display-manager.service: Failed to enqueue OnFailure= job, ignoring: Unit plymouth-quit.service not found.

I already had

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

in my configuration.nix. Now I removed "modesetting" before nixos-rebuild switch and the backlight disappeared. So I reinstated "modesetting" and nixos-rebuild switched again. This time the display manager popped up. What‽ But rebooting into this generation … the X server fails to start, once again.

Putting back "modesetting" resulted in a different generation than the one from which I removed it in the first place, so there must have been some other difference, but I now get the following behaviour consistently:

  1. boot
  2. display manager fails to start
  3. nixos-rebuild switch (without changing configuration, no new generation is created) …
  4. display manager pops up.

I’m confused.

try blacklisting the nouveau module entirely by putting it in boot.blacklistedKernelModules

1 Like

Tried blacklisting all combinations of nvidia and nouveau. No difference.

So I went into BIOS, as suggested by @ius, where I found

Advanced → Switchable Graphics → Display Mode

which offered three options:

  • iGPU Only
  • dGPU Only
  • MsHybrid

Picking either of the first two results in a successful boot directly into display manager.

This gets me over the most basic hurdle, so I can get on with trying to get my idiosyncratic configuration working. Thank you both!