patientx / ComfyUI-Zluda

The most powerful and modular stable diffusion GUI, api and backend with a graph/nodes interface. Now ZLUDA enhanced for better AMD GPU performance.
GNU General Public License v3.0
126 stars 9 forks source link

Error loading cublas64_11.dll #25

Open skullmonkey666 opened 1 week ago

skullmonkey666 commented 1 week ago

Your question

First of all, I'm a complete noob with AI as much as github requests, so please forgive any mistake I could make. I'm having an issue installing ComfyUI as I get an error : OSError: [WinError 1114] Une routine d’initialisation d’une bibliothèque de liens dynamiques (DLL) a échoué. Error loading "G:\AI\ComfyUI-Zluda\venv\lib\site-packages\torch\lib\cublas64_11.dll" or one of its dependencies.

Latest AMD Drivers are installed, I'm running Python 3.10.11 and I think paths have been set correctly. Capture_2 I've downloaded and installed ROCm libraries for my GPU from here : https://github.com/DrENDzZ/ROCmLibs-Fallback (gfx803) My GPU is an AMD Radeon RX480, my OS is windows10 and my computer is a Macpro 5,1 but I don't know if that part is relevant. Any help would be gretly appreciated.

Regards

Logs

-------------------------------------------------------------
******************* COMFYUI-ZLUDA INSTALL *******************
-------------------------------------------------------------

 ::  19:11:02  ::  - Setting up the virtual enviroment
 ::  19:11:22  ::  - Virtual enviroment activation
 ::  19:11:22  ::  - Updating the pip package

 ::  19:11:36  ::  Beginning installation ...

 ::  19:11:36  ::  - Installing required packages
 ::  19:15:50  ::  - Installing torch for AMD GPUs (First file is 2.7 GB, please be patient)
 ::  19:20:13  ::  - Installing onnxruntime (required by some nodes)
 ::  19:20:28  ::  - (temporary numpy fix)

 ::  19:20:50  ::  Custom node(s) installation ...

 ::  19:20:50  ::  - Installing Comfyui Manager
fatal: destination path 'ComfyUI-Manager' already exists and is not an empty directory.
 ::  19:20:50  ::  - Installing ComfyUI-deepcache
fatal: destination path 'ComfyUI-deepcache' already exists and is not an empty directory.
 ::  19:20:50  ::  - Installing ComfyUI-Impact-Pack
fatal: destination path 'ComfyUI-Impact-Pack' already exists and is not an empty directory.
fatal: destination path 'impact_subpack' already exists and is not an empty directory.

 ::  19:20:50  ::  - Patching ZLUDA (Zluda 3.8.4 for HIP SDK 5.7)
 ::  19:20:52  ::  - ZLUDA is patched.

.....................................................
*** Installation is completed in 00:09:50,47 .
*** You can use "comfyui.bat" to start the app later.
.....................................................

*** Starting the Comfyui-ZLUDA for the first time, please be patient...

[START] Security scan
[DONE] Security scan
## ComfyUI-Manager: installing dependencies. (GitPython)
## ComfyUI-Manager: installing dependencies done.
** ComfyUI startup time: 2024-09-18 19:21:29.674693
** Platform: Windows
** Python version: 3.10.11 (tags/v3.10.11:7d4cc5a, Apr  5 2023, 00:38:17) [MSC v.1929 64 bit (AMD64)]
** Python executable: G:\AI\ComfyUI-Zluda\venv\Scripts\python.exe
** ComfyUI Path: G:\AI\ComfyUI-Zluda
** Log path: G:\AI\ComfyUI-Zluda\comfyui.log

Prestartup times for custom nodes:
  35.2 seconds: G:\AI\ComfyUI-Zluda\custom_nodes\ComfyUI-Manager

Traceback (most recent call last):
  File "G:\AI\ComfyUI-Zluda\main.py", line 88, in <module>
    import comfy.utils
  File "G:\AI\ComfyUI-Zluda\comfy\utils.py", line 20, in <module>
    import torch
  File "G:\AI\ComfyUI-Zluda\venv\lib\site-packages\torch\__init__.py", line 141, in <module>
    raise err
OSError: [WinError 1114] Une routine d’initialisation d’une bibliothèque de liens dynamiques (DLL) a échoué. Error loading "G:\AI\ComfyUI-Zluda\venv\lib\site-packages\torch\lib\cublas64_11.dll" or one of its dependencies.

G:\AI\ComfyUI-Zluda>

Other

No response

patientx commented 1 week ago

try running "patchzluda.bat"

and if it still gives error for the last option try running :

"fixforrx580.bat"

which installs a previous torch because latest versions have a problem with rx480-580.

skullmonkey666 commented 1 week ago

Thank you for the answer. I did run patchzluda.bat many times as well as fixfor580.bat. fixfor580.bat just open a new console window and stops. Capture3 So I entered the commands manualy, but without any luck. I'm out of ideas....

ItsNifer commented 1 week ago

U need to manually patch zluda yourself. the patchzluda batch script runs into errors and instantly closes. My guess is curl fails to download the zluda files. Anyways... go to this link and it'll download zluda https://github.com/lshqqytiger/ZLUDA/releases/download/rel.11cc5844514f93161e0e74387f04e2c537705a82/ZLUDA-windows-amd64.zip

then take the cublas.dll, cusparse.dll, and nvrtc.dll from the zluda files and rename them into cublas64_11.dll, cusparse64_11.dll, and nvrtc64_112_0.dll Now take these renamed zluda files (three), and replace them inside of your comfyui-zluda\venv\Lib\site-packages\torch\lib

skullmonkey666 commented 1 week ago

Hi ItsNifer, I just did as you suggested without any luck. Still the same error

Microsoft Windows [version 10.0.19045.4894] (c) Microsoft Corporation. Tous droits réservés.

G:\AI\ComfyUI-Zluda>comfyui.bat *** Checking and updating to new version if possible remote: Enumerating objects: 48, done. remote: Counting objects: 100% (48/48), done. remote: Compressing objects: 100% (38/38), done. remote: Total 48 (delta 18), reused 32 (delta 9), pack-reused 0 (from 0) Unpacking objects: 100% (48/48), 57.15 KiB | 352.00 KiB/s, done. From https://github.com/patientx/ComfyUI-Zluda bb3fc16..4eb0983 master -> origin/master Updating bb3fc16..4eb0983 Fast-forward api_server/routes/internal/internal_routes.py | 9 ++++- app/user_manager.py | 23 +++++++++++ comfy/controlnet.py | 56 +++++++++++++++------------ comfy/k_diffusion/sampling.py | 11 ++++++ comfy/lora.py | 2 +- comfy/model_management.py | 2 +- comfy/sd.py | 2 +- comfy_extras/nodes_custom_sampler.py | 22 +++++++++++ extra_model_paths.yaml.example | 2 + folder_paths.py | 7 +++- tests-unit/utils/extra_config_test.py | 4 +- utils/extra_config.py | 5 ++- 12 files changed, 111 insertions(+), 34 deletions(-)

[START] Security scan [DONE] Security scan

ComfyUI-Manager: installing dependencies done.

ComfyUI startup time: 2024-09-20 15:41:16.752111 Platform: Windows Python version: 3.10.11 (tags/v3.10.11:7d4cc5a, Apr 5 2023, 00:38:17) [MSC v.1929 64 bit (AMD64)] Python executable: G:\AI\ComfyUI-Zluda\venv\Scripts\python.exe ComfyUI Path: G:\AI\ComfyUI-Zluda Log path: G:\AI\ComfyUI-Zluda\comfyui.log

Prestartup times for custom nodes: 7.2 seconds: G:\AI\ComfyUI-Zluda\custom_nodes\ComfyUI-Manager

Traceback (most recent call last): File "G:\AI\ComfyUI-Zluda\main.py", line 88, in import comfy.utils File "G:\AI\ComfyUI-Zluda\comfy\utils.py", line 20, in import torch File "G:\AI\ComfyUI-Zluda\venv\lib\site-packages\torch__init__.py", line 141, in raise err OSError: [WinError 1114] Une routine d’initialisation d’une bibliothèque de liens dynamiques (DLL) a échoué. Error loading "G:\AI\ComfyUI-Zluda\venv\lib\site-packages\torch\lib\cublas64_11.dll" or one of its dependencies.

G:\AI\ComfyUI-Zluda>

skullmonkey666 commented 1 week ago

I just checked and it appears that my CPUs are of Westmere architecture. Could it be the issue ? According to the requirement it should be Haswell https://rocm.docs.amd.com/projects/install-on-windows/en/latest/reference/system-requirements.html#supported-gpus-win Am I right ?