cann-env-setup

Installs and configures the CANN toolkit on Ascend NPU servers.

Updated Sep 15, 2026
One-click install
npx skills add https://github.com/WangWindow/CANN-BatchMatMulMaxsum --skill cann-env-setup-wangwindow
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cann-env-setup
Source: https://github.com/WangWindow/CANN-BatchMatMulMaxsum/tree/main/.agents/skills/cann-env-setup
Command: npx skills add https://github.com/WangWindow/CANN-BatchMatMulMaxsum --skill cann-env-setup-wangwindow

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Setting up the CANN (Compute Architecture for Neural Networks) development environment on Ascend NPU hardware involves driver checks, dependency verification, multiple installation methods, and environment variable configuration, which is error-prone when done manually. ## Core Features & Use Cases - Driver and Dependency Checks: Verify NPU driver status with npu-smi info and confirm Python/pip prerequisites before installation. - Multiple Installation Methods: Supports offline .run package installation, conda-based online installation, and yum-based installation for CentOS/RHEL systems. - Environment Configuration & Verification: Guides setting environment variables via set_env.sh and validates the installation through the ACL Python interface. - Use Case: You receive a new Ascend 910B server and need to install CANN toolkit and ops packages, configure environment variables permanently, and verify the setup before developing Ascend C operators. ## Quick Start Ask the assistant to walk you through installing CANN on your Ascend NPU server and verifying the environment is ready.

Frequently Asked Questions about cann-env-setup

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I check if the NPU driver is installed on an Ascend server?

Run npu-smi info in the terminal. If it displays NPU device information, the driver is installed; if it returns command not found, you must install the Ascend driver first.

How to install CANN offline with .run packages?

Install the toolkit package first with bash Ascend-cann-toolkit_*.run --install --quiet, then install the ops package the same way. The toolkit must always be installed before the ops package.

Can I install CANN using conda?

Yes. Create a conda environment, add the Ascend conda channel from repo.huaweicloud.com, then run conda install ascend::cann-toolkit and conda install ascend::cann-{chip}-ops matching your chip type.

How do I make CANN environment variables permanent?

Append source /usr/local/Ascend/ascend-toolkit/set_env.sh to your ~/.bashrc file. For the current terminal only, run the source command directly without editing bashrc.

How do I verify CANN installed successfully?

Run python3 -c "import acl;acl.init();acl.rt.set_device(0)". Successful execution confirms the CANN Python interface works; failure usually means environment variables are not configured correctly.

What dependencies are required before installing CANN?

Python 3 and pip must be installed before CANN installation. After installation, runtime packages such as numpy, scipy, cython, pyyaml, and protobuf 3.20.0 are installed via pip.