tpwrules / nixos-apple-silicon

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

Only `llvmpipe` is detected as GPU backend on latest release #63

Closed bkchr closed 1 year ago

bkchr commented 1 year ago

I build the latest release with the experimental mesa GPU driver, but only llvmpipe is detected as backend. Anyone seen this issue as well?

bkchr commented 1 year ago

Looks like the Asahi kernel module isn't build 🤔

asdrubalini commented 1 year ago

I also have this issue I think. Sway has been super laggy since yesterday. Haven't yet checked if it's using llvmpipe though, but I highly suspect.

bkchr commented 1 year ago

Yeah, my KDE is also super laggy, so probably the same! I didn't yet figure out why the module isn't build.

bkchr commented 1 year ago

Okay, I found the commit that broke it: https://github.com/NixOS/nixpkgs/commit/e999433b3a169306e752d6732527db8dc78e142c

Reverting this commit fixes it for me. Now I need to find out why it breaks.

asdrubalini commented 1 year ago

Thanks! For anyone wondering, using the pinned nixpkgs version from this repo works fine (since it is pinned to a commit before the offending one). Now that I have a usable system I'm going to debug too.

bkchr commented 1 year ago

When commenting out this line it works again. I don't get what oldconfig is doing there :shrug:

fl0werpowers commented 1 year ago

Given that this issue is solved via changing something upstream, perhaps it should be raised upstream as well? or should it be fixed in the experimental kernel config instead? i don't really understand what's the path towards dealing with this issue

QuentinI commented 1 year ago

The reason asahi driver is not built is a faulty script in kernel source. By adding this patch to kernelPatches I'm able to make kernel build with Rust support, but unfortunately build fails because of a reference cycle. Probably something like https://github.com/NixOS/nixpkgs/issues/225756, which also surfaced after https://github.com/NixOS/nixpkgs/pull/221707

diff --git a/scripts/rust_is_available.sh b/scripts/rust_is_available.sh
index aebbf1913..b7b0a4abc 100755
--- a/scripts/rust_is_available.sh
+++ b/scripts/rust_is_available.sh
@@ -102,8 +102,7 @@ fi
 # Check that the `libclang` used by the Rust bindings generator is suitable.
 bindgen_libclang_version=$( \
    LC_ALL=C "$BINDGEN" $(dirname $0)/rust_is_available_bindgen_libclang.h 2>&1 >/dev/null \
-       | grep -F 'clang version ' \
-       | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' \
+       | grep -oP 'clang version \K[0-9]+\.[0-9]+\.[0-9]+' \
        | head -n 1 \
 )
 bindgen_libclang_min_version=$($min_tool_version llvm)
QuentinI commented 1 year ago

Gottem Not sure it's merge-able, but at least it works