Weijie Lyu Claude Opus 4.8 (1M context) commited on
Commit
06957f5
·
1 Parent(s): b330272

Install cu130 CUDA runtime libs (drop --no-deps) to fix spurious OOM

Browse files

The cu130 torch was force-installed with --no-deps, so its matching
nvidia-*-cu13 runtime libraries were never installed -- the container
kept the base image's nvidia-*-cu12 (12.8) libs. Running cu130 torch
on cu12 CUDA libraries is a broken mix: convs limp along via cuDNN
but allocations fail, surfacing as the cudaMalloc OOM that PyTorch's
NVML-based reporter then asserts on. Reinstall the cu130 stack WITH
deps (extra-index-url PyPI for the non-NVIDIA deps) so torch gets the
CUDA 13 runtime it was built against.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

Files changed (1) hide show
  1. app.py +7 -2
app.py CHANGED
@@ -56,10 +56,15 @@ def _ensure_cu130_torch():
56
  print("[CU130-CHECK] cu130 torch already present, skipping reinstall")
57
  return
58
  print("[CU130-CHECK] reinstalling torch/torchvision/xformers from the cu130 index...")
 
 
 
 
 
59
  _sp.check_call([
60
- _sys.executable, "-m", "pip", "install",
61
- "--no-cache-dir", "--force-reinstall", "--no-deps",
62
  "--index-url", "https://download.pytorch.org/whl/cu130",
 
63
  "torch==2.11.0+cu130", "torchvision==0.26.0+cu130", "xformers==0.0.35",
64
  ])
65
  print("[CU130-CHECK] cu130 stack installed")
 
56
  print("[CU130-CHECK] cu130 torch already present, skipping reinstall")
57
  return
58
  print("[CU130-CHECK] reinstalling torch/torchvision/xformers from the cu130 index...")
59
+ # NOT --no-deps: torch 2.11.0+cu130 must pull its matching nvidia-*-cu13 CUDA
60
+ # runtime libs. With --no-deps the container kept the base image's nvidia-*-cu12
61
+ # (12.8) libs, so cu130 torch ran on cu12 runtime -- a broken mix that made
62
+ # allocations fail (surfacing as the NVML/OOM assert). --extra-index-url lets
63
+ # torch's non-NVIDIA deps still resolve from PyPI.
64
  _sp.check_call([
65
+ _sys.executable, "-m", "pip", "install", "--no-cache-dir",
 
66
  "--index-url", "https://download.pytorch.org/whl/cu130",
67
+ "--extra-index-url", "https://pypi.org/simple",
68
  "torch==2.11.0+cu130", "torchvision==0.26.0+cu130", "xformers==0.0.35",
69
  ])
70
  print("[CU130-CHECK] cu130 stack installed")