vladmandic / automatic

SD.Next: Advanced Implementation of Stable Diffusion and other Diffusion-based generative image models
https://github.com/vladmandic/automatic
GNU Affero General Public License v3.0
5.49k stars 400 forks source link

Failed to load ZLUDA: Could not find module 'C:\ZLUDA\nvrtc64_112_0.dll' (or one of its dependencies). Try using the full path with constructor syntax. #3354

Closed BrunoDutch closed 2 weeks ago

BrunoDutch commented 1 month ago

Issue Description

I followed all the steps in the guide, but when I open the .bat, this error appears in the cmd, the web-ui opens normally, but when I click to generate images it gives an error, and it also says that I am using CPU-only torch Screenshot_5 Screenshot_6

Version Platform Description

I'm using Windows with AMD RX6600

Relevant log output

venv "C:\ALL\SD-Zluda\stable-diffusion-webui-amdgpu\venv\Scripts\Python.exe"
WARNING: ZLUDA works best with SD.Next. Please consider migrating to SD.Next.
Python 3.10.11 (tags/v3.10.11:7d4cc5a, Apr  5 2023, 00:38:17) [MSC v.1929 64 bit (AMD64)]
Version: v1.10.1-amd-2-g395ce8dc
Commit hash: 395ce8dc2cb01282d48074a89a5e6cb3da4b59ab
Failed to load ZLUDA: Could not find module 'C:\ZLUDA\nvrtc64_112_0.dll' (or one of its dependencies). Try using the full path with constructor syntax.
Using CPU-only torch
Skipping onnxruntime installation.
You are up to date with the most recent release.
no module 'xformers'. Processing without...
no module 'xformers'. Processing without...
No module 'xformers'. Proceeding without it.
C:\ALL\SD-Zluda\stable-diffusion-webui-amdgpu\venv\lib\site-packages\pytorch_lightning\utilities\distributed.py:258: LightningDeprecationWarning: `pytorch_lightning.utilities.distributed.rank_zero_only` has been deprecated in v1.8.1 and will be removed in v2.0.0. You can import it from `pytorch_lightning.utilities` instead.
  rank_zero_deprecation(
Launching Web UI with arguments: --use-zluda --medvram-sdxl --update-check --skip-ort
ZLUDA device failed to pass basic operation test: index=None, device_name=AMD Radeon RX 6600 [ZLUDA]

Loading weights [6ce0161689] from C:\ALL\SD-Zluda\stable-diffusion-webui-amdgpu\models\Stable-diffusion\v1-5-pruned-emaonly.safetensors
Creating model from config: C:\ALL\SD-Zluda\stable-diffusion-webui-amdgpu\configs\v1-inference.yaml
C:\ALL\SD-Zluda\stable-diffusion-webui-amdgpu\venv\lib\site-packages\huggingface_hub\file_download.py:1150: FutureWarning: `resume_download` is deprecated and will be removed in version 1.0.0. Downloads always resume when possible. If you want to force a new download, use `force_download=True`.
  warnings.warn(
Running on local URL:  http://127.0.0.1:7860

To create a public link, set `share=True` in `launch()`.
Startup time: 86.7s (prepare environment: 159.5s, initialize shared: 1.7s, other imports: 1.8s, load scripts: 0.8s, create ui: 0.9s, gradio launch: 0.4s).
Applying attention optimization: InvokeAI... done.
loading stable diffusion model: RuntimeError
Traceback (most recent call last):
  File "C:\Users\Dutch\AppData\Local\Programs\Python\Python310\lib\threading.py", line 973, in _bootstrap
    self._bootstrap_inner()
  File "C:\Users\Dutch\AppData\Local\Programs\Python\Python310\lib\threading.py", line 1016, in _bootstrap_inner
    self.run()
  File "C:\Users\Dutch\AppData\Local\Programs\Python\Python310\lib\threading.py", line 953, in run
    self._target(*self._args, **self._kwargs)
  File "C:\ALL\SD-Zluda\stable-diffusion-webui-amdgpu\modules\initialize.py", line 149, in load_model
    shared.sd_model  # noqa: B018
  File "C:\ALL\SD-Zluda\stable-diffusion-webui-amdgpu\modules\shared_items.py", line 190, in sd_model
    return modules.sd_models.model_data.get_sd_model()
  File "C:\ALL\SD-Zluda\stable-diffusion-webui-amdgpu\modules\sd_models.py", line 693, in get_sd_model
    load_model()
  File "C:\ALL\SD-Zluda\stable-diffusion-webui-amdgpu\modules\sd_models.py", line 880, in load_model
    sd_model.cond_stage_model_empty_prompt = get_empty_cond(sd_model)
  File "C:\ALL\SD-Zluda\stable-diffusion-webui-amdgpu\modules\sd_models.py", line 728, in get_empty_cond
    d = sd_model.get_learned_conditioning([""])
  File "C:\ALL\SD-Zluda\stable-diffusion-webui-amdgpu\repositories\stable-diffusion-stability-ai\ldm\models\diffusion\ddpm.py", line 669, in get_learned_conditioning
    c = self.cond_stage_model(c)
  File "C:\ALL\SD-Zluda\stable-diffusion-webui-amdgpu\venv\lib\site-packages\torch\nn\modules\module.py", line 1532, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
  File "C:\ALL\SD-Zluda\stable-diffusion-webui-amdgpu\venv\lib\site-packages\torch\nn\modules\module.py", line 1541, in _call_impl
    return forward_call(*args, **kwargs)
  File "C:\ALL\SD-Zluda\stable-diffusion-webui-amdgpu\modules\sd_hijack_clip.py", line 313, in forward
    return super().forward(texts)
  File "C:\ALL\SD-Zluda\stable-diffusion-webui-amdgpu\modules\sd_hijack_clip.py", line 227, in forward
    z = self.process_tokens(tokens, multipliers)
  File "C:\ALL\SD-Zluda\stable-diffusion-webui-amdgpu\modules\sd_hijack_clip.py", line 269, in process_tokens
    z = self.encode_with_transformers(tokens)
  File "C:\ALL\SD-Zluda\stable-diffusion-webui-amdgpu\modules\sd_hijack_clip.py", line 352, in encode_with_transformers
    outputs = self.wrapped.transformer(input_ids=tokens, output_hidden_states=-opts.CLIP_stop_at_last_layers)
  File "C:\ALL\SD-Zluda\stable-diffusion-webui-amdgpu\venv\lib\site-packages\torch\nn\modules\module.py", line 1532, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
  File "C:\ALL\SD-Zluda\stable-diffusion-webui-amdgpu\venv\lib\site-packages\torch\nn\modules\module.py", line 1541, in _call_impl
    return forward_call(*args, **kwargs)
  File "C:\ALL\SD-Zluda\stable-diffusion-webui-amdgpu\venv\lib\site-packages\transformers\models\clip\modeling_clip.py", line 822, in forward
    return self.text_model(
  File "C:\ALL\SD-Zluda\stable-diffusion-webui-amdgpu\venv\lib\site-packages\torch\nn\modules\module.py", line 1532, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
  File "C:\ALL\SD-Zluda\stable-diffusion-webui-amdgpu\venv\lib\site-packages\torch\nn\modules\module.py", line 1541, in _call_impl
    return forward_call(*args, **kwargs)
  File "C:\ALL\SD-Zluda\stable-diffusion-webui-amdgpu\venv\lib\site-packages\transformers\models\clip\modeling_clip.py", line 730, in forward
    hidden_states = self.embeddings(input_ids=input_ids, position_ids=position_ids)
  File "C:\ALL\SD-Zluda\stable-diffusion-webui-amdgpu\venv\lib\site-packages\torch\nn\modules\module.py", line 1532, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
  File "C:\ALL\SD-Zluda\stable-diffusion-webui-amdgpu\venv\lib\site-packages\torch\nn\modules\module.py", line 1541, in _call_impl
    return forward_call(*args, **kwargs)
  File "C:\ALL\SD-Zluda\stable-diffusion-webui-amdgpu\venv\lib\site-packages\transformers\models\clip\modeling_clip.py", line 227, in forward
    inputs_embeds = self.token_embedding(input_ids)
  File "C:\ALL\SD-Zluda\stable-diffusion-webui-amdgpu\venv\lib\site-packages\torch\nn\modules\module.py", line 1532, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
  File "C:\ALL\SD-Zluda\stable-diffusion-webui-amdgpu\venv\lib\site-packages\torch\nn\modules\module.py", line 1541, in _call_impl
    return forward_call(*args, **kwargs)
  File "C:\ALL\SD-Zluda\stable-diffusion-webui-amdgpu\modules\sd_hijack.py", line 351, in forward
    inputs_embeds = self.wrapped(input_ids)
  File "C:\ALL\SD-Zluda\stable-diffusion-webui-amdgpu\venv\lib\site-packages\torch\nn\modules\module.py", line 1532, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
  File "C:\ALL\SD-Zluda\stable-diffusion-webui-amdgpu\venv\lib\site-packages\torch\nn\modules\module.py", line 1541, in _call_impl
    return forward_call(*args, **kwargs)
  File "C:\ALL\SD-Zluda\stable-diffusion-webui-amdgpu\venv\lib\site-packages\torch\nn\modules\sparse.py", line 163, in forward
    return F.embedding(
  File "C:\ALL\SD-Zluda\stable-diffusion-webui-amdgpu\venv\lib\site-packages\torch\nn\functional.py", line 2264, in embedding
    return torch.embedding(weight, input, padding_idx, scale_grad_by_freq, sparse)
RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu! (when checking argument for argument index in method wrapper_CUDA__index_select)

Backend

Diffusers

UI

Standard

Branch

Master

Model

StableDiffusion 1.5

Acknowledgements

brknsoul commented 1 month ago

This github is specifically for SD.Next. Please post on the relevant github for other SD UIs.