Centerm CANN is a heterogeneous computing architecture for AI scenarios developed by Huawei, which enables users to quickly build AI applications and services based on centerm platform.

This article describes the process of manually deploying the development environment (separate from the runtime environment) on Ubuntu and installing MindStudio.

Note: It can also be installed automatically using the msInstaller tool. However, the installation service encountered interruption issues in the practice of this article. Therefore, the manual installation method is given.

Basic instructions

Requirements:

  • Ubuntu 18.04 x86

Non-ascension devices: can only be used for code development, compilation and other pure development activities that do not rely on Ascension chips.

Separate deployment of development and operational environments:

Obtaining software Packages

  • Software packages (reasoning)
    • Ascend – cann – toolkit_5. 0.2 alpha003_linux – x86_64. Run
    • Ascend – cann – toolkit_5. 0.2 alpha003_linux – aarch64. Run
    • MindStudio_3. 0.1 _linux. Tar. Gz

Download page, Chinese and English versions may be different.

(Optional) Configuring users

This section is required when the user is not the root user. Otherwise, skip this section.

Create user (non-root) :

sudo -i

# create user
groupadd HwHiAiUser
useradd -g HwHiAiUser -d /home/HwHiAiUser -m HwHiAiUser -s /bin/bash
passwd HwHiAiUser

# add permission
chmod u+w /etc/sudoers
vi /etc/sudoers
  # User privilege specification
  HwHiAiUser ALL=(ALL:ALL) ALL
chmod u-w /etc/sudoers

# Switch user
su HwHiAiUser
Copy the code

Install dependencies

sudo apt update sudo apt-get install -y gcc g++ make cmake zlib1g zlib1g-dev libsqlite3-dev openssl libssl-dev libffi-dev unzip pciutils net-tools libblas-dev gfortran libblas3 libopenblas-dev wget https://www.python.org/ftp/python/3.7.5/Python-3.7.5.tgz tar ZXVF Python - 3.7.5. TGZcdPython - 3.7.5. / configure -- prefix =$HOME/python3.7.5 --enable-loadable -- sqlite-extensions --enable-shared make -j 'nproc' make install sudo cp$HOME/ python3.7.5 / lib/libpython3.7 Margaret spellings o. 1.0 / usr/lib sudo ln -s$HOME/python3.7.5/bin/python3 /usr/bin/python3.7
sudo ln -s $HOME/python3.7.5/bin/pip3    /usr/bin/pip3.7
sudo ln -s $HOME/python3.7.5/bin/python3 /usr/bin/python3.7.5
sudo ln -s $HOME/python3.7.5/bin/pip3    /usr/bin/pip3.7.5

sudo ln -s $HOME/python3.7.5/bin/pip3      /usr/bin/pip3
sudo ln -s $HOME/ python3.7.5 / lib/python3.7 / usr/lib/python3.7 pip3.7.5 configsetGlobal. The index - url https://mirrors.aliyun.com/pypi/simple/ pip3.7.5 install attrs psutil decorator numpy protobuf = = 3.11.3 scipy sympy cffiCopy the code

Installing the Development Package

