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

CANN/metadef环境部署指南

Environment Deployment

【免费下载链接】metadefAscend Metadata Definition项目地址: https://gitcode.com/cann/metadef

1. Environment Preparation

This project supports source code compilation. Before compiling from source, ensure CANN software (Ascend-cann-toolkit and Ascend-cann-ops (optional)) is installed. If running samples, NPU driver and firmware also need to be installed.

Select software installation method according to the following description:

Installation MethodDescriptionUsage Scenario
Using WebIDE InstallationWebIDE provides an online directly runnable Ascend environment. Currently provides single-machine computing power, default installation of latest commercial release CANN software package (currently CANN 8.5.0) and firmware/driver package.Suitable for developers without Ascend devices.
DockerDocker image is an efficient deployment method, one-click deployment of CANN package and essential dependencies.
Currently OS only supports Ubuntu.
Suitable for developers with Ascend devices who need to quickly set up environment.
Manual Software Package Installation-Suitable for developers with Ascend devices who want to experience manual CANN package installation or experience latest master branch capabilities.

Method 1: Using WebIDE Installation

For users without an environment, directly use the WebIDE development platform, namely "Operator One-Stop Development Platform". This platform provides an online directly runnable Ascend environment with essential software packages already installed, no manual installation needed. For more platform introduction, refer to LINK.

  1. Enter the open source project, click the "Cloud Development" button, and log in with a certified Huawei Cloud account. If not registered or certified, follow page prompts for registration and certification.

  2. Follow page prompts to create and start cloud development environment, click "Connect > WebIDE" to enter the operator one-stop development platform. Open source project resources default in/mnt/workspacedirectory.

Method 2: Docker Deployment

For developers not dependent on Ascend devices, if you want to quickly set up compilation build environment, use Docker image deployment.

Note: Image file is relatively large, download takes some time, please wait patiently. For docker command option introduction, query throughdocker --help.

1.Install Driver and Firmware (Runtime Dependency)

For Ascend driver and firmware download and installation on host machine, refer to "CANN Software Installation Guide" sections "Prepare Software Packages" and "Install NPU Driver and Firmware". Driver and firmware are runtime dependencies. If only compiling operators, installation is not required.

2.Download Image

  • Step 1: Log in to host machine as root user. Ensure Docker engine is installed on host machine (version 1.11.2 or above).

  • Step 2: Pull pre-integrated CANN software package and development-required dependency image from Ascend Image Repository. Commands below, select according to actual architecture (using Atlas A2 series products as example, compilation-only scenario does not need attention):

    # Example: Pull ARM architecture CANN development image docker pull --platform=arm64 swr.cn-south-1.myhuaweicloud.com/ascendhub/cann:9.0.0-beta.1-910-ubuntu22.04-py3.11 # Example: Pull X86 architecture CANN development image docker pull --platform=amd64 swr.cn-south-1.myhuaweicloud.com/ascendhub/cann:9.0.0-beta.1-910-ubuntu22.04-py3.11

3.Run DockerSelect different startup methods according to usage scenario:

  • Scenario 1: Compilation Build Only (No Need to Run Samples)

    If only code compilation build is needed, without accessing NPU device, use the following simplified command:

    docker run --name cann_container -it -u root --privileged=true -v /home/metadef/:/home/metadef swr.cn-south-1.myhuaweicloud.com/ascendhub/cann:9.0.0-beta.1-910-ubuntu22.04-py3.11 bash
  • Scenario 2: Need to Run Samples (Need to Access NPU Device)

    If running samples or tests is needed, container needs to access host NPU device. Using Atlas A2 series products as example:

docker run --name cann_container \ --device /dev/davinci0 \ --device /dev/davinci_manager \ --device /dev/devmm_svm \ --device /dev/hisi_hdc \ -v /usr/local/dcmi:/usr/local/dcmi \ -v /usr/local/bin/npu-smi:/usr/local/bin/npu-smi \ -v /usr/local/Ascend/driver/lib64/:/usr/local/Ascend/driver/lib64/ \ -v /usr/local/Ascend/driver/version.info:/usr/local/Ascend/driver/version.info \ -v /etc/ascend_install.info:/etc/ascend_install.info \ -it -u root --privileged=true \ swr.cn-south-1.myhuaweicloud.com/ascendhub/cann:9.0.0-beta.1-910-ubuntu22.04-py3.11 bash
ParameterDescriptionNote
--name cann_containerSpecify name for container, convenient for management.Optional (value can be customized).
--device /dev/davinci0Map NPU device file into container.Required (when running samples). For multiple devices, use this parameter multiple times, such as/dev/davinci0/dev/davinci1.
--device /dev/davinci_managerAscend device manager, responsible for device resource management.Required (when running samples).
--device /dev/devmm_svmDevice memory management unit.Required (when running samples).
--device /dev/hisi_hdcAscend high-definition codec device.Required (when running samples).
-v /usr/local/dcmi:/usr/local/dcmiMount DCMI (Device Communication Management Interface) directory.Required (when running samples).
-v /usr/local/bin/npu-smi:...Mount NPU monitoring tool, for viewing NPU status.Required (when running samples).
-v /usr/local/Ascend/driver/...Mount NPU driver library and version information.Required (when running samples).
-v /etc/ascend_install.info:...Mount Ascend software installation information.Required (when running samples).
-itCombination parameter of-i(interactive) and-t(allocate pseudo terminal).Required
-u rootEnter container as root (administrator).Recommended
--privileged=trueEnable container highest privilege mode.Recommended
swr.cn-south-1.myhuaweicloud.com/ascendhub/cann:...Specify Docker image to run.Required, ensure this image name and tag (tag) exactly match the image you pulled throughdocker pull.
bashCommand executed immediately after container starts.Required

