Open ZenRevision opened 1 month ago
For CUDA 12.x version, you need to use this:
python_embeded\python.exe -m pip install onnxruntime-gpu --extra-index-url https://aiinfra.pkgs.visualstudio.com/PublicPackages/_packaging/onnxruntime-cuda-12/pypi/simple/
I got it from their site: https://onnxruntime.ai/docs/install/#install-onnx-runtime-gpu-cuda-12x
It worked to me, I have a RTX 3070Ti
And there is no need to downgrade pytorch, you can go back to 2.4.1+cu124
For CUDA 12.x version, you need to use this:
python_embeded\python.exe -m pip install onnxruntime-gpu --extra-index-url https://aiinfra.pkgs.visualstudio.com/PublicPackages/_packaging/onnxruntime-cuda-12/pypi/simple/
I got it from their site: https://onnxruntime.ai/docs/install/#install-onnx-runtime-gpu-cuda-12x
It worked to me, I have a RTX 3070Ti
And there is no need to downgrade pytorch, you can go back to 2.4.1+cu124
Thanks! Seems that's a better solution then.
Unfortunately though, I'm definitely not the only one to find the fix I supplied. I copied it from some of the top search results. Because these fixes go back nearly a year, and have been linked many times, they are highly ranked by search engines. While not the best solution, what I posted basically also does work too, so when people find that fix, and it works, they probably are going to take it, even though there is a better fix.
As I said before, this is kind of over my head, is this something ComfyUI can incorporate in the default portable setup? Because if so, doesn't it seem like that would be best?
For CUDA 12.x version, you need to use this:
python_embeded\python.exe -m pip install onnxruntime-gpu --extra-index-url https://aiinfra.pkgs.visualstudio.com/PublicPackages/_packaging/onnxruntime-cuda-12/pypi/simple/
I got it from their site: https://onnxruntime.ai/docs/install/#install-onnx-runtime-gpu-cuda-12x It worked to me, I have a RTX 3070Ti And there is no need to downgrade pytorch, you can go back to 2.4.1+cu124
Thanks! Seems that's a better solution then.
Unfortunately though, I'm definitely not the only one to find the fix I supplied. I copied it from some of the top search results. Because these fixes go back nearly a year, and have been linked many times, they are highly ranked by search engines. While not the best solution, what I posted basically also does work too, so when people find that fix, and it works, they probably are going to take it, even though there is a better fix.
As I said before, this is kind of over my head, is this something ComfyUI can incorporate in the default portable setup? Because if so, doesn't it seem like that would be best?
ComfyUI does not depend on onnxruntime, so it cannot handle this issue. This issue needs to be resolved in the custom node that deals with this dependency.
Expected Behavior
Actual Behavior
Receive this very common error:
UserWarning:Onnxruntime not found or doesn't come with acceleration providers, switch to OpenCV with CPU device. DWPose might run very slowly
This has been happening for nearly a year now. I have had to deal with this issue every time I have setup ComfyUI_Portable. And many other users (maybe everyone on Windows) of ComfyUI_Portable have also faced this same issue. I'm kind of stunned that this still hasn't been fixed.
Steps to Reproduce
Apparently this is caused by version incompatibilities between torchvision/torchaudio and cuda. Now more recently there is an additional version incompatibility between onnxruntime and the version of torchvision/torchaudio that actually works. So both torchvision/torchaudio and onnxruntime must be downgraded to specific previous versions which so they can both play nice together, and not be mean to cuda either.
That is all pretty much way over my head though, so I really don't understand any of it. I have included the working fix below though, in simple terms, for the devs... as well as anyone else who runs into this issue and doesn't understand the technicalities behind it.
Debug Logs
Other
How to fix:
root of comfyui, open terminal, and input each line followed by the enter key, waiting for each command to finish executing before entering the next line.
It will take a while to install (and if you're in China, it will probably fail repeatedly, but if you keep trying it may eventually install the working versions of the torch components).
Then:
After that, when you start ComfyUI_Portable with nVidia GPU acceleration on Windows this warning:
UserWarning:Onnxruntime not found or doesn't come with acceleration providers, switch to OpenCV with CPU device. DWPose might run very slowly
Should be replaced with this message:DWPose: Onnxruntime with acceleration providers detected
The fact that this issue has been around for nearly a year at least (and has actually even gotten slightly worse now -- last time, I'm pretty sure I only needed the first part of the above fix), is kind of discouraging. This is a massive stumbling block for anyone who's not somewhat technically capable (and a major inconvenience even for people who are capable of tracking down the fix). I have tripped over this issue every single time.
I love ComfyUI, and have tremendous gratitude for everyone who has helped make ComfyUI possible. I just think this really should be fixed, or at least provide a script that can check for these critical version incompatibilities and resolve them in a more automated manner.