comfyanonymous / ComfyUI

The most powerful and modular diffusion model GUI, api and backend with a graph/nodes interface.
https://www.comfy.org/
GNU General Public License v3.0
53.58k stars 5.68k forks source link

OSError: [WinError 193] #1694

Open DezorianGuv opened 1 year ago

DezorianGuv commented 1 year ago

Good day to you,

I am using Automatic1111, but today decided to switch to ComfyUI once more, but I get the following error when starting "run_nvidia_gpu" (I do own such a card):

####################################################

C:\Users\fires\ComfyUI_windows_portable>.\python_embeded\python.exe -s ComfyUI\main.py --windows-standalone-build ** ComfyUI start up time: 2023-10-08 18:24:10.025363

Prestartup times for custom nodes: 0.0 seconds: C:\Users\fires\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Manager

Traceback (most recent call last): File "C:\Users\fires\ComfyUI_windows_portable\ComfyUI\main.py", line 69, in import comfy.utils File "C:\Users\fires\ComfyUI_windows_portable\ComfyUI\comfy\utils.py", line 1, in import torch File "C:\Users\fires\ComfyUI_windows_portable\python_embeded\Lib\site-packages\torch__init__.py", line 128, in raise err OSError: [WinError 193] %1is not a valid Win32 application. Error loading "C:\Users\fires\ComfyUI_windows_portable\python_embeded\Lib\site-packages\torch\lib\nvfuser_codegen.dll" or one of its dependencies.

C:\Users\fires\ComfyUI_windows_portable>pause

####################################################

Any idea? I installed the following, but to no avail: pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu121 pip install -r requirements.txt

I use Windows 11 64bit and a Nvidia Geforce 3060 12GB.

What can I do?

NeedsMoar commented 1 year ago

The Windows pre-packaged versions already include torch and all of comfy's own dependencies (you didn't specify which one of the comfy packages you downloaded) but it's unlikely running pip like that actually installed torch where you expected it to. It needs to be in the embedded environment. You also need to have a minimum driver version to run the various versions of cuda: >=527.41 in the case of 12.1, or just install the 11.8 version which doesn't have as many libraries you'll need to build yourself when extensions need them; the newness of torch 2.1.0 + 12.1 means some of the packages don't exist yet as prebuilts and building them ranges from easy to completely broken at the moment.

DezorianGuv commented 1 year ago

SUCCES! I installed the mentioned "Cuda 11.8" dev package.

While the "ComfyUI_windows_portable_nvidia_cu121_or_cpu" (resulting in the error described above) still didn't work, another package named "ComfyUI_windows_portable_nvidia_cu118_or_cpu" DID WORK.

Thanks for the support!

NeedsMoar commented 1 year ago

Glad it helped. Happy image-generating