Run $./Ascend-cann-toolkit_5.0.2. Alpha003_linux-x86_64. run $./Ascend-cann-toolkit_5.0.2. Alpha003_linux-x86_64. run --install Verifying archive integrity... 100% SHA256 checksums are OK. All good. Uncompressing ASCEND_RUN_PACKAGE 100% [Toolkit] [20210610-20:42:05] [INFO] LogFile:/home/HwHiAiUser/var/log/ascend_seclog/ascend_toolkit_install.log [Toolkit] [20210610-20:42:05] [INFO] install start [Toolkit] [20210610-20:42:05] [INFO] The install path is /home/HwHiAiUser/Ascend ! [Toolkit] [20210610-20:42:05] [WARNING] driver package maybe not installed [Toolkit] [20210610-20:42:05] [WARNING] driver package maybe not installed [Toolkit] [20210610-20:42:05] [INFO] install package Ascend-acllib-1.78.t20.0.b200-linux.x86_64.run start [Toolkit] [20210610-20:42:08] [INFO] Ddl-acllib-1.78.t20.0.b200-linux.x86_64. run --devel --quiet --nox11 install success [Toolkit] [20210610-20:42:08] [INFO] Install package Ascend- pyacl-3.3.0.alpha003-linux.x86_64. run start [Toolkit] [20210610-20:42:08] [INFO] Alpha003-linux.x86_64. run --devel --quiet --nox11 install success [Toolkit] [20210610-20:42:08] [INFO] Install package Ascend- ATC-1.78.t20.0.b200-linux.x86_64. run start [Toolkit] [20210610-20:42:41] [INFO] install package Ascend- ATC-1.78.t20.0.b200-linux.x86_64. run start [Toolkit] [20210610-20:42:41] Run --devel --pylocal --quiet --nox11 install success [Toolkit] [20210610-20:42:41] [INFO] Install package Ascend-opp-1.78.t20.0.b200-linux.x86_64.run start [Toolkit] [20210610-20:43:11] [INFO] Ascend-opp-1.78.t20.0.b200-linux.x86_64.run --devel --quiet -- NOX11 install success [Toolkit] [20210610-20:43:11] [INFO] Install package Ascend- Toolkit -1.78.t20.0.b200-linux.x86_64.run start [Toolkit] [20210610-20:44:11] [INFO] Ascend Toolkit -1.78.t20.0.b200-linux.x86_64. Run --devel --pylocal --quiet -- NOX11 install Success [Toolkit] [20210610-20:44:11] [INFO] Install package ascend310-aicpu_kernel-1.78.t20.0.b200. run start [Toolkit] [20210610-20:44:12] [INFO] ASCENd310-aicpu_kernel-1.78.t20.0.b200. run --devel --quiet -- NOX11 install success [Toolkit] [20210610-20:44:12] [INFO] Install Package ascend910-aicpu_kernel-1.78.t20.0.b200. run start [Toolkit] [20210610-20:44:13] [INFO] ascend910-aicpu_kernel-1.78.t20.0.b200. run --devel --quiet -- NOX11 install success [Toolkit] [20210610-20:44:13] [INFO] Install Package ascend310-aicpu_kernels_minirc-1.78.t20.0.b200. run start [Toolkit] [20210610-20:44:14] [INFO] ascend310-aicpu_kernels_minirc-1.78.t20.0.b200. run --devel --quiet -- NOX11 install success [Toolkit] [20210610-20:44:14] [INFO] /home/HwHiAiUser/Ascend/ascend_cann_install.info generate success [Toolkit] [20210610-20:44:14] [INFO] Please make sure that: Offline infer develop (cannot coexist with other scenes): LD_LIBRARY_PATH includes : /home/HwHiAiUser/Ascend/ascend-toolkit/latest/acllib/lib64: PYTHONPATH includes : /home/HwHiAiUser/Ascend/ascend-toolkit/latest/pyACL/python/site-packages/acl: /home/HwHiAiUser/Ascend/ascend-toolkit/latest/toolkit/python/site-packages: ASCEND_AICPU_PATH includes : /home/HwHiAiUser/Ascend/ascend-toolkit/latest: ASCEND_OPP_PATH includes : /home/HwHiAiUser/Ascend/ascend-toolkit/latest/opp: TOOLCHAIN_HOME includes : /home/HwHiAiUser/Ascend/ascend-toolkit/latest/toolkit: Third party AI framework develop (cannot coexist with other scenes): PATH includes : /home/HwHiAiUser/Ascend/ascend-toolkit/latest/fwkacllib/ccec_compiler/bin: /home/HwHiAiUser/Ascend/ascend-toolkit/latest/fwkacllib/bin: LD_LIBRARY_PATH includes : /home/HwHiAiUser/Ascend/ascend-toolkit/latest/fwkacllib/lib64: PYTHONPATH includes : /home/HwHiAiUser/Ascend/ascend-toolkit/latest/fwkacllib/python/site-packages: /home/HwHiAiUser/Ascend/ascend-toolkit/latest/toolkit/python/site-packages: ASCEND_OPP_PATH includes : /home/HwHiAiUser/Ascend/ascend-toolkit/latest/opp: ASCEND_AICPU_PATH includes : /home/HwHiAiUser/Ascend/ascend-toolkit/latest: TOOLCHAIN_HOME includes : /home/HwHiAiUser/Ascend/ascend-toolkit/latest/toolkit: Model transformation and operator develop (cannot coexist with other scenes): PATH includes : /home/HwHiAiUser/Ascend/ascend-toolkit/latest/atc/ccec_compiler/bin: /home/HwHiAiUser/Ascend/ascend-toolkit/latest/atc/bin: LD_LIBRARY_PATH includes : /home/HwHiAiUser/Ascend/ascend-toolkit/latest/atc/lib64: PYTHONPATH includes : /home/HwHiAiUser/Ascend/ascend-toolkit/latest/atc/python/site-packages: /home/HwHiAiUser/Ascend/ascend-toolkit/latest/toolkit/python/site-packages: ASCEND_OPP_PATH includes : /home/HwHiAiUser/Ascend/ascend-toolkit/latest/opp: TOOLCHAIN_HOME includes : /home/HwHiAiUser/Ascend/ascend-toolkit/latest/toolkit: [Toolkit] [20210610-20:44:15] [INFO] Ascend-cann-toolkit_5.0.2. Alpha003_linux-x86_64 path is /home/HwHiAiUser/Ascend !Copy the code
$chmod +x Ascend-cann-toolkit_5.0.2. Alpha003_linux-aarch64. run $./Ascend-cann-toolkit_5.0.2. Alpha003_linux-aarch64. run  --install Verifying archive integrity... 100% SHA256 checksums are OK. All good. Uncompressing ASCEND_RUN_PACKAGE 100% [Toolkit] [20210610-20:46:27] [INFO] LogFile:/home/HwHiAiUser/var/log/ascend_seclog/ascend_toolkit_install.log [Toolkit] [20210610-20:46:27] [INFO] install start [Toolkit] [20210610-20:46:27] [INFO] The install path is /home/HwHiAiUser/Ascend ! [Toolkit] [20210610-20:46:27] [WARNING] driver package maybe not installed [Toolkit] [20210610-20:46:27] [WARNING] driver package maybe not installed [Toolkit] [20210610-20:46:27] [INFO] The current OS is x86_64 [Toolkit] [20210610-20:46:27] [INFO] Install package Ascend-acllib-1.78.t20.0.b200-linux.aarch64.run start [Toolkit] [20210610-20:46:29] [INFO] Ascend-acllib-1.78.t20.0.b200-linux.aarch64.run --devel --quiet -- NOX11 install success [Toolkit] [20210610-20:46:29] [INFO] Install Package ascend310-aicpu_kernel-1.78.t20.0.b200. run start [Toolkit] [20210610-20:46:31] [INFO] ascend310-aicpu_kernel-1.78.t20.0.b200. run --devel --quiet -- NOX11 install success [Toolkit] [20210610-20:46:31] [INFO] Install Package ascend310-aicpu_kernels_minirc-1.78.t20.0.b200. run start [Toolkit] [20210610-20:46:32] [INFO] ascend310-aicpu_kernels_minirc-1.78.t20.0.b200. run --devel --quiet -- NOX11 install success [Toolkit] [20210610-20:46:32] [INFO] Ascend-cann-toolkit_5.0.2. Alpha003_linux-aarch64 path is /home/HwHiAiUser/Ascend !Copy the code

Creating a Docker image (optional)

Docker pull Ubuntu :18.04 cat <<-EOF > Dockerfile # syntax = docker/Dockerfile: experimental FROM ubuntu: 18.04 ARG ASCEND_DIR. = / ascend #. / # ascend Ascend - cann - toolkit_5. 0.2 alpha003_linux - x86_64. Run # Ascend - cann - toolkit_5. 0.2 alpha003_linux - aarch64. Run # Python-3.7.5. TGZ COPY \${ASCEND_DIR} /ascend RUN apt-get update \\ && apt-get install -y GCC g++ make cmake zlib1g zlib1g-dev libsqlite3-dev \\ openssl libssl-dev libffi-dev unzip pciutils net-tools \\ && rm -rf /var/lib/apt/lists/* RUN CD /ascend \\ && tar -zxvf python-3.7.5. TGZ \\ && CD python-3.7.5 \\ &&./configure --prefix=/usr/local/python3.7.5 \\ --enable-loadable-sqlite-extensions --enable-shared \\ && make -j\$(nproc) && make install \\ && cp / usr/local/python3.7.5 / lib/libpython3.7 Margaret spellings o. 1.0 / usr/lib \ \ && ln -s/usr/local/python3.7.5 / bin/python3 / usr/bin/python3 \ \ && ln -s/usr/local/python3.7.5 / bin/pip3 / usr/bin/pip3 \ \ && ln -s/usr/local/python3.7.5 / bin/python3 The/usr/bin/python3.7 \ \ && ln -s/usr/local/python3.7.5 / bin/pip3 / usr/bin/pip3.7 \ \ && ln -s / usr/local/python3.7.5 / bin/python3 / usr/bin/python3.7.5 \ \ && ln -s/usr/local/python3.7.5 / bin/pip3 / usr/bin/pip3.7.5 \ \ &&pip3.7.5 install attrs psutil decorator numpy protobuf== symppy sympy \ cffi-i https://mirrors.aliyun.com/pypi/simple/ \ \ & rm - r/ascend/Python - 3.7.5 RUN CD/ascend \ \ && chmod + x *. RUN \ \ && Run \\ --install-username=root --install-usergroup=root --install \\./Ascend-cann-toolkit_5.0.2.alpha003_linux-x86_64 &&./Ascend-cann-toolkit_5.0.2.alpha003_linux-aarch64.run \\ --install-username=root --install-usergroup=root --install RUN echo '\nawk "/Please make sure that:/,/chmod_authority/" /var/log/ascend_seclog/ascend_toolkit_install.log' >> /root/.bashrc CMD ["/bin/bash"] EOFDocker build \ -t ascend/cann: 5.0.2. Alpha003 \ - build - arg ASCEND_DIR. = / ascend \ - f/Dockerfile docker run - it - the rm Ascend/cann: 5.0.2 alpha003Copy the code

Install MindStudio

The tar XZVF MindStudio_3. 0.1 _linux. Tar. Gz - C$HOME
sudo ln -s $HOME/MindStudio/bin/MindStudio.sh /usr/local/bin/MindStudio
Copy the code

If you run MindStudio for the first time, run the following command to install:

$ MindStudio
Checking MindStudio environment dependencies...
Success

Checking Python environment dependencies...
Success

Some dependencies are missing. Execute the following commandfirst: Sudo apt - get - y install xterm fonts -- wqy zenhei fonts -- wqy microhei && / home/HwHiAiUser python3.7.5 / bin/pip3 install --user grpcio coverage gnureadline pylint matplotlib requests pandas xlrd absl-pyCopy the code

You also need to install the JDK:

sudo apt-get -y install openjdk-8-jdk
Copy the code

Finally, MindStudio is up and running.

Configuration MindStudio

First prompt to import Settings:

Select not to import OK. If you have previously set, can set a path, such as: $HOME/config/Huawei/MindStudioMS – 3.0.

Then select the development package path:

Then the user experience improved:

Finally enter the home page of MindStudio:

reference

  • Ascend
  • Rising CANN

GoCoding personal practice experience sharing, please pay attention to the public account!