Refactor: Introduce GPU Collector Interface for Vendor Agnostic Support#3
Refactor: Introduce GPU Collector Interface for Vendor Agnostic Support#3oasis-parzival wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
hey @oasis-parzival thanks for the PR! couple things though:
- the license header got removed from main.go — that needs to stay
- the trailing newline at EOF got dropped too
- the Collector interface and factory function already exist in pkg/gpu/collector.go, so the main change here is really just a comment update
the issue is asking for a more substantial refactor — cleaning up the interface, adding vendor detection logic, maybe stub files for rocm/intel backends. if you want to take another pass at it with those pieces thatd be great
|
hey thanks for the interest! the Collector interface is actually already in place (pkg/gpu/collector.go + pkg/gpu/mock.go) so the vendor-agnostic plumbing is there. this PR mostly removes the license header from main.go which id prefer to keep. if you want to help with multi-vendor support, AMD ROCm (#25) is the real next step — that would need a new collector implementation using rocm-smi bindings. happy to discuss the approach if you are interested. |
Closes #2
This PR introduces a
Collectorinterface to decouple the GPU monitoring logic from the NVML implementation, paving the way for support of AMD and Intel GPUs. A factory function is added to dynamically select the appropriate collector based on detected GPU vendor at startup, and the main application logic is updated to utilize this factory. This refactor maintains existing functionality and test coverage while improving the project’s extensibility.