Stefano Demartis Claude Opus 4.6 commited on
Commit ·
e382bab
1
Parent(s): 0c80e93
fix: include full build stderr and CUDA diagnostics in error
Browse filesCo-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
app.py
CHANGED
|
@@ -245,8 +245,12 @@ def ensure_correlation_extension_installed():
|
|
| 245 |
import torch
|
| 246 |
cuda_home = os.environ.get("CUDA_HOME", "")
|
| 247 |
nvcc_ok = shutil.which("nvcc") is not None
|
| 248 |
-
|
| 249 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 250 |
|
| 251 |
# Ensure CUDA_HOME is set so setuptools can find nvcc
|
| 252 |
if not cuda_home:
|
|
@@ -282,11 +286,11 @@ def ensure_correlation_extension_installed():
|
|
| 282 |
env={**os.environ},
|
| 283 |
)
|
| 284 |
if result2.returncode != 0:
|
| 285 |
-
print(f"[ERROR] PyPI install also failed: {result2.stderr[-500:]}")
|
| 286 |
raise RuntimeError(
|
| 287 |
f"Cannot install spatial-correlation-sampler.\n"
|
| 288 |
-
f"
|
| 289 |
-
f"
|
|
|
|
| 290 |
)
|
| 291 |
|
| 292 |
importlib.invalidate_caches()
|
|
|
|
| 245 |
import torch
|
| 246 |
cuda_home = os.environ.get("CUDA_HOME", "")
|
| 247 |
nvcc_ok = shutil.which("nvcc") is not None
|
| 248 |
+
diag = (f"torch={torch.__version__}, cuda={torch.version.cuda}, "
|
| 249 |
+
f"torch.cuda.avail={torch.cuda.is_available()}, "
|
| 250 |
+
f"CUDA_HOME={cuda_home!r}, nvcc={nvcc_ok}")
|
| 251 |
+
print(f"[DEBUG] {diag}")
|
| 252 |
+
# Store diagnostics for error reporting
|
| 253 |
+
_diag_info = diag
|
| 254 |
|
| 255 |
# Ensure CUDA_HOME is set so setuptools can find nvcc
|
| 256 |
if not cuda_home:
|
|
|
|
| 286 |
env={**os.environ},
|
| 287 |
)
|
| 288 |
if result2.returncode != 0:
|
|
|
|
| 289 |
raise RuntimeError(
|
| 290 |
f"Cannot install spatial-correlation-sampler.\n"
|
| 291 |
+
f"Diag: {_diag_info}\n"
|
| 292 |
+
f"Git stderr:\n{result.stderr[-2000:]}\n"
|
| 293 |
+
f"PyPI stderr:\n{result2.stderr[-2000:]}"
|
| 294 |
)
|
| 295 |
|
| 296 |
importlib.invalidate_caches()
|