当前位置: 首页 > news >正文

CANN / hcomm 实验性NIC插件指南

HCOMM Experimental NIC Plugin Guide

【免费下载链接】hcommHCOMM(Huawei Communication)是HCCL的通信基础库,提供通信域以及通信资源的管理能力。项目地址: https://gitcode.com/cann/hcomm

Overview

The HCOMM Experimental NIC Plugin extends the host-side NIC communication implementation in general server scenarios. The plugin is built and deployed as an independent.sofile. When creating a HOST endpoint or channel, HCOMM searches for registered plugins based onEndpointDesc.protocol. If a matching plugin protocol is found, the plugin implementation is used. Otherwise, the original built-in implementation is used.

This directory provides two example plugins:

PluginArtifactRegistered Protocol
HOST RoCE pluginlibhcomm_cpu_roce_plugin.soCOMM_PROTOCOL_ROCE
HOST UB pluginlibhcomm_cpu_ub_plugin.soCOMM_PROTOCOL_UBC_TP,COMM_PROTOCOL_UBC_CTP

Building and Packaging

Before compiling, complete the dependency installation, CANN software package installation, and environment variable configuration as described indocs/en/build/build.md.

After navigating to the repository root directory, execute the following command to compile the host package with experimental plugins enabled:

bash build.sh --pkg --experimental

To compile both the host and device packages:

bash build.sh --pkg --full --experimental

If the compilation environment does not have network access, download the third-party dependency packages in a networked environment, upload them to the compilation environment, and specify the dependency package path using--cann_3rd_lib_path:

bash build.sh --pkg --experimental --cann_3rd_lib_path={your_3rd_party_path}

After compilation, the HCOMM software package is generated in thebuild_outdirectory at the repository root:

./build_out/cann-hcomm_<version>_linux-<arch>.run

<version>is the software version number, and<arch>is the system architecture, for example,x86_64oraarch64.

Installation and Deployment

Install the compiled HCOMM software package:

bash ./build_out/cann-hcomm_<version>_linux-<arch>.run --full

Replace the package name in the command with the actual generated file name. After installation, the experimental plugins are installed in the HCOMM plugin directory:

${ASCEND_HOME_PATH}/hcomm_plugin/libhcomm_cpu_roce_plugin.so ${ASCEND_HOME_PATH}/hcomm_plugin/libhcomm_cpu_ub_plugin.so

For manual debugging, you can also copy the plugin.sofiles directly to the${ASCEND_HOME_PATH}/hcomm_plugin/directory.

Signature Verification Notes

Host-only plugin usage does not involve device package signature verification. If you compile and install the--fullpackage and run on-board tests, refer todocs/en/build/build.mdfor the steps to disable signature verification.

Enabling at Runtime

Before running, load the CANN or HCOMM environment variables. For the default installation path, execute:

source /usr/local/Ascend/cann/set_env.sh

For a specified installation path, execute:

source ${install_path}/cann/set_env.sh

