feat: auto-detect hardware when HELIX_HARDWARE is not set#10
Merged
Conversation
- Add detect_hardware() in src/helix/hardware.py - Probes nvidia-smi for GPU name(s) - Falls back to sysctl on macOS for Apple Silicon - Falls back to platform.processor() / platform.machine() - HelixRunner.run() sets HELIX_HARDWARE from detect_hardware() if unset; explicit env var always takes precedence - 16 unit tests covering all paths and edge cases
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #10 +/- ##
==========================================
+ Coverage 99.03% 99.07% +0.03%
==========================================
Files 9 10 +1
Lines 624 647 +23
==========================================
+ Hits 618 641 +23
Misses 6 6 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #9
Summary
src/helix/hardware.pywithdetect_hardware()— a clean fallback chain:nvidia-smi→ GPU name(s), deduplicatedsysctl -n machdep.cpu.brand_stringon macOS → Apple Silicon chip nameplatform.processor()→platform.machine()→"unknown"HelixRunner.run()calls it at session start and writes the result toHELIX_HARDWAREonly if the env var isn't already set — explicit overrides always winTest plan
uv run pytest tests/test_hardware.py— 16 passeduv run pre-commit run --all-files— all checks passedhelix runlocally withoutHELIX_HARDWAREset — startup panel shows detected hardware instead of"unknown"