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

Some MindSpore pages use cookies to optimize brower services. To read MindSpore Privacy Policy click here

Decline

Allow

English
简体中文
English
Install
Select an environment and download an installation package.
Alternatively, create and deploy a model on ModelArts.
MindSpore官网banner
Obtaining Installation Commands
Version
1.1.1
1.0.1
Hardware Platform
Ascend 910
Ascend 310
GPU CUDA 10.1
CPU
Operating System
EulerOS-aarch64
CentOS-aarch64
CentOS-x86
Ubuntu-aarch64
Ubuntu-x86
Windows-x64
Programming Language
Python 3.7.5
Installation Mode
Pip
Source
Docker
Commands
pip install https://ms-release.obs.cn-north-4.myhuaweicloud.com/1.1.1/MindSpore/ascend/euleros_aarch64/mindspore_ascend-1.1.1-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 to configure the environment variables.

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

  • Confirm that Ubuntu 18.04/CentOS 8.2/EulerOS 2.8 is installed with the 64-bit operating system.
  • Ensure that right version GCC is installed, for Ubuntu 18.04, EulerOS 2.8 users, GCC>=7.3.0; for CentOS 8.2 users, GCC>=8.3.1 .
  • Confirm that gmp 6.1.2 is installed.
  • Confirm that Python 3.7.5 is installed.
    • If you didn’t install Python or you have installed other versions, please download the Python 3.7.5 64-bit from Python or Huaweicloud to install.
  • Confirm that the Ascend 910 AI processor software package (Atlas Data Center Solution V100R020C20) are installed.
  • Confirm that the current user has the right to access the installation path /usr/local/Ascendof Ascend 910 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 910 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
      

Installing MindSpore

pip install https://ms-release.obs.cn-north-4.myhuaweicloud.com/{version}/MindSpore/ascend/{system}/mindspore_ascend-{version}-cp37-cp37m-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 other dependency items, see requirements.txt). In other cases, you need to manually install dependency items.
  • {version} denotes the version of MindSpore. For example, when you are installing MindSpore 1.1.0, {version} should be 1.1.0.
  • {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.
  • {system} denotes the system version. For example, if you are using EulerOS ARM architecture, {system} should be euleros_aarch64. Currently, the following systems are supported by Ascend: euleros_aarch64/euleros_x86/centos_x86/ubuntu_aarch64/ubuntu_x86.

Configuring Environment Variables

  • If Ascend 910 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}/add-ons/:${LOCAL_ASCEND}/ascend-toolkit/latest/fwkacllib/lib64:${LOCAL_ASCEND}/driver/lib64:${LOCAL_ASCEND}/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
    export PYTHONPATH=${TBE_IMPL_PATH}:${PYTHONPATH}
    # Python library that TBE implementation depends on
    

Installation Verification

  • After configuring the environment variables, execute the following Python script:

    import numpy as np
    from mindspore import Tensor
    import mindspore.ops as ops
    import mindspore.context as context
    
    context.set_context(device_target="Ascend")
    x = Tensor(np.ones([1,3,3,4]).astype(np.float32))
    y = Tensor(np.ones([1,3,3,4]).astype(np.float32))
    print(ops.tensor_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

Installing MindInsight

If you need to analyze information such as model scalars, graphs, computation graphs and model traceback, you can install MindInsight.

For more details, please refer to MindInsight.

Installing MindArmour

If you need to conduct AI model security research or enhance the security of the model in you applications, you can install MindArmour.

For more details, please refer to MindArmour.

Installing MindSpore Hub

If you need to access and experience MindSpore pre-trained models quickly, you can install MindSpore Hub.

For more details, please refer to MindSpore Hub.

Installing MindSpore Serving

If you need to access and experience MindSpore online inference services quickly, you can install MindSpore Serving.

For more details, please refer to MindSpore Serving.

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.