File tree Expand file tree Collapse file tree 1 file changed +12
-7
lines changed
backends/qualcomm/scripts Expand file tree Collapse file tree 1 file changed +12
-7
lines changed Original file line number Diff line number Diff line change 14
14
# === executorch/backends/qualcomm path ===
15
15
PKG_ROOT = pathlib .Path (__file__ ).parent .parent
16
16
QNN_SDK_PATH = PKG_ROOT / "sdk" / "qnn"
17
- libcxx_DIR_PATH
18
17
19
18
20
19
def is_linux_x86 () -> bool :
@@ -216,19 +215,25 @@ def _load_libcxx_libs(lib_path):
216
215
# === End of libcxx handling ===
217
216
218
217
219
- def install_qnn_sdk (force_download : bool = True ) -> bool :
218
+ def install_qnn_sdk (force_download : bool = False ) -> bool :
220
219
"""Ensure QNN SDK + libc++ are available and loaded."""
221
220
# --- set up QNN SDK ---
222
221
if not QNN_SDK_PATH .exists ():
223
- if force_download :
224
- if not _download_qnn_sdk ():
225
- return False
226
- else :
227
- print ("[INIT] Qualcomm SDK not found and force_download=False" )
222
+ print (f"[INIT] Qualcomm SDK not found at { QNN_SDK_PATH } , downloading..." )
223
+ if not _download_qnn_sdk ():
224
+ return False
225
+ elif force_download :
226
+ print (f"[INIT] Force-download requested, re-downloading SDK..." )
227
+ if not _download_qnn_sdk ():
228
228
return False
229
+ else :
230
+ print (
231
+ f"[INIT] Qualcomm SDK already exists at { QNN_SDK_PATH } , skipping download."
232
+ )
229
233
230
234
os .environ ["QNN_SDK_ROOT" ] = str (QNN_SDK_PATH )
231
235
236
+ # Load QNN library
232
237
qnn_lib = QNN_SDK_PATH / "lib" / "x86_64-linux-clang" / "libQnnHtp.so"
233
238
try :
234
239
ctypes .CDLL (str (qnn_lib ), mode = ctypes .RTLD_GLOBAL )
You can’t perform that action at this time.
0 commit comments