Fix TensorRT/ESRGAN fallback: split requirements for RunPod cu128

- requirements.txt: Remove torch-tensorrt (wrong CUDA build breaks RunPod)
- requirements-runpod.txt: New file with --extra-index-url cu128 for
  torch-tensorrt and torchaudio pinned to correct CUDA toolkit
- goofer_video_concat.py: Loud warnings when TensorRT unavailable so
  silent fallback to Real-ESRGAN is obvious in logs

Prevents the libcudart.so.13 error from recurring on CUDA 12.8 pods.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Jeffrey A. Brick
2026-03-21 20:51:29 -07:00
co-authored by Claude Opus 4.6
parent 820989a850
commit 7d9db09faf
3 changed files with 38 additions and 4 deletions
+14 -3
View File
@@ -387,10 +387,21 @@ def _upscale(images, target_resolution=1080, quality="ULTRA"):
n_frames, result.shape[2], result.shape[1])
return result
except ImportError:
logger.info("torch-tensorrt not installed. Trying standard Real-ESRGAN...")
except ImportError as ie:
logger.warning(
"torch-tensorrt NOT INSTALLED — falling back to standard Real-ESRGAN. "
"To fix: pip install -r requirements-runpod.txt (import error: %s)", ie
)
print(
"[VideoConcat] WARNING: torch-tensorrt not found! Using slow Real-ESRGAN fallback.\n"
"[VideoConcat] Fix: pip install -r requirements-runpod.txt"
)
except Exception as e:
logger.warning("TensorRT path failed: %s. Trying standard Real-ESRGAN...", e)
logger.warning(
"TensorRT path FAILED: %s — falling back to standard Real-ESRGAN. "
"Check CUDA version matches torch-tensorrt build (nvcc --version).", e
)
print(f"[VideoConcat] WARNING: TensorRT failed: {e}. Using Real-ESRGAN fallback.")
# --- Strategy 3: Real-ESRGAN via PyTorch CUDA (no TensorRT) ---
try:
+20
View File
@@ -0,0 +1,20 @@
# ComfyUI-Goofer — RunPod / Linux NVIDIA TensorRT requirements
# Install AFTER base requirements.txt:
# pip install -r requirements.txt
# pip install -r requirements-runpod.txt
#
# CRITICAL: The --extra-index-url MUST match your CUDA toolkit.
# RunPod default (March 2026): CUDA 12.8 → cu128
# Check yours: nvcc --version
#
# If you see "libcudart.so.13: cannot open shared object file"
# you installed the wrong CUDA build. Uninstall and reinstall
# with the correct index URL below.
--extra-index-url https://download.pytorch.org/whl/cu128
# NVIDIA TensorRT — compiled for tensor cores (Blackwell, Ada, Hopper)
torch-tensorrt>=2.2.0
# Ensure torchaudio matches PyTorch CUDA build
torchaudio>=2.0.0
+4 -1
View File
@@ -11,7 +11,10 @@ opencv-python>=4.8.0 # Optional: denoise/frame prep (graceful fallback)
# Upscaling — NVIDIA hardware chain
realesrgan>=0.3.0 # Real-ESRGAN upscaler (auto-downloads ~64 MB model)
basicsr>=1.4.2 # Required by Real-ESRGAN
torch-tensorrt>=2.2.0 # NVIDIA TensorRT acceleration (Linux/RunPod — uses tensor cores)
# NOTE: torch-tensorrt moved to requirements-runpod.txt
# It MUST match your CUDA toolkit version (cu128/cu130).
# Installing the wrong build causes libcudart.so errors.
# On RunPod/Linux: pip install -r requirements-runpod.txt
# Prompt generation (Qwen2.5 mode) — models auto-download on first use
transformers>=4.37.0 # Qwen2.5-Instruct + MusicGen