How shanselman/gputaskman works
gputaskman is a cross-platform terminal monitor for GPU devices and per-process workloads. The user launches the CLI, which gathers device and process counters, enriches process rows with runtime/model and LLM-buffer evidence, then presents a live TUI or script-friendly report; recording and comparison are additional output paths. Backend and platform details are mapped from the README and source index. Several subsystem links rely on indexed imports or README statements rather than sampled call sites, so uncertain connections are omitted.
Main entry points: collector.py Snapshot collector · cli.py CLI · llm.py LLM analysis · app.py Live TUI
Components 22
GPU sampling
- Snapshot collector
src/gputaskman/collector.py - Device recovery
src/gputaskman/recovery.py
Process and model insight
- Process inspection
src/gputaskman/procinfo.py - LLM analysis
src/gputaskman/llm.py - GGUF estimates
src/gputaskman/gguf.py
Platform measurements
- Adapter discovery
src/gputaskman/dxgi.py - Windows counters
src/gputaskman/pdh.py - NVIDIA telemetry
src/gputaskman/nvml.py - Linux DRM backend
src/gputaskman/drm.py - Linux integration
src/gputaskman/linux.py - Apple GPU backend
src/gputaskman/macos.py - WSL host counters
src/gputaskman/wslhost.py - AMD telemetry
src/gputaskman/adl.py - AMD SMI
src/gputaskman/amdsmi.py - Host sampler
src/gputaskman/host.py
Reports and history
- Text and JSON
src/gputaskman/report.py - Snapshot recording
src/gputaskman/record.py - Snapshot comparison
src/gputaskman/diff.py
Other components
- User
- Local LLM servers
Connections 27
- User → CLI: runs
README.md - CLI → Live TUI: launches
src/gputaskman/cli.py - CLI → Snapshot collector: samples
src/gputaskman/cli.py - CLI → Text and JSON: formats output
src/gputaskman/cli.py - CLI → Snapshot recording: records snapshots
src/gputaskman/cli.py - CLI → Snapshot comparison: compares snapshots
src/gputaskman/cli.py - Live TUI → Snapshot collector: refreshes snapshot
src/gputaskman/app.py - Live TUI → Host sampler: samples system stats
src/gputaskman/app.py - Snapshot collector → Adapter discovery: enumerates GPUs
src/gputaskman/collector.py - Snapshot collector → Windows counters: reads counters
src/gputaskman/collector.py - Snapshot collector → NVIDIA telemetry: samples NVIDIA
src/gputaskman/collector.py - Snapshot collector → Linux DRM backend: samples Linux DRM
src/gputaskman/collector.py - Snapshot collector → Linux integration: uses Linux backend
src/gputaskman/collector.py - Snapshot collector → Apple GPU backend: uses Apple backend
src/gputaskman/collector.py - Snapshot collector → WSL host counters: reads host data
src/gputaskman/collector.py - Snapshot collector → AMD telemetry: samples AMD
src/gputaskman/collector.py - Snapshot collector → AMD SMI: samples AMD
src/gputaskman/collector.py - Snapshot collector → Process inspection: inspects processes
src/gputaskman/collector.py - Snapshot collector → LLM analysis: analyzes workloads
src/gputaskman/collector.py - LLM analysis → GGUF estimates: estimates buffers
src/gputaskman/llm.py - Process inspection → GGUF estimates: reads model metadata
src/gputaskman/procinfo.py - LLM analysis → Local LLM servers: queries APIs
src/gputaskman/llm.py - Snapshot recording → Snapshot collector: captures snapshots
src/gputaskman/record.py - Snapshot recording → Text and JSON: serializes data
src/gputaskman/record.py - Snapshot comparison → LLM analysis: compares workload details
src/gputaskman/diff.py - Device recovery → Snapshot collector: reinitializes sampling
src/gputaskman/recovery.py - Device recovery → NVIDIA telemetry: refreshes device access
src/gputaskman/recovery.py