Skip to content

Commit 6a85607

Browse files
committed
debug
1 parent ae6c9ab commit 6a85607

File tree

1 file changed

+17
-12
lines changed

1 file changed

+17
-12
lines changed

backends/qualcomm/scripts/download_qnn_sdk.py

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -283,26 +283,32 @@ def _current_glibc_version() -> str:
283283
return f"error:{e}"
284284

285285

286-
def _ensure_glibc_minimum():
287-
current = _current_glibc_version()
288-
logger.info("[glibc] Current loaded glibc: %s", current)
286+
def _log_current_loader():
287+
"""Dump the loader and libc mappings from /proc/self/maps for debugging."""
288+
try:
289+
with open("/proc/self/maps") as f:
290+
for line in f:
291+
if "ld-" in line or "libc.so" in line:
292+
logger.info("[glibc] Loader map: %s", line.strip())
293+
except Exception as e:
294+
logger.warning("[glibc] Failed to read /proc/self/maps: %s", e)
289295

290-
if current != "unknown" and current >= GLIBC_VERSION:
291-
logger.info("[glibc] Current glibc is sufficient, no re-exec needed.")
292-
return
296+
297+
def _ensure_glibc_minimum(min_version: str = GLIBC_VERSION):
298+
current = _current_glibc_version()
299+
logger.info("[glibc] Current loaded glibc (via ctypes): %s", current)
293300

294301
if os.environ.get(GLIBC_REEXEC_GUARD) == "1":
295-
logger.error(
296-
"[glibc] Re-exec attempted but glibc is still too low (%s).", current
297-
)
302+
logger.info("[glibc] Already re-exec'd once; continuing under current loader.")
303+
_log_current_loader() # ✅ confirm loader after re-exec
298304
return
299305

300306
if not GLIBC_LOADER.exists():
301307
logger.error("[glibc] Loader not found at %s", GLIBC_LOADER)
302308
return
303309

304310
logger.info(
305-
"[glibc] Re-executing process with loader %s and library path %s",
311+
"[glibc] Forcing re-exec under loader %s with libdir %s",
306312
GLIBC_LOADER,
307313
GLIBC_LIBDIR,
308314
)
@@ -517,8 +523,7 @@ def install_qnn_sdk() -> bool:
517523
"""
518524
logger.info("[QNN] Starting SDK installation")
519525

520-
# Check and re-exec with custom glibc if needed
521-
_ensure_glibc_minimum()
526+
_ensure_glibc_minimum("2.29")
522527

523528
if not _check_tmp_glibc():
524529
logger.error("[glibc] Pre-installed glibc check failed. Exiting early.")

0 commit comments

Comments
 (0)