nixos-apple-silicon icon indicating copy to clipboard operation
nixos-apple-silicon copied to clipboard

remove mesa-asahi-edge

Open flokli opened this issue 6 months ago • 5 comments

Since mesa 25.1, support for asahi is enabled by default. This means, the nixpkgs mesa is sufficient and we don't need any custom mesa, or methods to replace it.

In addition to the now ineffective hardware.asahi.useExperimentalGPUDriver option, this also removes the hardware.asahi.experimentalGPUInstallMode option, which was already deprecated before.

flokli avatar May 26 '25 12:05 flokli

Are we ready to say goodbye to this? I think Fedora is continuing to keep the custom Mesa around for future development, but the upstream Mesa enablement allows compatibility in VMs etc.

I think it would be better to fix it.

tpwrules avatar May 26 '25 23:05 tpwrules

I agree with @tpwrules until fedora switches we shouldn't either. They clearly still think diverging from upstream is worth it.

rowanG077 avatar May 27 '25 00:05 rowanG077

Gentoo for example only plans to keep mesa around in their overlay until virglrenderer is fixed too.

I'm not entirely what/why Fedora is planning to do (maybe it needs to be orchestrated more carefully there?), but I'd assume in a few months from now things will just end up in mainline mesa, and their custom mesa package will disappear too.

I'm happy to keep this PR open for a while until the dust has settled.

flokli avatar May 27 '25 10:05 flokli

This would immediately break stable which would be really unfortunate so let's not. The fix turns out to be simple, @wistfulbrick 's fix appears right.

On the other hand, the Asahi Linux distro guidelines do not call out Asahi's Mesa fork as needing to be packaged so perhaps we can drop this sooner than I thought.

tpwrules avatar May 30 '25 22:05 tpwrules

According to Conan Kudo on Matrix, the next Fedora version will switch to upstream mesa (and Rawhide has already made the switch). However, this did break the emulation stack as mentioned above. It might be best to hold out as @flokli suggested until the dust settles.

waltmck avatar Jun 02 '25 18:06 waltmck

I think the virglrenderer MR is at https://gitlab.freedesktop.org/virgl/virglrenderer/-/merge_requests/1527.

flokli avatar Jun 26 '25 21:06 flokli

Now that Mesa 25.2 has been released with Asahi virtio support enabled, and Fedora Asahi is moving towards using upstream, I think it's time for this to be included.

rowanG077 avatar Aug 06 '25 22:08 rowanG077

Mesa 25.2 has landed in nixpkgs-unstable, so I think that this can be merged alongside a flake inputs update.

waltmck avatar Aug 10 '25 15:08 waltmck

Mesa 25.2 has landed in nixpkgs-unstable, so I think that this can be merged alongside a flake inputs update.

Is this included in the pin at https://github.com/nix-community/nixos-apple-silicon/pull/330?

flokli avatar Aug 10 '25 17:08 flokli

I think it just got barely missed. We need to do a release both for stable and unstable first though. I am preparing those now.

tpwrules avatar Aug 10 '25 17:08 tpwrules

Rebased, and inputs.nixpkgs now has mesa 25.2.0 in there.

flokli avatar Aug 14 '25 10:08 flokli

I still need to test this.

flokli avatar Aug 14 '25 10:08 flokli

Is this dependent upon the kernel upgrade? Would prefer to keep that as a separate PR.

tpwrules avatar Aug 14 '25 13:08 tpwrules

Is this dependent upon the kernel upgrade? Would prefer to keep that as a separate PR.

No, the switch to the uapi that was also upstreamed happened a while ago the kernel is already up to date enough. I'm just stupid and pushed these commits too while rebasing, will update 😆

Edit: done

flokli avatar Aug 14 '25 13:08 flokli

This PR works for me.

rowanG077 avatar Aug 14 '25 21:08 rowanG077

What is this drafted on? I imagine it would fix #338 . If we need a nixpkgs update, please put that as the first commit. I am happy to merge both in the same PR.

tpwrules avatar Aug 18 '25 20:08 tpwrules

What is this drafted on? I imagine it would fix #338 . If we need a nixpkgs update, please put that as the first commit. I am happy to merge both in the same PR.

mesa 25.2.0 is in our nixpkgs pin, and this has been sufficiently tested. undrafting.

flokli avatar Aug 18 '25 20:08 flokli

