ComfyUI-WanVideoWrapper icon indicating copy to clipboard operation
ComfyUI-WanVideoWrapper copied to clipboard

Set TORCHDYNAMO_VERBOSE=1 for the internal stack trace (please do this especially if you're reporting a bug to PyTorch). For even more developer context, set TORCH_LOGS="+dynamo"

Open biu5332 opened this issue 1 year ago • 5 comments

Image

biu5332 avatar Sep 04 '25 01:09 biu5332

I also encountered the same problem.

Paddypan993 avatar Sep 04 '25 01:09 Paddypan993

Perhaps no triton?

If on Windows, some premade wheels here https://github.com/woct0rdho/triton-windows/releases/tag/v3.2.0-windows.post10 (make sure to match cpXX to your Python version)

pip install triton-windows might also work, but not sure, I always used premade wheels since those are easy to install

And if you have not installed Triton, you probably want to install sage attention as well (after triton) https://github.com/woct0rdho/SageAttention/releases (find a wheel that matches your Cuda, PyTorch and Python version)

Read this guide first though, since I'm on stand-alone ComfyUI, and if you are on portable its a little different, need to put full python_embeded\python.exe path in pip install command line etc. See here : https://www.patreon.com/posts/easy-guide-sage-124253103


and if the above is a bit too complicated, you can try to set attention to SDPA instead of Sage Attention, in WanVideo Model Loader

RuneGjerde avatar Sep 04 '25 04:09 RuneGjerde

  1. 直接修改 Triton 源代码

这是最直接有效的解决方案。我们需要修改 Triton 的源代码,使其在 Windows 上不调用 ldconfig 命令。

  1. 找到并备份 Triton 驱动文件:

python\Lib\site-packages\triton\backends\nvidia\driver.py


2. **修改 `libcuda_dirs` 函数**(大约在第 27 行):
```python
def libcuda_dirs():
    import os
    # 在 Windows 上返回空列表或默认路径
    if os.name == 'nt':  # Windows
        # 返回 CUDA 安装的默认路径
        cuda_path = os.environ.get('CUDA_PATH', 'C:\\\\Program Files\\\\NVIDIA GPU Computing Toolkit\\\\CUDA\\\\v12.1')
        lib_path = os.path.join(cuda_path, 'lib', 'x64')
        if os.path.exists(lib_path):
            return [lib_path]
        else:
            return []
    else:
        # 原有的 Linux 代码
        try:
            libs = subprocess.check_output(["/sbin/ldconfig", "-p"]).decode()
        except FileNotFoundError:
            return []
        # 其余原有代码...
        pattern = re.compile(r".* => (.*)")
        paths = set()
        for line in libs.splitlines():
            if line.startswith("libcuda.so"):
                match = pattern.search(line)
                if match:
                    paths.add(os.path.dirname(match.group(1)))
        return list(paths)

L-YuH avatar Sep 08 '25 17:09 L-YuH

I had also the Triton issue; my system/setup:

Platform: Windows Python version: 3.13.9 Python executable: D:\ComfyUI_windows_portable\python_embeded\python.exe Total VRAM 16303 MB, total RAM 32557 MB pytorch version: 2.9.1+cu130 Set vram state to: NORMAL_VRAM Device: cuda:0 NVIDIA GeForce RTX 5080 : cudaMallocAsync

I got my solution via the bat with the following settings:

`@echo off setlocal

:: Set working directory to script location cd /d "%~dp0"

:: Disable PyTorch Inductor (critical for RTX 5080 / CC 12.0) set TORCHINDUCTOR_DISABLE=1

:: Optional: Also disable Dynamo if needed (redundant but safe) set TORCHDYNAMO_DISABLE=1

:: Launch ComfyUI with embedded Python call python_embeded\python.exe -s ComfyUI\main.py --windows-standalone-build --disable-pinned-memory

pause`

maybe888 avatar Jan 15 '26 19:01 maybe888

Ben de aynı sorunla karşılaştım.

First, install this into the python embedded folder: python.exe -m pip install torch==2.7.0+cu128. Then, install this: python.exe -m pip install triton-windows==3.3.1.post21. There's a version mismatch; install the ones I mentioned, and the problem should be solved.