lshqqytiger / stable-diffusion-webui-amdgpu-forge

Forge for stable-diffusion-webui-amdgpu (formerly stable-diffusion-webui-directml)
GNU Affero General Public License v3.0
39 stars 3 forks source link

12.09.2024 SD-FORGE-AMD. ModuleNotFoundError: No module named 'gguf'. or RuntimeError: Found no NVIDIA driver on your system. #31

Closed Harbitos closed 4 days ago

Harbitos commented 5 days ago

I have a different situation, windows10, amd RX580 graphics card, Intel Xeon processor, the latest version of Git and Python 3.10.6. The initial installation of stable-diffusion-webui-amdgpu-forge by lshqqytiger returns an error:

venv "C:\Users\user\Desktop\Stable Diffusion Forge AMD\stable-diffusion-webui-amdgpu-forge\venv\Scripts\Python.exe"
ROCm Toolkit 6.1 was found.
fatal: No names found, cannot describe anything.
Python 3.10.6 (tags/v3.10.6:9c7b4bd, Aug  1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)]
Version: f2.0.1v1.10.1-1.10.1
Commit hash: 412c2d800dcae4cee8a7466a1e9128cfbbc5bf26
Failed to load ZLUDA: Could not find module 'C:\Program Files\AMD\ROCm\6.1\bin\rocblas.dll' (or one of its dependencies). Try using the full path with constructor syntax.
Using CPU-only torch
Traceback (most recent call last):
  File "C:\Users\user\Desktop\Stable Diffusion Forge AMD\stable-diffusion-webui-amdgpu-forge\launch.py", line 54, in <module>
    main()
  File "C:\Users\user\Desktop\Stable Diffusion Forge AMD\stable-diffusion-webui-amdgpu-forge\launch.py", line 42, in main
    prepare_environment()
  File "C:\Users\user\Desktop\Stable Diffusion Forge AMD\stable-diffusion-webui-amdgpu-forge\modules\launch_utils.py", line 608, in prepare_environment
    from modules import devices
  File "C:\Users\user\Desktop\Stable Diffusion Forge AMD\stable-diffusion-webui-amdgpu-forge\modules\devices.py", line 3, in <module>
    from backend import memory_management
  File "C:\Users\user\Desktop\Stable Diffusion Forge AMD\stable-diffusion-webui-amdgpu-forge\backend\memory_management.py", line 10, in <module>
    from backend import stream, utils
  File "C:\Users\user\Desktop\Stable Diffusion Forge AMD\stable-diffusion-webui-amdgpu-forge\backend\utils.py", line 1, in <module>
    import gguf
ModuleNotFoundError: No module named 'gguf'
To continue, press any key. . .

If I added in launch.py

import sys
sys.path.append(r"C:\Stable Diffusion\new-forge\packages_3rdparty")

– gives me the following error:

venv "C:\Users\user\Desktop\Stable Diffusion Forge AMD\stable-diffusion-webui-amdgpu-forge\venv\Scripts\Python.exe"
ROCm Toolkit 6.1 was found.
fatal: No names found, cannot describe anything.
Python 3.10.6 (tags/v3.10.6:9c7b4bd, Aug  1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)]
Version: f2.0.1v1.10.1-1.10.1
Commit hash: 412c2d800dcae4cee8a7466a1e9128cfbbc5bf26
Failed to load ZLUDA: Could not find module 'C:\Program Files\AMD\ROCm\6.1\bin\rocblas.dll' (or one of its dependencies). Try using the full path with constructor syntax.
Using CPU-only torch
Traceback (most recent call last):
  File "C:\Users\user\Desktop\Stable Diffusion Forge AMD\stable-diffusion-webui-amdgpu-forge\launch.py", line 57, in <module>
    main()
  File "C:\Users\user\Desktop\Stable Diffusion Forge AMD\stable-diffusion-webui-amdgpu-forge\launch.py", line 45, in main
    prepare_environment()
  File "C:\Users\user\Desktop\Stable Diffusion Forge AMD\stable-diffusion-webui-amdgpu-forge\modules\launch_utils.py", line 608, in prepare_environment
    from modules import devices
  File "C:\Users\user\Desktop\Stable Diffusion Forge AMD\stable-diffusion-webui-amdgpu-forge\modules\devices.py", line 3, in <module>
    from backend import memory_management
  File "C:\Users\user\Desktop\Stable Diffusion Forge AMD\stable-diffusion-webui-amdgpu-forge\backend\memory_management.py", line 133, in <module>
    total_vram = get_total_memory(get_torch_device()) / (1024 * 1024)
  File "C:\Users\user\Desktop\Stable Diffusion Forge AMD\stable-diffusion-webui-amdgpu-forge\backend\memory_management.py", line 100, in get_torch_device
    return torch.device(torch.cuda.current_device())
  File "C:\Users\user\Desktop\Stable Diffusion Forge AMD\stable-diffusion-webui-amdgpu-forge\venv\lib\site-packages\torch\cuda\__init__.py", line 778, in current_device
    _lazy_init()
  File "C:\Users\user\Desktop\Stable Diffusion Forge AMD\stable-diffusion-webui-amdgpu-forge\venv\lib\site-packages\torch\cuda\__init__.py", line 293, in _lazy_init
    torch._C._cuda_init()
