Reverb commited on
Commit
e0aaa0f
·
1 Parent(s): 5167771

Fix nvdiffrast build: set TORCH_CUDA_ARCH_LIST=8.0;9.0 for headless compile

Browse files
Files changed (1) hide show
  1. app.py +5 -0
app.py CHANGED
@@ -114,6 +114,11 @@ def _install_nvdiffrast() -> None:
114
  else:
115
  print("nvdiffrast: nvcc not found — build will likely fail", flush=True)
116
 
 
 
 
 
 
117
  print("Building nvdiffrast from source (~2 min)...", flush=True)
118
  result = subprocess.run(
119
  [sys.executable, "-m", "pip", "install", "--no-build-isolation",
 
114
  else:
115
  print("nvdiffrast: nvcc not found — build will likely fail", flush=True)
116
 
117
+ # At startup there is no GPU allocated, so PyTorch cannot auto-detect
118
+ # compute capabilities — _get_cuda_arch_flags returns an empty list and
119
+ # crashes with IndexError. Explicitly target A100 (8.0) and H100/H200 (9.0).
120
+ env.setdefault("TORCH_CUDA_ARCH_LIST", "8.0;9.0")
121
+
122
  print("Building nvdiffrast from source (~2 min)...", flush=True)
123
  result = subprocess.run(
124
  [sys.executable, "-m", "pip", "install", "--no-build-isolation",