Note:

  • Scenario 1 is suitable for compilation build only of metadef, without NPU device support
  • Scenario 2 is suitable for running samples or performing NPU-related tests, requires host machine already installed NPU driver and firmware
  • If using other model chips (such as 950, Atlas A3 series products), please accordingly adjust device names in--deviceparameter

4.Initialize EnvironmentAfter entering container, execute the following commands to initialize environment:

  • Scenario 1 (Compilation Build Only):

    curl -fsSL https://raw.gitcode.com/cann/metadef/raw/master/scripts/init_env.sh | bash
  • Scenario 2 (Need to Run Samples, using Atlas A2 series products as example):

    curl -fsSL https://raw.gitcode.com/cann/metadef/raw/master/scripts/init_env.sh | bash -s -- --chip-type 910b

Note:

  • For other chip models, replace--chip-typeparameter with corresponding model (such as950,A3)

Method 3: Manual Software Package Installation

Scenario 1: Experience Master Version Capabilities or Develop Based on Master Version

Click Download Link, select latest time version, and download corresponding package according to product model and environment architecture. Installation commands below, for more guidance refer to "CANN Software Installation Guide". CANN Toolkit development suite package installation method:

# Ensure installation package has executable permission chmod +x Ascend-cann-toolkit_${cann_version}_linux-${arch}.run # Installation command ./Ascend-cann-toolkit_${cann_version}_linux-${arch}.run --install --install-path=${install_path}
  • ${cann_version}: Indicates CANN package version number.
  • ${arch}: Indicates CPU architecture, such asaarch64,x86_64.
  • ${install_path}: Indicates specified installation path, needs to be installed in same path as toolkit package. Root user default installation in/usr/local/Ascenddirectory.

Scenario 2: Experience Released Version Capabilities or Develop Based on Released Version

If you want to experienceofficially released CANN packagecapabilities, visit CANN Official Download Center, select corresponding version CANN software package (only supports CANN 8.5.0 and subsequent versions) for installation.

【免费下载链接】metadefAscend Metadata Definition项目地址: https://gitcode.com/cann/metadef

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

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

相关文章:

  • RedisBloom未来展望:概率数据结构在AI时代的发展趋势
  • 从零开始:用Rufus打造你的万能系统启动盘
  • CryptoJS 加密库完整指南:5个核心功能深度解析
  • on-policy实战案例:构建你自己的多智能体强化学习系统
  • 终极Windows 11升级指南:如何绕过限制轻松升级旧设备
  • nProbe IPS模式配置教程:实现网络入侵防护的终极方案
  • 2026年评价高的江苏农业灌溉管材生产线/管材生产线/高速管材生产线/PPR管材生产线厂家精选合集 - 品牌宣传支持者
  • benchmark-ips源码剖析:理解Ruby性能测试的内部机制
  • VSCode 远程开发插件 WSL 与 SSH 模式区别是什么
  • 为什么你需要kubectl-node-shell:10个Kubernetes节点故障排查技巧 [特殊字符]
  • 【Midjourney扁平化风格实战指南】:零基础3步生成高转化UI图标,设计师私藏Prompt库首次公开
  • Agent Framework中的混合工作流设计
  • 软件研发 --- 应知应会 之 什么是云计算开发
  • 2026年推荐几家哈尔滨铜门/哈尔滨商业铜门/黑龙江磁悬浮极简门精选推荐公司 - 行业平台推荐
  • WuWa-Mod:创新高效的《鸣潮》游戏模组解决方案,解锁无限游戏体验
  • AI代理开发终极指南:深度解析Awesome Agent Skills中Google Gemini官方技能
  • image.nvim配置详解:10个关键参数优化技巧
  • vuex-class实战教程:从安装到项目部署的完整指南
  • 5月必看!央国企求职咨询机构优质推荐,央国企求职全流程服务/大学生就业规划/国企笔试面试培训,央国企求职咨询公司推荐 - 品牌推荐师
  • 终极指南:如何用Mac轻松制作Windows安装U盘(绕过TPM限制)
  • UxPlay蓝牙信标:无Bonjour环境下的创新服务发现方案
  • Mainframer社区贡献指南:从用户到开发者的完整路径
  • 怎样轻松掌握开源安全工具:实用双因素认证配置方案
  • FishNet核心组件解析:NetworkManager与NetworkObject的完整教程 [特殊字符]
  • FARM企业级部署:AWS SageMaker与Docker容器化实战指南
  • Static-Program-Analysis-Book实战案例:如何用静态分析技术发现真实世界中的程序漏洞
  • DeepL免费翻译插件终极指南:如何零成本享受专业级翻译服务
  • Diamond插件开发指南:如何扩展新的收集器和处理器
  • Ever Gauzy:开源ERP/CRM/HRM业务管理平台完整指南
  • 两极兼具的爱