Skip to content

fix(detection): add sysctl hw.ncpu lookup on macOS in detection.sh - #2827

Open
vaibhavsrv wants to merge 1 commit into
Osmantic:mainfrom
vaibhavsrv:fix/detection-macos-ncpu-lookup
Open

fix(detection): add sysctl hw.ncpu lookup on macOS in detection.sh#2827
vaibhavsrv wants to merge 1 commit into
Osmantic:mainfrom
vaibhavsrv:fix/detection-macos-ncpu-lookup

Conversation

@vaibhavsrv

Copy link
Copy Markdown
Contributor

Problem

In ods/installers/lib/detection.sh, get_host_logical_cpus() resolves system CPU core count using nproc 2>/dev/null || grep -c ^processor /proc/cpuinfo. On macOS (Darwin), neither nproc nor /proc/cpuinfo exist by default, causing get_host_logical_cpus() to fall back to 1 core. This led to under-allocated thread counts (--threads 1) during llama-server CPU thread budget calculation on Apple Silicon Macs.

Fix

Add sysctl -n hw.ncpu 2>/dev/null as the primary hardware query in get_host_logical_cpus() in detection.sh.

Verification

Ran bash -n ods/installers/lib/detection.sh (passed cleanly). Verified CPU core count resolution on macOS. git diff --check passed cleanly.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant