Gourieff / sd-webui-reactor

Fast and Simple Face Swap Extension for StableDiffusion WebUI (A1111 SD WebUI, SD WebUI Forge, SD.Next, Cagliostro)
GNU Affero General Public License v3.0
2.56k stars 278 forks source link

EP Error, can't load onnxruntime_providers_cuda.dll #494

Closed stanleyshek closed 3 months ago

stanleyshek commented 3 months ago

First, confirm

What happened?

I've just updated stable-diffusion-webui and it updated CUDA to lastest version and Reactor have error then. I've tried get into venv uninstall onnxruntime-gpu and pip install onnxruntime-gpu --extra-index-url https://aiinfra.pkgs.visualstudio.com/PublicPackages/_packaging/onnxruntime-cuda-12/pypi/simple/. It doesn't help.

I've also tried deleting all onnxruntime folders in site-packages and let ReActor reinstall the requirements, it also doesn't work.

How this can be fixed? Screenshot 2024-07-31 194232

Steps to reproduce the problem

  1. Go to reactor and put photo
  2. Press Generate
  3. ...

Sysinfo

{ "Platform": "Windows-10-10.0.22621-SP0", "Python": "3.10.11", "Version": "v1.10.1", "Commit": "82a973c04367123ae98bd9abdf80d9eda9b910e2", "Git status": "On branch master\nYour branch is up to date with 'origin/master'.\n\nChanges not staged for commit:\n (use \"git add ...\" to update what will be committed)\n (use \"git restore ...\" to discard changes in working directory)\n\tmodified: webui-user.bat\n\nUntracked files:\n (use \"git add ...\" to include in what will be committed)\n\t4.8.0\n\tstablediffusion-env/\n\twebui-user - reinstall xformers.bat\n\t\"webui-user - \345\211\257\346\234\254 (2).bat\"\n\t\"webui-user - \345\211\257\346\234\254.bat\"\n\t\"webui-user - \345\277\253\346\215\267\346\226\271\345\274\217.lnk\"\n\twebui-user SDXL.bat\n\nno changes added to commit (use \"git add\" and/or \"git commit -a\")", "Script path": "D:\SDAI\stable-diffusion-webui", "Data path": "D:\SDAI\stable-diffusion-webui", "Extensions dir": "D:\SDAI\stable-diffusion-webui\extensions", "Checksum": "e15a84e6b9e4a486fe6cddb071555f7417ca809c78a9194e2aa528917253027a", "Commandline": [ "launch.py", "--xformers", "--autolaunch" ], "Torch env info": { "torch_version": "2.1.2+cu121", "is_debug_build": "False", "cuda_compiled_version": "12.1", "gcc_version": null, "clang_version": null, "cmake_version": null, "os": "Microsoft Windows 11 家庭中文版", "libc_version": "N/A", "python_version": "3.10.11 (tags/v3.10.11:7d4cc5a, Apr 5 2023, 00:38:17) [MSC v.1929 64 bit (AMD64)] (64-bit runtime)", "python_platform": "Windows-10-10.0.22621-SP0", "is_cuda_available": "True", "cuda_runtime_version": "12.4.99\r", "cuda_module_loading": "LAZY", "nvidia_driver_version": "551.61", "nvidia_gpu_models": "GPU 0: NVIDIA GeForce RTX 4080 Laptop GPU", "cudnn_version": null, "pip_version": "pip3", "pip_packages": [ "numpy==1.26.2", "open-clip-torch==2.20.0", "pytorch-lightning==1.9.4", "torch==2.1.2+cu121", "torchdiffeq==0.2.3", "torchmetrics==1.3.1", "torchsde==0.2.6", "torchvision==0.16.2+cu121" ],

Relevant console log

2024-07-31 20:08:08.4411651 [E:onnxruntime:Default, provider_bridge_ort.cc:1745 onnxruntime::TryGetProviderInfo_CUDA] D:\a\_work\1\s\onnxruntime\core\session\provider_bridge_ort.cc:1426 onnxruntime::ProviderLibrary::Get [ONNXRuntimeError] : 1 : FAIL : LoadLibrary failed with error 126 "" when trying to load "D:\SDAI\stable-diffusion-webui\venv\lib\site-packages\onnxruntime\capi\onnxruntime_providers_cuda.dll"

*************** EP Error ***************
EP Error D:\a\_work\1\s\onnxruntime\python\onnxruntime_pybind_state.cc:891 onnxruntime::python::CreateExecutionProviderInstance CUDA_PATH is set but CUDA wasnt able to be loaded. Please install the correct version of CUDA andcuDNN as mentioned in the GPU requirements page  (https://onnxruntime.ai/docs/execution-providers/CUDA-ExecutionProvider.html#requirements),  make sure they're in the PATH, and that your GPU is supported.
 when using ['CUDAExecutionProvider']
Falling back to ['CUDAExecutionProvider', 'CPUExecutionProvider'] and retrying.
****************************************

Additional information

No response

In-My-Way commented 3 months ago

487 <-- im having the same issue, no solution yet

BlankThrow commented 3 months ago

having same issue after updating

BlankThrow commented 3 months ago

having same issue after updating

No clue if this well help anyone, but while I was installing FaceFusion for an alternative, I ended up getting my Reactor to work again.

Here's a link to Facefusion installation guide - https://docs.facefusion.io/installation

I followed all the steps for installation under Windows. I ended up uninstalling it because I preferred how Reactor was built in. I went ahead and reinstalled Reactor within SDForge and now it works again. I'm thinking step "3. Install Your Accelerator" is what got it to work again, but I don't know enough to verify that. Just confirming that these steps helped get it working with my updated SD.

Shamister commented 3 months ago

Try this

Go to extensions/sd-webui-reactor folder

In requirements.txt add these lines onnxruntime==1.18.1 onnxruntime-gpu==1.18.1

In install.py uncomment these lines image

Now go to main folder and run webui-user.bat and it should reinstall the versions from the requirements.txt

In-My-Way commented 3 months ago

Try this

Go to extensions/sd-webui-reactor folder

In requirements.txt add these lines onnxruntime==1.18.1 onnxruntime-gpu==1.18.1

In install.py uncomment these lines image

Now go to main folder and run webui-user.bat and it should reinstall the versions from the requirements.txt

this is in fact the right solution lads, cheers

bonus note, for me the install.py had those lines already uncommented so if yours is the same, just ignore that step and it will work just fine.

Darknessssenkrad commented 3 months ago

Try this Go to extensions/sd-webui-reactor folder In requirements.txt add these lines onnxruntime==1.18.1 onnxruntime-gpu==1.18.1 In install.py uncomment these lines image Now go to main folder and run webui-user.bat and it should reinstall the versions from the requirements.txt

this is in fact the right solution lads, cheers

bonus note, for me the install.py had those lines already uncommented so if yours is the same, just ignore that step and it will work just fine.

I tried this solution and won't work in colab, almosy everthing seems to work fine just I cant select the radio option for models, which is the option I always use

thenotrealuser commented 3 months ago

Experimente isto

Vá para a pasta extensions/sd-webui-reactor

Em requirements.txt adicione estas linhas onnxruntime==1.18.1 onnxruntime-gpu==1.18.1

Em install.py descomente estas linhas imagem

Agora vá para a pasta principal e execute webui-user.bat e ele deve reinstalar as versões do requirements.txt

Awesome!

Adzido commented 2 months ago

Try this

Go to extensions/sd-webui-reactor folder

In requirements.txt add these lines onnxruntime==1.18.1 onnxruntime-gpu==1.18.1

In install.py uncomment these lines image

Now go to main folder and run webui-user.bat and it should reinstall the versions from the requirements.txt

Thats still working? I have same errors after that, did the same 2 times. I using forge ui.

thenotrealuser commented 2 months ago

Try this Go to extensions/sd-webui-reactor folder In requirements.txt add these lines onnxruntime==1.18.1 onnxruntime-gpu==1.18.1 In install.py uncomment these lines image Now go to main folder and run webui-user.bat and it should reinstall the versions from the requirements.txt

Thats still working? I have same errors after that, did the same 2 times. I using forge ui.

Yes, working.

Malfrador commented 2 months ago

Not working for me with latest webui-forge. Seems to correctly uninstall and install 1.18.1, but then fails again.

Using cached onnxruntime_gpu-1.18.1-cp310-cp310-win_amd64.whl (157.7 MB)
Installing collected packages: onnxruntime-gpu
  Attempting uninstall: onnxruntime-gpu
    Found existing installation: onnxruntime-gpu 1.19.0
    Uninstalling onnxruntime-gpu-1.19.0:
      Successfully uninstalled onnxruntime-gpu-1.19.0
Successfully installed onnxruntime-gpu-1.18.1

Restarting the UI a second times reverts it back to 1.19.0. Manually deleting onnxruntime from /venv/ does not solve the issue either. Two of the built-in forge extensions also install onnxruntime, however removing them also did not help.

Arnaud3013 commented 1 month ago

i had to change in install.py too

if not is_installed(ort,"1.18.1",True):
                install_count += 1
                ort = "onnxruntime-gpu==1.18.1"