基于I2C路径的GPU数据获取函数实现
FreeNo executable scriptsNot checked根据GPU的switch类型(0switch/2switch/4switch)确定I2C bus路径,使用system_ctrl接口获取ECC count、error count和power brake status,并在获取失败时将对应字段置为"unknown"。
by ECNU-ICALK★ 623 GitHub starsAbout this skill
基于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
- 接口要求:必须使用
system_ctrl接口来获取数据。 - 数据字段:需要获取以下三个数据项:
- ECC count
- error count
- power brake status
- 路径映射逻辑:I2C bus路径取决于GPU的位置(switch类型),具体映射关系如下:
- 如果是 0switch,位置可能为 pcie0-pcie11
- 如果是 2switch,位置可能为 pcie1-pcie13
- 如果是 4switch,位置可能为 pcie0-pcie21
- 错误处理:如果能够正常获取数据,赋值给出参
gpu_data结构体对应的成员;如果获取失败,必须将对应的成员置为字符串 "unknown"。
Output Format
提供C语言函数实现代码,包含必要的结构体定义和路径构建逻辑。
Triggers
- 实现一个获取GPU数据的函数
- 使用system_ctrl接口获取GPU数据
- 根据GPU位置获取ECC和error count
- 0switch 2switch 4switch GPU数据获取
Install 基于I2C路径的GPU数据获取函数实现 in Claude Code & Claude Desktop
Sign up to install this skill
Create a free account to reveal the install command and save the skill to your library.
- Reveal the one-line install command
- Save skills to your synced library
- Get notified when skills update
Allowed tools
Tools this skill is permitted to call.
No restriction — this skill can use any tool.
FAQ
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 the 基于I2C路径的GPU数据获取函数实现 skill?
Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.
Does the 基于I2C路径的GPU数据获取函数实现 skill run scripts?
No, this skill is instructions only (SKILL.md) with no executable scripts.
Related skills
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
by Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
by Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
by Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
by Anthropic