Add MLX (Apple GPU) to the AI install menu - #385
Conversation
omarchy-install-ai-mlx runs the mlx-omarchy installer, which puts Apple's MLX with the Honeykrisp Vulkan backend and a chat demo into a private venv under ~/.local/share/mlx-omarchy. It installs lapack and blas through omarchy-pkg-add and touches nothing else: no Mesa replacement, no Hyprland or Omarchy config changes. Verified on the M1; skips on other architectures.
|
Updated after testing What passed
Two failure paths still need attention
The normal M1 workflow works now. I'd address those failure contracts, rerun the focused tests and M1 lifecycle, then validate the candidate Omarchy/settings package pair for both fresh and existing installs. Package-pair delivery and physical non-M1 behavior remain untested; desktop tests supplied disk-backed temporary storage. No migration gap was demonstrated by this retest. Thanks, Joshua—the dependency fix and pinned install/remove path made a real difference on the M1. |
Reported on omacom/omarchy-mac#385: a fresh install failed on libopenblas.so.0. lapack and blas alone do not provide it.
Four fixes from @malik-na's review, tested on the four paths they touch. openblas: the wheel resolves libopenblas.so.0 at import, and lapack plus blas do not provide it. Added upstream in the installer (mlx-omarchy 286ef72), which this entry now pins. Exit status: the installer's failure was swallowed. `if ! cmd; then status=$?` records the negation's status, which is always 0, so a failed install printed "failed (exit 0)" and exited 0. The status is captured directly now, the error output is kept, a partial install is torn down with the installer's own --uninstall, and the real code propagates. Pinned installer: the entry fetched install.sh from a moving branch. It now fetches one commit and refuses to run it unless the SHA256 matches. The installer verifies the wheel against the release SHA256SUMS as before, so both hops are checked. M1 gate: aarch64 admitted every Apple machine, but the wheel is built for t8103 only. The entry uses omarchy-hw-apple plus a device-tree check and names the SoC it found when it declines. Also adds remove.ai.mlx and omarchy-remove-ai-mlx, pinned to the same installer commit so install and uninstall cannot drift.
|
Thanks, this was a good catch on all four. Fixed in dbd15c5, and one of them was worse than reported. openblas. Added upstream in the installer rather than here, since that is where the package list lives: joshuaswarren/mlx-omarchy@286ef72. This entry pins that commit, so the fix arrives with the pin. False success. You were right that the terminal said Done after a failure, and the cause is nastier than a missing check. My first attempt at the fix still got it wrong: if ! bash "$tmp/install.sh"; then
status=$? # always 0: this is the negation's status, not the installer'sThat reproduced the same bug in a subtler form, reporting "failed (exit 0)" and still exiting 0. The status is now captured directly from the installer. On failure the error output is kept, the partial install is torn down with the installer's own Pin and checksum. The entry fetched M1 gate. Also added Verified: shellcheck clean on both scripts, One thing that is not mine to fix: the Package-pair deployment is still untested, as you noted. Happy to look at that next if it should block this. |
…back Two failure contracts from @malik-na's retest of 53d5470. 1. The shared presentation wrapper reported every outcome as success. It called omarchy-show-done unconditionally and ended on that command's status, so a menu entry exiting 2 showed a green "Done!" and handed its caller a 0; cancellation became 0 too. The status is now captured on the line after the command runs, passed to omarchy-show-done, and used as the script's exit status. omarchy-show-done takes an optional status and shows a red "Failed (exit N)" for anything non-zero; a missing argument still means success, so omarchy-pkg-install, omarchy-pkg-aur-install and omarchy-pkg-remove are unaffected. This was a pre-existing bug in shared code, not a regression from the MLX entry. 2. omarchy-install-ai-mlx ran the upstream --uninstall after any failure, which deletes every artifact unconditionally, so a failed install over a working one removed the working one. It now refuses before touching anything, or the network, if any artifact already exists, and names omarchy-remove-ai-mlx as the way forward. Because that guard means only this attempt's files can be present, the cleanup message can be honest: a cleanup that fails now says what may remain instead of asserting a clean machine. Tests: tests/test-presentation-exit-status.sh covers propagation of 0, 1, 2 and 37, the reported status, cancellation, the no-argument default, and the on-terminal messages over a pty. tests/test-ai-mlx-install-guards.sh covers each of the four artifacts separately, proves the refusal happens before the fetch and leaves the existing files in place, and exercises a real failing install and a genuinely failing cleanup against the pinned installer. Both suites were checked against the bugs they describe: reverting either fix makes them fail. test/shell is 28 of 266 failing before and after this change, an identical set, all environmental on a non-Omarchy host.
|
Both fixed in 9243282. 1. The wrapper. You were right about the cause, and right that it is not mine. It is in the path of every menu entry I added, so here it is. That one line had two bugs: # before
presentation_script="omarchy-show-logo; $cmd; if (( \$? != 130 )); then omarchy-show-done; fi"
# after
presentation_script="omarchy-show-logo; $cmd; status=\$?; if (( status != 130 )); then omarchy-show-done \"\$status\"; fi; exit \$status"
One thing I did not fix, so it is not overstated. This makes the presentation script exit with the real status. Whether that status then survives 2. Rollback. Your reproduction is exactly right, and the fix is the ordering you suggested. The entry enumerates the four artifacts that upstream Tests, for the three cases you named:
I checked both suites against the bugs rather than watching them pass. Revert the wrapper line and the first fails on "a command exiting 1 left the wrapper returning 0". Remove the guard and the second fails on the refusal assertion, having reached the fetch.
Package-pair delivery and non-M1 hardware are still untested by me, as you said. |
Adds an Install > AI > MLX (Apple GPU) entry and
bin/omarchy-install-ai-mlx.mlx-omarchy is Apple's MLX array framework running on the Apple GPU under Linux through Mesa's Honeykrisp Vulkan driver, with a chat demo (
mlx-omarchy-demo, also registered in the launcher as "MLX Chat (Apple GPU)"). Demo video and install walkthrough are in that repo's README.What the install script does:
curl -fsSL .../install.sh | bash), which installs the verified release wheel into a private venv under~/.local/share/mlx-omarchy, adds two launchers to~/.local/bin, one.desktopentry, and callsomarchy-menu refresh;lapackandblasthroughomarchy-pkg-add;bash install.sh --uninstallremoves it all;Verified on an M1 MacBook Air running Omarchy 4.0.1rc2 with the stock asahi-alarm Mesa 26.1.7 (out-of-box install, demo, launcher entry). The M3 is not supported yet: on the current Omarchy Mac kernel no Apple GPU is exposed to Vulkan there, and the installer's smoke test reports that instead of falling back to the CPU.
Menu row follows the existing
install.ai.*entries (disabledwhenmlx-omarchy-demois present; action runs in the floating presentation terminal).