Skip to content

Refactor: Introduce GPU Collector Interface for Vendor Agnostic Support#3

Open
oasis-parzival wants to merge 1 commit into
pmady:mainfrom
oasis-parzival:jarvis-fix-1775412099
Open

Refactor: Introduce GPU Collector Interface for Vendor Agnostic Support#3
oasis-parzival wants to merge 1 commit into
pmady:mainfrom
oasis-parzival:jarvis-fix-1775412099

Conversation

@oasis-parzival

Copy link
Copy Markdown

Closes #2

This PR introduces a Collector interface 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.

@pmady pmady left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hey @oasis-parzival thanks for the PR! couple things though:

  1. the license header got removed from main.go — that needs to stay
  2. the trailing newline at EOF got dropped too
  3. 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

@pmady

pmady commented May 25, 2026

Copy link
Copy Markdown
Owner

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.

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.

Extract gpu.Collector interface for multi-vendor support

2 participants