diff --git a/install.sh b/install.sh index 2d9a368555..efabe15a70 100755 --- a/install.sh +++ b/install.sh @@ -729,12 +729,13 @@ if [ "$OS" = "macos" ] && [ "$_ARCH" = "x86_64" ]; then # sysctl hw.optional.arm64 returns "1" on Apple Silicon even in Rosetta. if [ "$(sysctl -in hw.optional.arm64 2>/dev/null || echo 0)" = "1" ]; then echo "" - echo " WARNING: Apple Silicon detected, but this shell is running under Rosetta (x86_64)." - echo " Re-run install.sh from a native arm64 terminal for full PyTorch support." - echo " Continuing in GGUF-only mode for now." + echo " NOTE: Apple Silicon detected under Rosetta (x86_64 shell)." + echo " Overriding to arm64 for correct binaries." echo "" + _ARCH="arm64" + else + MAC_INTEL=true fi - MAC_INTEL=true fi if [ -n "$_USER_PYTHON" ]; then diff --git a/studio/install_llama_prebuilt.py b/studio/install_llama_prebuilt.py index 76d22984d7..7924afb205 100755 --- a/studio/install_llama_prebuilt.py +++ b/studio/install_llama_prebuilt.py @@ -1993,6 +1993,18 @@ def run_capture( def detect_host() -> HostInfo: system = platform.system() machine = platform.machine().lower() + # macOS Rosetta: platform.machine() reports x86_64 on Apple Silicon. + # Detect the real hardware via sysctl so we download arm64 binaries. + if system == "Darwin" and machine in {"x86_64", "amd64"}: + try: + r = subprocess.run( + ["sysctl", "-in", "hw.optional.arm64"], + capture_output=True, text=True, timeout=5, + ) + if r.stdout.strip() == "1": + machine = "arm64" + except Exception: + pass is_windows = system == "Windows" is_linux = system == "Linux" is_macos = system == "Darwin"