-
Notifications
You must be signed in to change notification settings - Fork 4
nvswitch: Add NVSWITCH_ALIAS #28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds support for NVSwitch devices and introduces an NVSWITCH_ALIAS environment variable to override device naming, similar to the existing P_GPU_ALIAS for GPUs. The implementation refactors device discovery to use the go-nvlib library and adds CDI (Container Device Interface) spec generation for both GPUs and NVSwitches.
Changes:
- Added
NVSWITCH_ALIASenvironment variable support for customizing NVSwitch device naming - Refactored device discovery to use go-nvlib instead of manual PCI filesystem operations
- Implemented CDI spec generation for discovered VFIO devices
- Enhanced test coverage with mock-based testing approach
Reviewed changes
Copilot reviewed 8 out of 3090 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| cmd/main.go | Added environment variable reading for NVSWITCH_ALIAS |
| pkg/device_plugin/device_plugin.go | Refactored to use go-nvlib for device discovery and added NVSwitch support |
| pkg/device_plugin/device_plugin_test.go | Updated tests to use mocks instead of filesystem fixtures |
| pkg/device_plugin/generic_device_plugin.go | Simplified allocation logic and removed deprecated helper functions |
| pkg/device_plugin/generic_device_plugin_test.go | Updated test fixtures to use new data structures |
| pkg/device_plugin/constants.go | Added CDI-related constants and removed deprecated basePath |
| pkg/device_plugin/cdi.go | New file implementing CDI spec generation |
| go.mod | Updated Go version and added new dependencies |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ed2e6b6 to
820b450
Compare
rajatchopra
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
1a0ce46 to
68066df
Compare
Similar to P_GPU_ALIAS add NVSWTICH_ALIAS to override the name that is originally given by the DP nvidia.com/nvswitch: 4 nvidia.com/pgpu: 8 Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
Pull Request Test Coverage Report for Build 21154246385Details
💛 - Coveralls |
Similar to P_GPU_ALIAS add NVSWTICH_ALIAS to override he name that is originally given by the DP
Depends On: #26