Environment Setup
- Before developing Ascend C operators, you need to install the driver, firmware, and CANN package to set up the environment by referring to CANN Software Installation Guide.
- Install the driver and firmware(required only for Ascend devices). For details, see the section about NPU driver and firmware installation.
- Install the CANN software package. For details about how to quickly install the CANN software package, see the section about CANN installation. To learn more about CANN installation in other scenarios, see other sections.
After the CANN package is installed, log in to the environment as the CANN operating user and run the source $INSTALL_DIR/set_env.sh command to set environment variables. Replace ${INSTALL_DIR} with the CANN component directory. For example, if the installation is performed by the root user, the default file storage path is /usr/local/Ascend/cann.
- Install CMake. CMake 3.16 or later is required to compile Ascend C operators. If the installed CMake version does not meet the requirement, install the required version by referring to the following example.
For the development of Ascend C operators, the driver and firmware are not necessarily required. For a non-Ascend device, you can use the CPU simulation environment to develop and test operators, and then use the Ascend device to perform accelerated computation. For details about how to install CANN on a non-Ascend device, see "Appendix B: Common Operations > Installing CANN on a Non-Ascend Device" in CANN Software Installation Guide.