Skip to content

feat: TEM-54 check CUDA-sensitive local packages - #32

Open
Chmokachka wants to merge 1 commit into
mainfrom
feat/TEM-54-venv-130-prep
Open

feat: TEM-54 check CUDA-sensitive local packages#32
Chmokachka wants to merge 1 commit into
mainfrom
feat/TEM-54-venv-130-prep

Conversation

@Chmokachka

@Chmokachka Chmokachka commented Aug 20, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds a non-invasive startup diagnostic for CUDA-sensitive packages installed in the persistent ComfyUI venv.

CUDA 13 currently reuses .venv-cu128. That is safe when the venv only inherits the image packages through --system-site-packages, but locally installed CUDA packages can take precedence over the image's baked torch+cu130 stack and prevent ComfyUI from starting.

The new diagnostic runs after venv activation and before ComfyUI starts. It logs:

  • Active venv path
  • Expected PyTorch CUDA build from /opt/comfyui-runtime-constraints.txt
  • Python executable
  • PyTorch version, CUDA build, and import location
  • Whether PyTorch was loaded from the persistent venv
  • CUDA availability and device count
  • Locally installed CUDA-sensitive packages:
    torch, torchvision, torchaudio, xformers, triton, onnxruntime, and sageattention

It does not modify, delete, migrate, or recreate user venvs. When PyTorch cannot be imported, originates from the persistent venv, or has a CUDA build that differs from the image expectation, the startup logs a warning with the relevant evidence.

Validation

Tested on CUDA 13 pods with a persistent volume:

  1. Clean venv - .venv-cu128 contained only pip; the diagnostic confirmed baked torch+cu130 from /usr/local/..., CUDA was available, and ComfyUI started successfully.
  2. Conflicting local PyTorch - installed torch==2.10.0+cu128 into .venv-cu128; the diagnostic identified the local package and failed torch import before ComfyUI crashed with the expected CUDA-library traceback.
  3. Local Triton only - installed triton==3.7.1 into .venv-cu128; it was listed as CUDA-sensitive, while baked torch+cu130 remained active and ComfyUI started successfully.

This confirms that a local CUDA-sensitive package is not automatically a conflict; the relevant signal is the active PyTorch stack and its actual import path.

CI checks

Dev build - https://github.com/runpod-workers/comfyui-base/actions/runs/32363217503
Check incompatibilities - https://github.com/runpod-workers/comfyui-base/actions/runs/32382313870
https://github.com/runpod-workers/comfyui-base/actions/runs/32382357658

@Chmokachka
Chmokachka marked this pull request as ready for review August 20, 2026 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants