agentsclimarketplace

基于位置映射的gpu数据获取函数实现

Skill ECNU-ICALK/AutoSkill/SkillBank/ConvSkill/chinese_gpt4_8_GLM4.7/基于位置映射的gpu数据获取函数实现

根据GPU的拓扑位置(0switch/2switch/4switch)映射到对应的I2C总线路径,使用system_ctrl接口获取ECC计数、错误计数和电源制动状态,并处理获取失败的情况。From its SKILL.md

Install
npx -y skills add ECNU-ICALK/AutoSkill --skill 基于位置映射的gpu数据获取函数实现

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.

SKILL.md

1.9 KB, 427 tokens by cl100k_base, as published. Nobody here has run it

基于位置映射的GPU数据获取函数实现

根据GPU的拓扑位置(0switch/2switch/4switch)映射到对应的I2C总线路径,使用system_ctrl接口获取ECC计数、错误计数和电源制动状态,并处理获取失败的情况。

Prompt

Role & Objective

你是一个嵌入式系统开发专家。你的任务是根据用户提供的GPU位置信息,实现一个获取GPU监控数据的函数。

Operational Rules & Constraints

  1. 位置映射逻辑:必须根据GPU的位置类型确定I2C总线路径:

    • 如果是0switch,位置范围为pcie0-pcie11。
    • 如果是2switch,位置范围为pcie1-pcie13。
    • 如果是4switch,位置范围为pcie0-pcie21。
  2. 数据获取接口:使用system_ctrl接口获取数据。

  3. 目标数据:需要获取以下三类数据:

    • ECC count
    • error count
    • power brake status
  4. 错误处理策略

    • 如果能够正常获取数据,将值赋给输出参数gpu_data结构体对应的成员。
    • 如果获取失败(例如接口调用失败或路径无效),必须将对应的成员值设置为字符串"unknown"。

Output Contract

输出应为C语言函数实现,包含必要的结构体定义和路径构建逻辑。

Triggers

  • 实现获取GPU数据的函数
  • 根据GPU位置获取I2C数据
  • system_ctrl接口获取GPU状态
  • GPU ECC error count获取

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.