tpwrules / nixos-apple-silicon

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

`useExperimentalGPUDriver` breaks boot (or maybe just display?) #180

Closed n8henrie closed 3 months ago

n8henrie commented 3 months ago

I've had a fairly stable config for a year or so, but after a recent update (without config changes) I found that after reboot I arrived at a frozen black screen with a single _ in the top left corner.

I can't figure out how to try to switch into a TTY (e.g. ctrl alt f7) since my Macbook Pro doesn't have hardware function keys, so I'm not sure if the system is frozen or just the display.

I think the most relevant parts of my config is:

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

With some experimentation, I found that disabling useExperimentalGPUDriver was enough to get the boot process to complete and my display manager to show up.

I wonder if it may be an issue that I don't have the edge kernel enabled?

Not sure how to provide more information, as I can't access dmesg or journald. Using journalctl -x -b -1 on the following boot didn't seem to reveal much.

tpwrules commented 3 months ago

On my 16" M1 Max MBP I can press fn (globe key) + control + option + F1 (backlight down key) to get a TTY. F2 is the session manager and F3 is my desktop session.

The edge kernel is no longer a thing, the options you've provided should be sufficient.

Does the TTY switch work for you in this situation? Can you check for symptoms of https://github.com/tpwrules/nixos-apple-silicon/issues/156 ? I just tested the latest nixpkgs revision on my machine and it's working fine with graphics.

n8henrie commented 3 months ago

Thanks for your time.

On my 16" M1 Max MBP I can press fn (globe key) + control + option + F1 (backlight down key) to get a TTY.

I will try again, but I have a model with the the stupid "touch bar" (the only thing I truly loathe about this computer), which doesn't even look like it is powered on at that point in the boot process.

The edge kernel is no longer a thing, the options you've provided should be sufficient.

Yes, figured this out in the meantime. Thanks for confirming.

Can you check for symptoms of https://github.com/tpwrules/nixos-apple-silicon/issues/156 ?

I'm running on a BTRFS root and the scrub passes, so hopefully filesystem corruption is not the issue. Can run a store verify.

I'm just inheriting nixpkgs from the pinned version of this repo (inherit (nixos-silicon.inputs) nixpkgs;), it seems like you update pretty frequently and hoped this would prevent version incompatibilities. Looks like most people in that thread are just running nixos-unstable -- is that recommended?

tpwrules commented 3 months ago

If you are already looking at a VT you can use Option + left or right arrows to switch. Maybe that will work if the graphics are dead? Also maybe try with an external keyboard. I misinterpreted what you meant at first by no hardware function keys.

The specific symptom I was thinking was more the illegal instruction errors. If you can get a VT or a log of some kind, check it for that. I'm not so sure the other users had filesystem corruption, I think it's more likely to be a weird compiler or memory management problem. The verify should be straightforward though, so may as well do it.

I test each version of nixos-apple-silicon with exactly the associated nixpkgs version. Working with the stable branch or newer/older unstable is just a bonus, and sometimes things can break. It's up to you how you feel about that.

n8henrie commented 3 months ago

Seems to have resolved itself -- possibly from the nixpkgs update you pushed 2 days ago?

Regardless, butter smooth again!

FWIW:

https://asahilinux.org/2022/03/asahi-linux-alpha-release/

Note: on the 13" MacBook Pro, you can use Fn + the number row keys (1-9, 0, and the next two) as F1..F12 in lieu of the Touch Bar.

It looks like I can use e.g. fncontroloption1 (so the lower-left-most 3 keys + 1) to switch to TTY1, and I can confirm an external keyboard works as well. I don't know if I could have switched with the problem I was having, since it went away, but that's working during my current session.