gpu monitor — GPU 监控器
v1.0.0提供实时的NVIDIA GPU使用率和内存统计,以及通过解析server.log实现的Ollama模型层GPU/CPU分布的实时更新。
运行时依赖
安装命令
点击复制技能文档
GPU 监控 - Ollama Real-time GPU 监控ing 技能 Overview
This 技能 provides real-time GPU 监控ing for local Ollama 模型s. It 监控s:
GPU name and memory usage with utilization percentage (e.g., 8.5/10.0 GB = 85%) 模型 layer distribution (GPU vs CPU offloading) via Ollama server.记录 parsing Live 状态 更新s every 2 seconds
⚠️ 框架 Dependency: This 技能 is specifically de签名ed for the Ollama 框架 (https://ollama.AI). 📝 记录 Requirement: Requires 访问 to Ollama's server.记录 file at a configurable path to 解析 模型 layer in格式化ion.
Features
✅ Ollama-specific 监控ing: Automatically 解析s server.记录 for 模型 信息 when avAIlable ✅ Layer distribution 追踪ing: Shows GPU layers, total layers, and CPU offload percentage ✅ Memory 可视化: Displays memory used/total with real-time utilization % ✅ Cross-平台: Works on Windows/Linux/macOS with NVIDIA GPUs via nvidia-smi ✅ Real-time 更新s: Configurable refresh interval (default: 2 seconds) ✅ Flexible configuration: Specify Ollama 记录 path via 命令行工具 --ollama-记录=PATH or config file ✅ Graceful degradation: Shows GPU 指标 even without Ollama 安装ed
安装ation # Via ClawHub ClawHub 安装 gpu-监控-技能
# Or manual clone git clone <仓库-url> ~/.OpenClaw/技能s/gpu-监控
Usage (Local 测试) # Basic usage - 监控s local GPU python ~/.OpenClaw/ClawHub/gpu-监控-技能/gpu_监控.py --interval=3
# With Ollama 记录 path for layer 追踪ing python ~/.OpenClaw/ClawHub/gpu-监控-技能/gpu_监控.py \ --ollama-记录="C:\Users\zugzwang\应用Data\Local\Ollama\server.记录" \ --interval=2
# Using config file (创建 ~/.OpenClaw/gpu_监控_config.json) { "更新_interval_seconds": 2, "ollama_记录_path": "/path/to/server.记录", "quiet_mode": false }
Configuration
创建 ~/.OpenClaw/gpu_监控_config.json:
{ "更新_interval_seconds": 2, "ollama_记录_path": "/path/to/Ollama/server.记录", "quiet_mode": false }
Field Type Description 更新_interval_seconds int Refresh interval (default: 2) ollama_记录_path string Path to Ollama server.记录 (optional) quiet_mode bool Disable banner messages 输出 Examples With Ollama Layer 信息 ┌─[更新 #1] 12:30:45 ├─ GPU: NVIDIA GeForce RTX 3080 ├─ Memory Used: 8.5/10.0 GB (85.0%) ├─ 记录 Time: [实时模式 - 无层数数据] ├─ GPU Layers: [实时模式]
With Layer Data ┌─[更新 #1] 12:31:02 ├─ GPU: NVIDIA GeForce RTX 3080 ├─ Memory Used: 7.2/10.0 GB (72.0%) ├─ 记录 Time: time=2026-03-27T12:31:02+08:00 ├─ GPU Layers: 32 / 33 ├─ CPU Layers: 1 (3.0%)
Without Ollama ┌─[更新 #1] 12:32:15 ├─ GPU: NVIDIA GeForce RTX 3080 ├─ Memory Used: 9.2/10.0 GB (92.0%) ├─ 记录 Time: [实时模式 - 无层数数据] ├─ GPU Layers: [实时模式]
Prerequisites Python 3.7+ NVIDIA GPU with nvidia-smi avAIlable (Windows/Linux/macOS) (Optional) Ollama server for layer 追踪ing License
MIT License