The plugin loading rules are as follows:

  • WhenASCEND_HOME_PATHis not empty, HCOMM scans${ASCEND_HOME_PATH}/hcomm_plugin/*.so.
  • WhenASCEND_HOME_PATHis empty, HCOMM reads the plugin path specified byHCOMM_NIC_PLUGIN_SO.
  • HCOMM_NIC_PLUGIN_SOsupports multiple.sopaths separated by colons.

Example:

export HCOMM_NIC_PLUGIN_SO=/path/to/libhcomm_cpu_roce_plugin.so:/path/to/libhcomm_cpu_ub_plugin.so

Business code does not need to call plugin interfaces directly. When HCOMM creates a HOST endpoint throughHcommEndpointCreate, it searches for plugins based onEndpointDesc.protocol. If the protocol is registered by a plugin, subsequent endpoint, channel, and data plane interfaces are dispatched to the pluginops. If no matching plugin is found, the original built-in path is used.

Usage Conditions and Limitations

  • The plugin only applies to endpoints whereEndpointDesc.loc.locType == ENDPOINT_LOC_TYPE_HOST.
  • The current example plugins target general server host-only scenarios.
  • The current loader skips plugin loading when it detects that the number of runtime devices is non-zero.
  • When multiple plugins register the same protocol, the later-loaded plugin overrides the earlier one.
  • The plugin ABI must match the magic word, version, and size defined inHcommNicPluginInfo,HcommNicEndpointOps, andHcommNicChannelOps.

Custom Plugin Development Entry Points

Custom plugins need to export the following C ABI symbols:

const HcommNicPluginInfo *HcommNicPluginGetInfo(void); int32_t HcommNicPluginCreateEndpoint( const EndpointDesc *endpointDesc, void **outCtx, HcommNicEndpointOps **outOps); int32_t HcommNicPluginCreateChannel( void *epCtx, const HcommChannelDesc *channelDesc, void **outCtx, HcommNicChannelOps **outOps);

Development requirements:

  • Declare the plugin name and supportedCommProtocolinHcommNicPluginInfo.
  • FillHcommNicEndpointOpsfor the endpoint, implementing interfaces such as initialization, memory registration, export, import, and destroy.
  • FillHcommNicChannelOpsfor the channel, implementing interfaces such as initialization, status query, read, write, notify, fence, and destroy.
  • Ensure the magic word, version, and size in the ABI header match the definitions inhcomm_nic_plugin.h.

For reference, see the following files:

  • host_roce_plugin.cc: HOST RoCE plugin entry point.
  • host_ub_plugin.cc: HOST UB plugin entry point.
  • nic_plugin_ops.h: Example plugin ops adaptation template.
  • plugin_core.cc: Plugin common auxiliary logic.

Troubleshooting

If the plugin does not take effect, check the following items in order:

  1. Confirm that--experimentalwas added during the build and that the plugin.sois included in the software package.
  2. Confirm that the plugin.sois installed in${ASCEND_HOME_PATH}/hcomm_plugin/.
  3. Confirm thatASCEND_HOME_PATHorHCOMM_NIC_PLUGIN_SOis set according to the current loading rules.
  4. Confirm that the business creates a HOST endpoint, that is,EndpointDesc.loc.locType == ENDPOINT_LOC_TYPE_HOST.
  5. Confirm thatEndpointDesc.protocolis registered in the pluginHcommNicPluginInfo.protocols.
  6. Check the runtime log for the[NicPlugin]keyword to see whether the plugin was scanned, loaded, and its protocol registered.

【免费下载链接】hcommHCOMM(Huawei Communication)是HCCL的通信基础库,提供通信域以及通信资源的管理能力。项目地址: https://gitcode.com/cann/hcomm

创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考

http://www.jsqmd.com/news/1192819/

相关文章:

  • 【技术解析】基于双矢量优化MPC的MMC-PET光储系统谐波抑制与电网稳定策略
  • 2026官方认证!泉州晋江代理记账首选,透明无套路 - 热点速览
  • openEuler/deepin-rpm-installer开发实战:构建高效RPM安装服务的10个核心技术
  • FileSync终极指南:如何实现跨设备实时文件传输的完整教程
  • 批处理(bat)中的数组进阶:从模拟到实战应用
  • CANN/hcomm集群心跳监控模块
  • Neural Artistic Style开发者指南:如何扩展项目功能与自定义风格网络
  • Linux PAM 故障排除完全手册:解决常见认证问题的10个方法
  • 从CSV到交互式地图:Nanocube数据建模与.map文件配置终极教程
  • 华为Sound X5智能音箱:金标音质技术解析与智能家居体验
  • Jboot安全框架整合:Shiro认证授权与JWT令牌登录实现
  • 影刀RPA 常见数据格式校验:身份证、手机号、邮箱、URL的验证套路
  • AI视频情感分析与符号解读:从微表情到道具叙事的影视内容分析
  • 车载测试技术栈全解析:从CAN总线到HIL测试实战指南
  • TASO与TensorFlow/PyTorch集成指南:无缝提升现有模型推理速度
  • 卖黄金避坑指南,口碑回收老店推荐,实时金价结算无折旧提纯费 - 衡金阁
  • 历史影像数字修复与分析技术:从梵蒂冈档案到反重力现象验证
  • REEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE:编程社区中最具创意的多语言项目
  • FES2014潮汐模型:从数据下载到中国沿海精度验证的实践指南
  • C++与AutoHotkey深度集成:进程通信、DLL调用与脚本嵌入实战指南
  • 深入解析IWR1443毫米波雷达的JTAG调试与引导模式配置
  • AI TreasureBox开发者手册:如何贡献和维护这个AI资源聚合平台
  • DN-Splatter高级技巧:深度平滑损失与法线监督的优化配置指南
  • Java ThreadLocal 内存泄漏:原理、复现与正确姿势
  • 如何在openEuler集群部署sionlib?超详细步骤图解
  • 高中学习干预系统:知识图谱+学情诊断+自适应闭环
  • TradingView Webhooks Bot Docker部署完全指南:云端与本地部署最佳实践
  • 婺源卖金踩坑实录!5 家门店真实测评,全域上门回收认准清月知语 - 行行星
  • CANN/cannbot-skills CP4性能验收标准
  • DS90UB964-Q1行拼接模式配置实战:多路传感器数据融合与I2C控制详解