tpwrules / nixos-apple-silicon

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

Accelerated graphics no longer work #126

Closed rowanG077 closed 6 months ago

rowanG077 commented 6 months ago

Since the update today my system has fallen back to the software opengl implementation llvmpipe. I'm running a 14 inch M2 Max Macbook pro. An easy way to confirm whether this is the case is to use the following command:

nix-shell -p glxinfo --run 'glxinfo | grep "OpenGL renderer string: "'

This shows the following for me:

OpenGL renderer string: llvmpipe (LLVM 16.0.6, 128 bits)

I'm currently trying to overlay mesa instead of replace to see if that makes any difference.

rowanG077 commented 6 months ago

It may be a problem that we are not using a correct kernel config? At the very least I have the kernel blaring about Failed to get dp-xbar: -517 Which according to here means CONFIG_MUX_APPLE_DPXBAR is missing. which is indeed not set in the config.

tpwrules commented 6 months ago

Running a Plasma Wayland desktop session, on my machine (2021 M1 Max 16" MBP), I get OpenGL renderer string: Apple M1 Max (G13C C0) from the given command and acceleration does seem to work properly.

I did unfortunately neglect to synchronize the kernel configs. I will address this for the next release. Were you able to confirm that enabling that option fixed your issue?

rowanG077 commented 6 months ago

I can confirm that it fixes the issue. The entire screen backlight device also wasn't created without it.

tpwrules commented 6 months ago

I'll close this once the fix makes it to a release, which should be the next couple days. Thanks for contributing.

CodeWitchBella commented 6 months ago

I can confirm that this fix works for me as well :+1:

Also, I think the proper place to get the fedora config is here: https://copr-dist-git.fedorainfracloud.org/cgit/@asahi/kernel/kernel.git/tree/kernel-aarch64-fedora.config It's even a git repo (http://copr-dist-git.fedorainfracloud.org/git/@asahi/kernel/kernel.git), so it should be possible to integrate using fetchgit instead of copying the full file verbatim.

tpwrules commented 6 months ago

Fixed in the latest release. I ran into issues simply copying the config verbatim, so I only took the Apple Silicon-specific changes. It's a little clunky but it meets my goals (short build time, ease of maintenance, compatibility with Apple Silicon and NixOS).