Compare commits
1 commit
main
...
fix/mac-ll
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4fadb05c50 |
2 changed files with 17 additions and 4 deletions
|
|
@ -729,12 +729,13 @@ if [ "$OS" = "macos" ] && [ "$_ARCH" = "x86_64" ]; then
|
||||||
# sysctl hw.optional.arm64 returns "1" on Apple Silicon even in Rosetta.
|
# 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
|
if [ "$(sysctl -in hw.optional.arm64 2>/dev/null || echo 0)" = "1" ]; then
|
||||||
echo ""
|
echo ""
|
||||||
echo " WARNING: Apple Silicon detected, but this shell is running under Rosetta (x86_64)."
|
echo " NOTE: Apple Silicon detected under Rosetta (x86_64 shell)."
|
||||||
echo " Re-run install.sh from a native arm64 terminal for full PyTorch support."
|
echo " Overriding to arm64 for correct binaries."
|
||||||
echo " Continuing in GGUF-only mode for now."
|
|
||||||
echo ""
|
echo ""
|
||||||
|
_ARCH="arm64"
|
||||||
|
else
|
||||||
|
MAC_INTEL=true
|
||||||
fi
|
fi
|
||||||
MAC_INTEL=true
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "$_USER_PYTHON" ]; then
|
if [ -n "$_USER_PYTHON" ]; then
|
||||||
|
|
|
||||||
|
|
@ -1993,6 +1993,18 @@ def run_capture(
|
||||||
def detect_host() -> HostInfo:
|
def detect_host() -> HostInfo:
|
||||||
system = platform.system()
|
system = platform.system()
|
||||||
machine = platform.machine().lower()
|
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_windows = system == "Windows"
|
||||||
is_linux = system == "Linux"
|
is_linux = system == "Linux"
|
||||||
is_macos = system == "Darwin"
|
is_macos = system == "Darwin"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue