Environment Setup
This document uses the root user to simplify operations.
Setting Up the Hardware Environment
If an inference application needs to run after being developed, the Ascend hardware environment is required. This document uses Ascend hardware devices as examples to describe how to develop and run an application. Ensure that the driver, firmware, and operating system (OS) have been installed on the hardware.
Installing the CANN Development Kit
The low layer of mxVision depends on the CANN development kit (Ascend-CANN-Toolkit). For details about how to install the CANN, see in the CANN Software Installation Guide.
Obtaining the SDK Software Package
- {version} indicates the SDK version number and {arch} indicates the OS architecture.
- Multiple versions of SDK cannot be used in one system. Before using a new version, uninstall the old version or update the SDK
- On the software download page, select the required version and download it.
Installing Dependencies Required by the SDK
- Ubuntu: Run the sudo apt-get install -y xz-utils libgfortran-7-dev command to install dependencies.
- CentOS: Run the sudo yum install -y xz libgfortran4 command to install dependencies.
- Install Python 3.9.2.
- Run the wget command to download the Python 3.9.2 source package to any directory in the installation environment, for example, /usr/local.
wget https://www.python.org/ftp/python/3.9.2/Python-3.9.2.tgz
- Go to the download directory and run the following command to extract the source package:
tar -zxvf Python-3.9.2.tgz
- Go to the decompressed folder and run the following configuration, compilation, and installation commands:
cd Python-3.9.2 ./configure --prefix=/usr/local/python3.9.2 --enable-loadable-sqlite-extensions --enable-shared make make install
The --prefix parameter specifies the Python installation path. You can change it based on your requirements. The --enable-loadable-sqlite-extensions parameter is used to load libsqlite3-dev. The --enable-shared parameter is used to compile the libpython3.9.so.1.0 dynamic library.
This document uses --prefix=/usr/local/python3.9.2 as an example. After the configuration, compilation, and installation commands are executed, the installation package is stored in the /usr/local/python3.9.2 directory, and the libpython3.9.so.1.0 dynamic library is stored in the /usr/local/python3.9.2/lib/libpython3.9.so.1.0 directory.
- Set Python 3.9.2 environment variables.
# Set the Python 3.9.2 library path. export LD_LIBRARY_PATH=/usr/local/python3.9.2/lib:$LD_LIBRARY_PATH # If multiple Python 3 versions exist in the user environment, use Python 3.9.2. export PATH=/usr/local/python3.9.2/bin:$PATH
Environment variables that are set in the preceding mode take effect only in the current window. You can also write the preceding commands to the ~/.bashrc file and run the source ~/.bashrc command for the environment variables to take effect permanently. If you need to use other Python versions in the environment, you are advised not to write the preceding commands to the ~/.bashrc file.
- After the installation is complete, run the following command to check the installation version. If the required version information is displayed, the installation is successful.
python3 --version
- Run the wget command to download the Python 3.9.2 source package to any directory in the installation environment, for example, /usr/local.
Installing the SDK Software
- Log in to the development environment as the root user.
- Upload the mxVision development kit package to any path (for example, /home) in the installation environment.
- Grant the execute permission on the kit.
chmod +x Ascend-mindxsdk-mxvision_{version}_linux-{arch}.run - Go to the path where the mxVision development kit package is uploaded and install it.
./Ascend-mindxsdk-mxvision_{version}_linux-{arch}.run --installIf no error information is displayed after the installation, the software is successfully installed.The installation is successfully
After the installation is complete, the directory structure of the mxVision software is shown as follows:. ├── bin ├── config ├── filelist.txt ├── include ├── lib ├── opensource ├── operators ├── python ├── samples ├── set_env.sh ├── toolkit └── version.info
- Go to the mxVision installation directory and run the following command to make the MindX SDK environment variables take effect:
. set_env.sh