feat(enable): add GPU backend compatibility validation#357
feat(enable): add GPU backend compatibility validation#357bugman-007 wants to merge 2 commits intoLight-Heart-Labs:mainfrom
Conversation
Lightheartdevs
left a comment
There was a problem hiding this comment.
Review: REQUEST CHANGES — Two correctness bugs
High: cpu backend default inconsistent across codebase
CLI defaults extensions without gpu_backends to ["amd", "nvidia", "apple", "cpu"]. Dashboard-api defaults to ["amd", "nvidia", "apple"]. Manifest schema doesn't include "cpu" at all. CPU-only users pass CLI validation but get filtered by dashboard. The two codepaths disagree.
Fix: Align the default with the schema and dashboard-api, or add "cpu" consistently everywhere.
High: "all" sentinel not handled
Manifests can declare gpu_backends: [all]. Dashboard-api checks for it. CLI doesn't — [[ ! " all " =~ " nvidia " ]] incorrectly warns about incompatibility for services that work everywhere.
Fix: Add before the compatibility test:
if [[ "$gpu_backends" != "all" && ! " $gpu_backends " =~ " $current_backend " ]]; thenMedium:
- No Apple Silicon exemption — dashboard-api treats all Docker services as compatible on
apple, CLI doesn't. macOS users get spurious warnings. 2>/dev/null+|| echo "nvidia"violates CLAUDE.md error handling- Tests are grep-based, not behavioral
🤖 Reviewed with Claude Code
…ith dashboard-api
|
Updated per reviewer feedback Fixed the GPU backend validation issues: Core fixes:
Code quality:
The validation now correctly handles edge cases and matches the dashboard-api behavior. CPU-only users won't get spurious warnings, and services marked as universal ( Kindly review again. Thanks. |
|
ℹ️ API test failures are unrelated to this PR The failing tests ( This PR only modifies:
No Python code or API endpoints were changed. The test failures appear to be pre-existing issues or flaky tests unrelated to GPU backend validation. All shell-related tests pass successfully. |
Summary
Adds GPU backend compatibility validation to
dream enablecommand, preventing users from enabling extensions incompatible with their hardware.Problem
Users can currently enable any extension regardless of GPU backend compatibility. For example:
This leads to silent failures and confusing "service not starting" issues.
Solution
SERVICE_GPU_BACKENDSassociative array to service-registry.shgpu_backendsfield from extension manifests during registry loadcmd_enablebefore enabling extensionImplementation Details
GPU_BACKENDfrom.envfile (defaults to nvidia)gpu_backendsfield default to all backends (backward compatible)Example Output
Testing
bash -nandmake lintImpact
Related Work
Addresses extension compatibility gap identified in operability review. Complements PR #355 (container state validation).