Thanks, will review tonight if you are waiting on me.

tpwrules avatar Aug 18 '25 21:08 tpwrules

To be fair, I tested with 6.15.8-asahi, not asahi-6.14.8-1, but I assume there's not been a ton of GPU driver changes there, as the UAPI is stable now.

flokli avatar Aug 18 '25 21:08 flokli

Just to clarify, you want the mkRemovedOptionModule for apple-silicon-support/packages/mesa-asahi-edge/default.nix correct?

KaitoTLex avatar Aug 19 '25 04:08 KaitoTLex

I added the mkRemovedOptionModule for the two removed options, and removed the mesa version string from the uefi-standalone.md file, PTAL.

flokli avatar Aug 22 '25 09:08 flokli

Hi, just to let you know that I tried this PR on my m2 air. And for me it looks broken. I spot it quickly just opening a youtube video. Its laggy.

cyrinux avatar Aug 22 '25 17:08 cyrinux

Hi, just to let you know that I tried this PR on my m2 air. And for me it looks broken. I spot it quickly just opening a youtube video. Its laggy.

That is probably the known Hyprland OpenGL bug with Mesa 25.2, see here.

waltmck avatar Aug 22 '25 17:08 waltmck

Hi, just to let you know that I tried this PR on my m2 air. And for me it looks broken. I spot it quickly just opening a youtube video. Its laggy.

That is probably the known Hyprland OpenGL bug with Mesa 25.2, see here.

I'm using sway now, not hyperland anymore.

cyrinux avatar Aug 22 '25 17:08 cyrinux

Hi, just to let you know that I tried this PR on my m2 air. And for me it looks broken. I spot it quickly just opening a youtube video. Its laggy.

That is probably the known Hyprland OpenGL bug with Mesa 25.2, see here.

I'm using sway now, not hyperland anymore.

And it's still an issue, or not an issue anymore?

flokli avatar Aug 22 '25 17:08 flokli

Hi, just to let you know that I tried this PR on my m2 air. And for me it looks broken. I spot it quickly just opening a youtube video. Its laggy.

That is probably the known Hyprland OpenGL bug with Mesa 25.2, see here.

I'm using sway now, not hyperland anymore.

And it's still an issue, or not an issue anymore?

I sadly dont know what is the root cause, mesa related for sure, but yes, its not usuable anymore for me it this get merged as this. My previous reply was maybe not clear. I was an hyprland user, but I run sway since long time already now. I dont install sway just now.

cyrinux avatar Aug 22 '25 17:08 cyrinux

I use the Hyprland patches suggested by another user in #340 with mesa 25.2, but it still runs on llvmpipe for me too. I'm not sure why it doesn't work in my case or what I'm doing wrong.

These patches are the ones from a Hyprland PR that is supposed to fix this problem.

ToborWinner avatar Aug 22 '25 17:08 ToborWinner

Can it be we need both last kernel and mesa to get all thing working ? You said previously @flokli you test only on last kernel true ? Your other PR ?

cyrinux avatar Aug 22 '25 18:08 cyrinux

Can it be we need both last kernel and mesa to get all thing working ? You said previously @flokli you test only on last kernel true ? Your other PR ?

I tried using #326 to update kernel, but that didn't work either. To be clear I didn't use this PR, I just set useExperimentalGPUDriver = false, which should have the same effect.

ToborWinner avatar Aug 22 '25 18:08 ToborWinner

Okay just upgraded my nixpkgs (2025-08-19) in my nixos configuration on a branch with this patch applied and now I'm suddenly in llvmpipe even though I'm on 25.2 and on GNOME (setting hardware.graphics.enable explicitly doesn't have an effect)

relevant vulkaninfo output:

Device Properties and Extensions:
=================================
GPU0:
VkPhysicalDeviceProperties:
---------------------------
	apiVersion        = 1.4.318 (4211006)
	driverVersion     = 25.2.0 (104865792)
	vendorID          = 0x10005
	deviceID          = 0x0000
	deviceType        = PHYSICAL_DEVICE_TYPE_CPU
	deviceName        = llvmpipe (LLVM 19.1.7, 128 bits)
	pipelineCacheUUID = 32352e32-2e30-6161-6161-616161616161

I don't know if this is a kernel issue or an upstream (nixpkgs) mesa regression.

normalcea avatar Aug 22 '25 18:08 normalcea