Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 21 additions & 5 deletions backends/qualcomm/__init__.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,29 @@
import os

from .scripts.download_qnn_sdk import install_qnn_sdk, is_linux_x86
from .scripts.download_qnn_sdk import install_qnn_sdk, is_linux_x86, QNN_ZIP_URL


env_flag = os.getenv("EXECUTORCH_BUILDING_WHEEL", "0").lower()
# If users have preinstalled QNN_SDK_ROOT, we will use it.
qnn_sdk_root_flag = os.getenv("QNN_SDK_ROOT", None)

if env_flag not in ("1", "true", "yes") and not qnn_sdk_root_flag and is_linux_x86():
ok = install_qnn_sdk()
if not ok:
raise RuntimeError("Failed to install QNN SDK. Please check the logs above.")
if env_flag not in ("1", "true", "yes"):
if qnn_sdk_root_flag:
print(
f"[QNN] Using QNN SDK at {qnn_sdk_root_flag} (from QNN_SDK_ROOT)",
flush=True,
)
elif is_linux_x86():
ok = install_qnn_sdk()
if not ok:
raise RuntimeError(
"Failed to set up QNN SDK.\n\n"
"To resolve, try one of:\n"
Comment thread
abhinaykukkadapu marked this conversation as resolved.
" 1. Download the SDK manually from:\n"
f" {QNN_ZIP_URL}\n"
" Or go to step 2 if QNN SDK already exists.\n"
" 2. Set QNN_SDK_ROOT to an existing SDK installation:\n"
" export QNN_SDK_ROOT=/path/to/qualcomm/sdk\n"
" export LD_LIBRARY_PATH="
"$QNN_SDK_ROOT/lib/x86_64-linux-clang/:$LD_LIBRARY_PATH"
)
Loading
Loading