msOpGen FAQ¶
Compilation Error: fatal error: aclnn_xxx.h: No such file or directory¶
Symptom
When compiling a program that invokes an operator, the aclnn_xxx.h header file cannot be found.
Cause Analysis
The header file was not correctly installed to the op_api/include directory during operator deployment. Common causes include:
- An incorrect ASCEND_CUSTOM_OPP_PATH environment variable
- Multiple colon-separated paths where the header file was only copied to the first path
Solution
- Clear the environment variable:
unset ASCEND_CUSTOM_OPP_PATH - Redeploy the operator package:
./build_out/custom_opp_*.run - Verify the library path:
export LD_LIBRARY_PATH=${ASCEND_OPP_PATH}/vendors/customize/op_api/lib:$LD_LIBRARY_PATH
Compilation Error: soc_version Mismatch¶
Symptom
When creating or compiling an operator project, a chip model (soc_version) configuration error is reported.
Solution
- Run
npu-smi infoto query the Chip Name - Change
-c ai_core-Ascend<Chip_Name>to the correct value - Note that
ai_coreand the chip model are separated by a dash-, e.g.ai_core-ascend910b
Runtime Error: aclrtSetDevice failed¶
Symptom
When executing an operator invocation program, aclrtSetDevice failed. ERROR: xxxxxx is displayed.
Cause Analysis
Possible causes include:
- NPU device busy or hardware failure
- /dev/hisi_hdc device issue (not mounted in container, insufficient permissions)
- Driver/firmware version mismatch
- Insufficient system resources (memory, etc.)
Solution
- Run
npu-smi infoto check NPU status - Try switching NPU devices via
-d <device_id> - In container environments, verify that
--device=/dev/davinciXis correctly mounted - Check the driver installation. See CANN Software Installation Guide
- See ACL Error Code Reference for error code details
Output Is All Zeros or Random Values¶
Symptom
The operator execution completes but the output differs from the expected result — all zeros or random values.
Cause Analysis
Common causes include: - Pipeline synchronization errors in EnQue/DeQue in kernel-side code - DataCopy length (repeatTimes) mismatch with actual data size - Incorrect Tiling block computation parameters (totalLength, tileNum)
Solution
- Check that every
AllocTensorinop_kernel/*.cpphas a correspondingFreeTensor - Verify that
EnQueandDeQueare called in matching pairs with correct order - Validate Tiling parameter passing
- Use the msOpST tool for precision comparison validation
Permission Denied During Operator Package Deployment¶
Symptom
Permission denied error when executing the .run operator installation package.
Solution
- Use
--install-path=<path>to specify a writable custom installation directory - Run
source <path>/vendors/<vendor_name>/bin/set_env.bashto apply the changes - Or contact the CANN installation user to modify the
vendorsdirectory permissions
Operator Not Found After Deployment¶
Symptom
The operator package has been deployed but the operator cannot be found in the program.
Solution
- Confirm the
.runpackage executed successfully (no error output) - Check that the
ASCEND_CUSTOM_OPP_PATHenvironment variable contains the correct deployment path - Check the
load_priorityconfiguration inopp/vendors/config.ini - When installing to a custom path, run
source <path>/vendors/<vendor_name>/bin/set_env.bash