Troubleshoot Qualcomm AI Engine Direct Setup for Windows and Linux
Host Simulation or Code Generation Failures
If host simulation or code generation fails, check all the dependencies:
For the Linux® host, ensure that you set up the clang++ dependencies, as mentioned in the Qualcomm® AI Engine Direct SDK documentation.
For the Windows® host, ensure that you set up MSVC Visual Studio with clang++.
Before proceeding with simulation of the model, run the following commands to ensure that the required setup is completed and that the QNN model or context binary is a valid file. If they do not return values, fix the hardware setup or check the model once again.
qnn.internal.getHostSimulationExecutable
This command must return the path to the host-exectuable (.exe file for Windows) from temporary directory. For example, the output can be:
ans = '/tmp/MATLAB/qualcomm/host/2025b/QNN/mw_qnn_hostsim_2_29_0_241129'Use the
qnn.getNetworkPropertiesfunction to obtain a structure from the QNN model or QNN context binary, which ensures that the QNN model or QNN context binary is valid.In Windows, run
getNeworkPropertiesby specifying the .dll file (replace the argument in the below code with the actual path of the host model)This command must return a structure of input and output layers if the modelqnn.getNetworkProperties("QNN-Model",'<absolutepath to host model (.dll)'>)
In Linux, run
getNetworkPropertiesby specifying the .so file or .bin file. Use one of these commands, based on the backend (replace the argument in the below code with the actual path of the host model or context binary)qnn.getNetworkProperties("QNN-Model",'<absolute path to host model (.so)>') qnn.getNetworkProperties("BINARY",'<absolute path to HTP context binary>','HTP') qnn.getNetworkProperties("BINARY",'<absolute path to LPAI context binary>','LPAI')
This command must return a structure of input and output layers if the model.
On-target Failures for HTP or LPAI Backend
If you encounter on-target failures for HTP or LPAI backend, use verbose logs from the target at runtime.
For Simulink model, add the custom define in the model configuration:
set_param(bdroot, 'CustomDefine','DEFAULT_LOG_LEVEL=5')
For System object-based code deployment, add the custom define using
coder.updateBuildinfo in the MATLAB function used for code
generation:
coder.updateBuildInfo('addDefines', 'DEFAULT_LOG_LEVEL=5')
After the PIL execution is completed, you can find the runtime logs by clicking the Output logs and Error logs links in the Diagnostic Viewer.
QNN SDK Validation Failures on Windows
To avoid any failures related to QNN SDK validation on Windows host, ensure that QNN SDK installation path is mapped to a network drive instead of the UNC path, as part of the registration during the Hardware Setup process.