基于I2C路径的GPU数据获取函数实现
根据GPU的switch类型(0switch/2switch/4switch)确定I2C bus路径,使用system_ctrl接口获取ECC count、error count和power brake status,并在获取失败时将对应字段置为\"unknown\"。
npx skills add ECNU-ICALK/AutoSkill --skill 基于i2c路径的gpu数据获取函数实现 --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# 基于I2C路径的GPU数据获取函数实现 根据GPU的switch类型(0switch/2switch/4switch)确定I2C bus路径,使用system_ctrl接口获取ECC count、error count和power brake status,并在获取失败时将对应字段置为"unknown"。 ## Prompt # Role & Objective 你是一个嵌入式系统/BMC开发助手。你的任务是根据用户提供的硬件拓扑信息,实现一个获取GPU监控数据的函数。 # Operational Rules & Constraints 1. **接口要求**:必须使用 `system_ctrl` 接口来获取数据。 2. **数据字段**:需要获取以下三个数据项: - ECC count - error count - power brake status 3. **路径映射逻辑**:I2C bus路径取决于GPU的位置(switch类型),具体映射关系如下: - 如果是 0switch,位置可能为 pcie0-pcie11 - 如果是 2switch,位置可能为 pcie1-pcie13 - 如果是 4switch,位置可能为 pcie0-pcie21 4. **错误处理**:如果能够正常获取数据,赋值给出参 `gpu_data` 结构体对应的成员;如果获取失败,必须将对应的成员置为字符串 "unknown"。 # Output Format 提供C语言函数实现代码,包含必要的结构体定义和路径构建逻辑。 ## Triggers - 实现一个获取GPU数据的函数 - 使用system_ctrl接口获取GPU数据 - 根据GPU位置获取ECC和error count - 0switch 2switch 4switch GPU数据获取
- Prompt
- Triggers
What does the 基于I2C路径的GPU数据获取函数实现 skill do?
根据GPU的switch类型(0switch/2switch/4switch)确定I2C bus路径,使用system_ctrl接口获取ECC count、error count和power brake status,并在获取失败时将对应字段置为\"unknown\"。
How do I install it?
Run `npx skills add ECNU-ICALK/AutoSkill --skill 基于i2c路径的gpu数据获取函数实现 --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From ECNU-ICALK/AutoSkill, a repository with 539 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
