Closed BagMan9 closed 1 month ago
Here is the overlay option build failure:
error:
… while calling the 'head' builtin
at /nix/store/599wy5snf00pn1apmsnzmiy0ysdpds03-source/lib/attrsets.nix:960:11:
959| || pred here (elemAt values 1) (head values) then
960| head values
| ^
961| else
… while evaluating the attribute 'value'
at /nix/store/599wy5snf00pn1apmsnzmiy0ysdpds03-source/lib/modules.nix:809:9:
808| in warnDeprecation opt //
809| { value = builtins.addErrorContext "while evaluating the option `${showOption loc}':" value;
| ^
810| inherit (res.defsFinal') highestPrio;
(stack trace truncated; use '--show-trace' to show the full trace)
error: infinite recursion encountered
at /nix/store/xdy8zk9w82cp59jhf0b1lagjhq4d4fa5-source/apple-silicon-support/modules/mesa/default.nix:30:11:
29| (final: prev: {
30| mesa = final.mesa-asahi-edge;
| ^
31| })
I have trying to get this to work as well to no avail. I have tried using the mesa overlay (final: prev: { mesa = final.mesa-asahi-edge; })
but Hyprland still failed to use the driver.
maybe try doing this https://github.com/tpwrules/nixos-apple-silicon/issues/136#issuecomment-2007103197
@n3oney I tried using your nixos config but Hyprland still failed to launch. I wonder if its a model problem as I am using the same model as @BagMan9.
I'm also experiencing this issue and trying to dig. I have macbook pro m2. So far I've tried:
hardware.asahi
combinationsI'm mostly debugging this with sway
tho, as it happens to give bit more info. In general I see that I get software renderer on all wayland compositors and plasma.
I can see the module is correctly loaded and present in lsmod
, also dmesg | grep asahi
doesn't show any errors, and the CONFIG_DRM_ASAHI=m
seems present in kernel builds.
I can also see card0
, card1
, card2
and renderD128
in ls /dev/dri
output.
I have no idea why does mesa select the software renderer and I don't know how should I debug it, so I'm mostly trying next things of my mind. Right now I found all the kernel configs set in fedora, added them to the kernel-asahi and I'm trying to build, removing each module which fails one by one.
btw I'm now sticking to the 'overlay' mode, from what I understand it requires more compiling but it should be the purest way to get this working
@zvolin Let me know how successful you are - a couple days ago I was cleaning up my configuration & seem to be able to actually build overlay mode now - though I did not finish because it took adding 30 GB (!) of swap to even get halfway through w/o OOM errors. If that's what fixes it, I'll bite the bullet.
Regarding oom I have just 16gb swap and the oom killer haven't woken up so far, but my config is very minimal since I'm just starting with nix. Nevertheless if you don't mind longer compilations you could likely limit jobs with -j, should reduce ram peaks
Thanks for the tip, I didn't know that flag existed & I was able to successfully rebuild overnight. I'll start re-troubleshooting my issues this afternoon / tomorrow and report back.
I was finally able to get everything running when manually guiding wlroots to choose correct gpu device:
WLR_DRM_DEVICES=/dev/dri/card0 Hyprland
Then glxinfo reports correct driver
nix-shell -p glxinfo --run 'glxinfo | grep "OpenGL renderer"'
OpenGL renderer string: Apple M2 (G14G B0)
I'm afraid this is mostly a workaround, not a correct solution, but I haven't yet researched more why doesn't it choose correct device. I have the kernel config tweaked a lot currently, will revert to the stock one and check if still the workaround works.
can confirm this workaround works on a default kernel config, reverted all my changes
I've set this variable in
environment.sessionVariables = {
WLR_DRM_DEVICES = "/dev/dri/card0";
};
and it seems to work but apparently it launches sddm on the touchbar instead of edp-1 :sweat_smile:
Interesting, I have not had that variable set, but when I have tried to use sddm it also displays to the touch bar.
I can confirm this works for me as well!
I've been able to get rid of displaying on touchbar by plugging in the tiny-dfr as systemd service like:
systemd.services.tiny-dfr = {
description = "Tiny Apple silicon touch bar daemon";
after = [
"getty@tty1.service"
];
before = [
"desktop-manager.service"
];
for now it just crashes for me, but it's enough to somehow 'reserve' the touchbar :sweat_smile:
@zvolin You are the man!!! Its working for me as well. Found this in the hyprland wiki about multi gpu.
WLR_DRM_DEVICES=/dev/dri/card0 Hyprland
Also had this problem and tried to test it with this workaround, however setting it like this didn't work
environment.sessionVariables = { WLR_DRM_DEVICES = "/dev/dri/card0"; };
But with it being set explicitly in environment.sessionVariables it's working, thanks!
I'm assuming this is an issue for people with a touchbar device? Is the touchbar being detected as a second gpu?
@n3oney
I'm assuming this is an issue for people with a touchbar device? Is the touchbar being detected as a second gpu?
I think you are probably right! It looks like the unifying factor of problem devices are touchbar models.
@tpwrules Might it be worth putting something in the uefi-standalone doc about this? As the touch bar models age, more people are likely to install asahi & end up using this project, and having a blurb about this multi-gpu issue for touch bar models may save people a ton of time.
In the meantime, I'm closing this issue because it seems the problem & solution have been found.
Hardware is M1 MacBook Pro 13".
I have gotten the experimental driver working with gdm & gnome (via Wayland) . In fact, when running, I'm able to launch hyprland from my terminal and it runs in a small window. However, as soon as I attempt to launch Hyprland directly as the default login session, it crashes.
Here is one of many crash logs:
This seems very similar to #149, however the thread did not seem to be helpful.
I know this is a commonly reported issue, and I have done my best to take as many troubleshooting steps as possible before posting.
GPU / Desktop Manager Config: (configuration.nix)
Cycling through experimentalGPUInstallMode options has had varying-but-mostly-unhelpful result:
nixos-rebuild
with "infinite recursion encountered" and appears to take issue with a mesa declaration. I did not record the specific output, and will add to this post asap with it. I could not find the error in general seems to have many causes, and I could not find anyone with a similar issue.In addition, I attempted to isolate gdm as a potential problem. I tried both using greeter (see commented out portion of configuration.nix) to launch HL and also tried launching it from just the basic tty (no x server running) and was unsuccessful with the same error as above.
I have disabled the xdg options, gnome, gdm and tried pretty much every combination of the above options.
Here is the Coredump of one of the crashes when attempting to launch as a session from gdm:
Additionally, most of the crashes seem to be surrounded by these errors (from journalctl:)
I think this is relavent because it looks similar to #67, but I could be wrong.
Let me know what other information would be helpful.