When I create a custom operator according to the UDO tutorial in the document, I encounter the following error:
snpe-udo-package-generator -p $SNPE_ROOT/examples/NativeCpp/UdoExample/Softmax/config/Softmax.json -o $SNPE_ROOT/models/inception_v3/2024-05-20 18:38:22,210 - 214 - INFO - Creating new package at: ./snpe-1.66.0.3729/models/inception_v3/SoftmaxUdoPackage2024-05-20 18:38:22,211 - 219 - WARNING - DSP Operation detected but HEXAGON_SDK_ROOT is not set. Please note HEXAGON_SDK_ROOT needs to be set to compile the package.Traceback (most recent call last):File "./snpe-1.66.0.3729/bin/x86_64-linux-clang/snpe-udo-package-generator", line 35, in <module>config_path=args.config_path)File "./snpe-1.66.0.3729/lib/python/qti/aisw/converters/backend/custom_ops/snpe_udo_config.py", line 243, in setup_file_pathsself.copy_udo_dir("utils", CUSTOM_OP_DIR, cpu_util_src_dir)NameError: name 'CUSTOM_OP_DIR' is not defined
Looking at the lib/python/qti/aisw/converters/backend/custom_ops/snpe_udo_config.py, It looks like I need to set the env "QNN_SDK_ROOT" , then the variable 'CUSTOM_OP_DIR' will be set.
QNN_SDK_ROOT = os.getenv("QNN_SDK_ROOT")
if QNN_SDK_ROOT is not None:SHARE_LOC_PREFIX = os.path.join(os.path.abspath(QNN_SDK_ROOT), 'target', 'x86_64-linux-clang', 'share', 'OpPackageGenerator')CUSTOM_OP_DIR = os.path.join(SHARE_LOC_PREFIX, 'CustomOp')