RuntimeError: Found no NVIDIA driver on your system. Please check that you have an NVIDIA GPU and installed a driver from http://www.nvidia.com/Download/index.aspx
To continue, press any key. . .

Even when adding in launch.py:

import logging
import traceback
logging.basicConfig(filename='error_log.txt', level=logging.DEBUG)

– leads to the same error as mentioned above about NVIDIA.

Adding --use-directml --use-zluda to COMMANDLINE_ARGS results in the same error with NVIDIA. I read most of the issues on the Internet about gguf or NVIDIA, but I didn't find any useful information. Deleting the "venv" folder did not help. Reinstalled several times, installed via git clone https://github.com/lshqqytiger/stable-diffusion-webui-amdgpu-forge.git

Please help me fix this. I don't know much about programming, so if you need to add some code, write on which line and after that. Screenshots are attached launch.py , in webui-user, nothing is written in COMMANDLINE_ARGS. Screenshot_1 Screenshot_2

TheFerumn commented 5 days ago

You fixed gguf problem but it looks like you haven't installed HIP SDK correctly.

image

Its needed if you want to use --zluda and don't use --zluda and --directml at the same time in your commands

image

correct commands are --zluda or --directml without "use"

TheFerumn commented 5 days ago

If you want to use ZLUDA you have to remember your CPU must support PCIe™ atomics. For RX580 you probably need build your own RocblasLibs. Here is the link with whole guide: https://github.com/vladmandic/automatic/wiki/ZLUDA

BTW: If you don't want to do this then you can just use --directml command

VeteranXT commented 5 days ago

Steps to fix: Go into venv/scripts open CMD. Type activatethen pip install gguf. Run.bat

Harbitos commented 4 days ago

If you want to use ZLUDA you have to remember your CPU must support PCIe™ atomics. For RX580 you probably need build your own RocblasLibs. Here is the link with whole guide: https://github.com/vladmandic/automatic/wiki/ZLUDA

BTW: If you don't want to do this then you can just use --directml command

SD started working with --directml, generated a couple of images, but also gave errors a couple of times: the first - nothing was written, restarting SD helped, the second - resource deadlock would occur:resource deadlock would occur, restarting helped too.

And which is better, ZLUDA or --derectml? A friend told me that directml is more stable than ZLUDA. If ZLUDA is better, then please explain as simply as possible how to install it, otherwise at one point it is difficult for me to create RocblasLibs libraries.

TheFerumn commented 4 days ago

As far as i know ZLUDA is faster and better but i can't test it myself. You have everything in the link i paste how to make ZLUDA work. There is nothing more to it you just need CPU supporting PCIe™ atomics.

This is the whole guide: image

RX580 is not on the list so you need to build your own RocblasLibs BUT i saw once somewhere ppl already made libs for RX580 so if you will look for it in google you should be able to find

EDIT: If you will stay with --directml i will also suggest you to use --no-half-vae --no-half this commands

TheFerumn commented 4 days ago

Steps to fix: Go into venv/scripts open CMD. Type activatethen pip install gguf. Run.bat

He fixed it. I believe the method you mentioned doesn't work because Forge has its own integrated GGUF module but there is bug when its not visible. Downloading GGUF with pip install gguf will download wrong version

Harbitos commented 4 days ago

As far as i know ZLUDA is faster and better but i can't test it myself. You have everything in the link i paste how to make ZLUDA work. There is nothing more to it you just need CPU supporting PCIe™ atomics.

This is the whole guide: image

RX580 is not on the list so you need to build your own RocblasLibs BUT i saw once somewhere ppl already made libs for RX580 so if you will look for it in google you should be able to find

Drop the link, I can't find it.

TheFerumn commented 4 days ago

Drop the link, I can't find it.

Link to what ? To the guide ? I don't want to be mean to you or anything but if you can't find the link from few comments above which you even quoted then just give up and use DirectML :D

Unless you talk about RocblasLibs for RX580 then i don't have a link

ElusiveT commented 21 hours ago

Steps to fix: Go into venv/scripts open CMD. Type activatethen pip install gguf. Run.bat

i had the ModuleNotFoundError: No module named 'gguf' error. i edited launch.py as in the original comment, then i did what this comment said, and that fixed it