icon温馨提醒 : 为提升您的浏览体验 , 推荐您使用Chrome浏览本网站。icon

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Read our privacy policy>

Select an environment and download an installation package.
Alternatively, create and deploy a model on ModelArts.
Obtaining Installation Commands
Hardware Platform
Ascend 910
Ascend 310
Operating System
Programming Language
Python 3.7.5
Python 3.9.0
Installation Mode

pip install https://ms-release.obs.cn-north-4.myhuaweicloud.com/1.5.0/MindSpore/ascend/aarch64/mindspore_ascend-1.5.0-cp37-cp37m-linux_aarch64.whl --trusted-host ms-release.obs.cn-north-4.myhuaweicloud.com -i https://pypi.tuna.tsinghua.edu.cn/simple

# Refer to the following installation guide, ensure that the installation dependency and environment variables are correctly configured.

Installation Guide

Installing MindSpore in Ascend 910 by pip

This document describes how to quickly install MindSpore in a Linux system with an Ascend 910 environment by pip.

System Environment Information Confirmation

  • Ensure that the 64-bit operating system is installed and the glibc>=2.17, where Ubuntu 18.04/CentOS 7.6/EulerOS 2.8/OpenEuler 20.03/KylinV10 SP1 are verified.

  • Ensure that right version GCC 7.3.0 is installed.

  • Ensure that gmp 6.1.2 is installed.

  • Ensure that OpenMPI 4.0.3 is installed. (optional, required for single-node/multi-Ascend and multi-node/multi-Ascend training)

  • Ensure that Python 3.7.5 or 3.9.0 is installed. If not installed, download and install Python from:

  • If you are using a ARM architecture system, please ensure that pip installed for current Python has a version >= 19.3.

  • Ensure that the Ascend AI processor software package (Ascend Data Center Solution 21.0.3) are installed, please refer to the Installation Guide.

    • Ensure that the current user has the right to access the installation path /usr/local/Ascendof Ascend AI processor software package, If not, the root user needs to add the current user to the user group where /usr/local/Ascend is located. For the specific configuration, please refer to the software package instruction document.

    • Install the .whl package provided in Ascend AI processor software package. The .whl package is released with the software package. After software package is upgraded, reinstall the .whl package.

      pip install /usr/local/Ascend/ascend-toolkit/latest/fwkacllib/lib64/topi-{version}-py3-none-any.whl
      pip install /usr/local/Ascend/ascend-toolkit/latest/fwkacllib/lib64/te-{version}-py3-none-any.whl
      pip install /usr/local/Ascend/ascend-toolkit/latest/fwkacllib/lib64/hccl-{version}-py3-none-any.whl
    • If the Ascend AI processor software package is upgraded, the .whl package also needs to be reinstalled, first uninstall the original installation package, and then refer to the above command to reinstall.

      pip uninstall te topi hccl -y

Installing MindSpore

It is recommended to refer to Version List to perform SHA-256 integrity verification, and then execute the following command to install MindSpore after the verification is consistent.

pip install https://ms-release.obs.cn-north-4.myhuaweicloud.com/{version}/MindSpore/ascend/{arch}/mindspore_ascend-{version}-{python_version}-linux_{arch}.whl --trusted-host ms-release.obs.cn-north-4.myhuaweicloud.com -i https://pypi.tuna.tsinghua.edu.cn/simple

Of which,

  • When the network is connected, dependency items are automatically downloaded during .whl package installation. (For details about the dependency, see required_package in setup.py .) In other cases, you need to install it by yourself. When running models, you need to install additional dependencies based on requirements.txt specified for different models in ModelZoo. For details about common dependencies, see requirements.txt.
  • {version} specifies the MindSpore version number. For example, when installing MindSpore 1.5.0, set {version} to 1.5.0, when installing MindSpore 1.5.0-rc1, the first {version} which represents download path should be written as 1.5.0-rc1, and the second {version} which represents file name should be 1.5.0rc1.
  • {arch} denotes the system architecture. For example, the Linux system you are using is x86 architecture 64-bit, {arch} should be x86_64. If the system is ARM architecture 64-bit, then it should be aarch64.
  • {python_version} spcecifies the python version for which MindSpore is built. If you wish to use Python3.7.5,{python_version} should be cp37-cp37m. If Python3.9.0 is used, it should be cp39-cp39.

Configuring Environment Variables

If Ascend AI processor software is installed in a non-default path, after MindSpore is installed, export runtime-related environment variables. /usr/local/Ascend in the following command LOCAL_ASCEND=/usr/local/Ascend denotes the installation path of the software package, please replace it as your actual installation path.

# control log level. 0-DEBUG, 1-INFO, 2-WARNING, 3-ERROR, default level is WARNING.
export GLOG_v=2

# Conda environmental options
LOCAL_ASCEND=/usr/local/Ascend # the root directory of run package

# lib libraries that the run package depends on
export LD_LIBRARY_PATH=${LOCAL_ASCEND}/ascend-toolkit/latest/fwkacllib/lib64:${LOCAL_ASCEND}/driver/lib64:${LOCAL_ASCEND}/ascend-toolkit/latest/opp/op_impl/built-in/ai_core/tbe/op_tiling:${LD_LIBRARY_PATH}

# Environment variables that must be configured
export TBE_IMPL_PATH=${LOCAL_ASCEND}/ascend-toolkit/latest/opp/op_impl/built-in/ai_core/tbe            # TBE operator implementation tool path
export ASCEND_OPP_PATH=${LOCAL_ASCEND}/ascend-toolkit/latest/opp                                       # OPP path
export PATH=${LOCAL_ASCEND}/ascend-toolkit/latest/fwkacllib/ccec_compiler/bin/:${PATH}                 # TBE operator compilation tool path
# Python library that TBE implementation depends on

Installation Verification


python -c "import mindspore;mindspore.run_check()"
  • The outputs should be the same as:
MindSpore version: __version__
The result of multiplication calculation is correct, MindSpore has been installed successfully!

It means MindSpore has been installed successfully.


import numpy as np
from mindspore import Tensor
import mindspore.ops as ops
import mindspore.context as context

x = Tensor(np.ones([1,3,3,4]).astype(np.float32))
y = Tensor(np.ones([1,3,3,4]).astype(np.float32))
print(ops.add(x, y))
  • The outputs should be the same as:
[[[[2. 2. 2. 2.]
   [2. 2. 2. 2.]
   [2. 2. 2. 2.]]

  [[2. 2. 2. 2.]
   [2. 2. 2. 2.]
   [2. 2. 2. 2.]]

  [[2. 2. 2. 2.]
   [2. 2. 2. 2.]
   [2. 2. 2. 2.]]]]

It means MindSpore has been installed successfully.

Version Update

Using the following command if you need to update the MindSpore version:

pip install --upgrade mindspore-ascend=={version}

Of which,

  • When updating to a release candidate (rc) version, {version} should be specified, e.g. 1.5.0rc1; When updating to a standard release, =={version} could be removed.
Installation Video Tutorials

Provides videos for installation, helping users install MindSpore on different hardware platforms.

Accessing ModelArts

ModelArts helps users quickly create and deploy models and manage the entire AI workflow. Click ModelArts to use MindSpore.