DLL load failed while importing flashattn_hopper_cuda
Error message occurred while importing the 'ComfyUI-WanVideoWrapper' module.
Traceback (most recent call last):
File "C:\Users\Administrator\Desktop\ComfyUI-aki-v1.4\nodes.py", line 2147, in load_custom_node
module_spec.loader.exec_module(module)
File "
Your flash_attn module cannot find the DLL dependencies for its pyd module. I wrote about that at https://github.com/3dluvr/windows-flux-lora-training-notes#flash-attention-with-cuda although I did not add a final solution yet. Right now I'm hardcoding a path to suit my (embedded python) environment.
Edit your flash_attn_interface.py, and before line 7 add:
import os
os.add_dll_directory(r'C:\Users\Administrator\Desktop\ComfyUI-aki-v1.4\python\lib\site-packages\torch\lib')
Presuming your torch module is installed in the above location and you have CUDA toolkit installed and environment vars set.
Hope this helps.
您的 flash_attn 模块找不到其 pyd 模块的 DLL 依赖项。我在https://github.com/3dluvr/windows-flux-lora-training-notes#flash-attention-with-cuda上写了相关内容,尽管我尚未添加最终解决方案。现在,我正在硬编码一条路径以适合我的(嵌入式 Python)环境。
编辑您的
flash_attn_interface.py,并在第 7 行之前添加:import os os.add_dll_directory(r'C:\Users\Administrator\Desktop\ComfyUI-aki-v1.4\python\lib\site-packages\torch\lib')假设您的 torch 模块安装在上述位置,并且您已安装 CUDA 工具包并设置了环境变量。
希望这有帮助。
感谢您的flash_attn window wheel,但我目前还处于这个报错,非常感谢你!
You could try installing dll-diagnostics module and run it against the flash_attn...pyd file in your \lib\site-packages\ folder.
It will show you whether it's finding the dependent DLLs or not and which ones are missing.
In example for me, when I run python_embedded\dlldiag deps python_embedded\Lib\site-packages\flash_attn_2_cuda.cp312-win_amd64.pyd with an unpatched flash_attn_interface.py I get the following:
api-ms-win-crt-heap-l1-1-0.dll Loaded successfully
api-ms-win-crt-math-l1-1-0.dll Loaded successfully
api-ms-win-crt-runtime-l1-1-0.dll Loaded successfully
api-ms-win-crt-stdio-l1-1-0.dll Loaded successfully
api-ms-win-crt-string-l1-1-0.dll Loaded successfully
c10.dll Error 126: The specified module could not be found.
c10_cuda.dll Error 126: The specified module could not be found.
cudart64_12.dll Loaded successfully
KERNEL32.dll Loaded successfully
MSVCP140.dll Loaded successfully
python312.dll Loaded successfully
torch_cpu.dll Error 126: The specified module could not be found.
torch_cuda.dll Error 126: The specified module could not be found.
torch_python.dll Error 126: The specified module could not be found.
VCRUNTIME140.dll Loaded successfully
VCRUNTIME140_1.dll Loaded successfully
The missing files are in the python_embedded\Lib\site-packages\torch\lib folder so that's why we need to tell flash_attn_interface where to find them. You could try adding full path to python_embedded\Lib\site-packages\torch\lib to your PATH environment and see if that maybe fixes it but as far as I'm aware, modules now want that os.add_dll_directory instead of env PATH.