Skip to content

Conversation

@ntheanh201
Copy link

Issue Type

  • Improvement/feature implementation

Runtime Environment

  • Kubernetes cluster
  • Operating system and version: [e.g. Ubuntu 20.04 LTS / Windows 10 Build 19043.1110]
  • Terminal emulator and version: [e.g. GNOME Terminal 3.36.2 / Windows Terminal 1.8.1521.0]
  • Python version: [e.g. 3.8.2 / 3.9.6]
  • NVML version (driver version): [e.g. 460.84]
  • nvitop version or commit: [e.g. 0.10.0 / 0.10.1.dev7+ga083321 / main@75ae3c]
  • python-ml-py version: [e.g. 11.450.51]
  • Locale: [e.g. C / C.UTF-8 / en_US.UTF-8]

Description

  • This PR introduces Kubernetes integration to nvitop.
  • Allow monitor Kubernetes resources by POD

Motivation and Context

Testing

Images / Videos

Screenshot 2025-11-14 at 16 38 35

@XuehaiPan XuehaiPan added enhancement New feature or request cli / tui Something related to the CLI labels Nov 16, 2025
@XuehaiPan XuehaiPan self-requested a review November 16, 2025 03:49
@XuehaiPan XuehaiPan self-assigned this Nov 16, 2025
Copy link
Owner

@XuehaiPan XuehaiPan left a comment

Choose a reason for hiding this comment

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

Hi @ntheanh201, thanks for the contribution. I wonder if you could add a separate package (use a new folder nvitop-kubernetes) for Kubernetes support. Then you can add a kubernetes extra here (merge the latest main):

nvitop/setup.py

Lines 75 to 87 in 5a4f1d5

extra_requirements = {
'exporter': ['nvitop-exporter'],
'prometheus': ['nvitop-exporter'],
'lint': [
'ruff',
'pylint[spelling]',
'xdoctest',
'mypy',
'typing-extensions',
'pre-commit',
],
'cuda10': ['nvidia-ml-py == 11.450.51'],
}


For the CLI monitor, you can subclass the GpuProcess class in the new nvitop_kubernetes module, then reuse the nvitop.cli with the following patch:

from nvitop.tui import Device
from nvitop_kubernetes.tui import ModifiedGpuProcess

Device.GPU_PROCESS_CLASS = ModifiedGpuProcess

For POD information in the CLI, you can prepend the information to the process command-line instead of adding a new column. Adding a new column could be too complex because there will be too many places to change (e.g., process sorting support, horizontal scrolling support (← → arrow key)).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli / tui Something related to the CLI enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request] 是否考虑出支持K8S的版本?

2 participants