Skip to content

Intel Mac Support: llvmlite build failure and --list_format=json crash #21

Description

@brunodimarco

Description

There are two sequential installation and runtime bugs when attempting to use the separation runtime on an Intel Mac (x86_64) due to upstream dependency changes dropping support for this architecture.

1. Installation Failure (llvmlite)
Because PyTorch dropped macOS x86_64 support starting with version 2.3, pip automatically backtracks and attempts to install an older version of audio-separator (e.g. 0.24.1) that doesn't strictly require torch>=2.3. During this process, pip tries to install llvmlite. However, llvmlite stopped releasing precompiled macOS x86_64 wheels starting with version 0.46.0. Without a prebuilt wheel, pip attempts to compile it from source, failing because CMake and LLVM are missing.

Installing audio-separator for CPU only failed: /runtime/bin/python', '/private/var/folders/.../ffi/build.py']' returned non-zero exit status 1.
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for llvmlite

2. Runtime Crash (--list_format=json)
If the user manages to resolve the dependency conflict (e.g., by constraining llvmlite<0.46.0 as proposed below), pip successfully installs audio-separator==0.24.1. However, rx3-toolkit then crashes immediately when attempting to retrieve the model list because audio-separator 0.24.1 does not support the --list_format=json argument:

Model list unavailable: The model list could not be retrieved: ... audio-separator: error: unrecognized arguments: --list_format=json

Steps to Reproduce

  1. Run rx3-toolkit on an Intel Mac (or an Apple Silicon Mac running in Rosetta/x86_64 mode).
  2. Attempt to provision/install the separation runtime. The installation fails.
  3. Fix the installation manually, then try to open the separation UI -> Crash on --list_format=json.

Proposed Fix

We can resolve both issues gracefully for Intel Mac users with two small changes:

Fix 1: Constrain llvmlite for x86_64 macOS

# tools/rx3_stems/provisioning.py
SUPPORT_PACKAGES = [LIBROSA_PIN, "imageio-ffmpeg"]

if sys.platform == "darwin" and platform.machine() == "x86_64":
    # llvmlite >= 0.46.0 lacks macOS x86_64 wheels. 
    # Force < 0.46.0 to avoid source compilation without CMake/LLVM.
    SUPPORT_PACKAGES.append("llvmlite<0.46.0")

SUPPORT_PACKAGES = tuple(SUPPORT_PACKAGES)

Fix 2: Remove --list_format=json
Since older versions of audio-separator (like 0.24.1) output JSON by default and do not recognize the --list_format argument, we should remove it from the subprocess call to maintain compatibility.

# tools/rx3_stems/separation.py (around line 446)
    result = subprocess.run(
        [str(runtime.separator), "--list_models",
         f"--model_file_dir={runtime.models}", "--log_level=error"],
        capture_output=True, text=True,
        env=runtime.subprocess_environment(),
    )

Impact & Tradeoffs

By forcing Intel Macs to use < 0.46.0 of llvmlite (and consequently audio-separator ~0.24.1), users will miss out on the latest optimizations in the audio-separator CLI. However, this is an acceptable and necessary tradeoff because:

  1. Version 0.24.1 still fully supports the high-quality core architectures needed by rx3-toolkit (MDX, Demucs, VR, and MDXC/Roformer).
  2. It is currently the only automated way to allow Intel Mac users to use the toolkit without forcing them to manually compile LLVM/CMake toolchains from scratch (which most end-users cannot do).

System Info

  • OS: macOS (Intel x86_64)
  • Python Version: >= 3.10
  • rx3-toolkit Version: 0.5.2

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions