Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: ZLUDA not working on RX 5700 XT on Windows #475

Open
3 of 6 tasks
ju-h4 opened this issue Jun 20, 2024 · 5 comments
Open
3 of 6 tasks

[Bug]: ZLUDA not working on RX 5700 XT on Windows #475

ju-h4 opened this issue Jun 20, 2024 · 5 comments
Assignees
Labels
bug Something isn't working zluda About ZLUDA

Comments

@ju-h4
Copy link

ju-h4 commented Jun 20, 2024

Checklist

  • The issue exists after disabling all extensions
  • The issue exists on a clean installation of webui
  • The issue is caused by an extension, but I believe it is caused by a bug in the webui
  • The issue exists in the current version of the webui
  • The issue has not been reported before recently
  • The issue has been reported before but has not been fixed yet

What happened?

I installed web-ui with zluda via this manual: https://github.com/CS1o/Stable-Diffusion-Info/wiki/Installation-Guides#amd-automatic1111-with-zluda

When I start the web-ui I get these "errors":

Failed to install ZLUDA: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: certificate has expired (_ssl.c:997)>
Using CPU-only torch
...
ZLUDA device failed to pass basic operation test: index=None, device_name=AMD Radeon RX 5700 XT [ZLUDA]

Web-UI starts, but no model can be loaded.
What did I wrong?

Steps to reproduce the problem

Just follow the steps from https://github.com/CS1o/Stable-Diffusion-Info/wiki/Installation-Guides#amd-automatic1111-with-zluda

What should have happened?

Web-UI should work with ZLUDA.

What browsers do you use to access the UI ?

Mozilla Firefox

Sysinfo

sysinfo-2024-06-20-06-52.json

Console logs

PS C:\git\stable-diffusion-webui-amdgpu> .\webui-user.bat
venv "C:\git\stable-diffusion-webui-amdgpu\venv\Scripts\Python.exe"
WARNING: ZLUDA works best with SD.Next. Please consider migrating to SD.Next.
Python 3.10.6 (tags/v3.10.6:9c7b4bd, Aug  1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)]
Version: v1.9.3-amd-26-g50d3cf78
Commit hash: 50d3cf7852cfe07bd562440246202d8925be98a4
Failed to install ZLUDA: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: certificate has expired (_ssl.c:997)>
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:\git\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 5700 XT [ZLUDA]
CUDA error: operation not supported
CUDA kernel errors might be asynchronously reported at some other API call, so the stacktrace below might be incorrect.
For debugging consider passing CUDA_LAUNCH_BLOCKING=1.
Compile with `TORCH_USE_CUDA_DSA` to enable device-side assertions.

Loading weights [879db523c3] from C:\git\stable-diffusion-webui-amdgpu\models\Stable-diffusion\dreamshaper_8.safetensors
Creating model from config: C:\git\stable-diffusion-webui-amdgpu\configs\v1-inference.yaml
C:\git\stable-diffusion-webui-amdgpu\venv\lib\site-packages\huggingface_hub\file_download.py:1132: 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(
C:\git\stable-diffusion-webui-amdgpu\venv\lib\site-packages\diffusers\models\transformers\transformer_2d.py:34: FutureWarning: `Transformer2DModelOutput` is deprecated and will be removed in version 1.0.0. Importing `Transformer2DModelOutput` from `diffusers.models.transformer_2d` is deprecated and this will be removed in a future version. Please use `from diffusers.models.modeling_outputs import Transformer2DModelOutput`, instead.
  deprecate("Transformer2DModelOutput", "1.0.0", deprecation_message)
Running on local URL:  http://127.0.0.1:7860

To create a public link, set `share=True` in `launch()`.
Startup time: 18.2s (prepare environment: 25.4s, initialize shared: 1.6s, other imports: 1.1s, load scripts: 0.6s, create ui: 1.0s, gradio launch: 0.5s).
Applying attention optimization: InvokeAI... done.
loading stable diffusion model: RuntimeError
Traceback (most recent call last):
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python310\lib\threading.py", line 973, in _bootstrap
    self._bootstrap_inner()
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python310\lib\threading.py", line 1016, in _bootstrap_inner
    self.run()
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python310\lib\threading.py", line 953, in run
    self._target(*self._args, **self._kwargs)
  File "C:\git\stable-diffusion-webui-amdgpu\modules\initialize.py", line 149, in load_model
    shared.sd_model  # noqa: B018
  File "C:\git\stable-diffusion-webui-amdgpu\modules\shared_items.py", line 190, in sd_model
    return modules.sd_models.model_data.get_sd_model()
  File "C:\git\stable-diffusion-webui-amdgpu\modules\sd_models.py", line 621, in get_sd_model
    load_model()
  File "C:\git\stable-diffusion-webui-amdgpu\modules\sd_models.py", line 774, in load_model
    sd_hijack.model_hijack.embedding_db.load_textual_inversion_embeddings(force_reload=True)  # Reload embeddings after model load as they may or may not fit the model
  File "C:\git\stable-diffusion-webui-amdgpu\modules\textual_inversion\textual_inversion.py", line 224, in load_textual_inversion_embeddings
    self.expected_shape = self.get_expected_shape()
  File "C:\git\stable-diffusion-webui-amdgpu\modules\textual_inversion\textual_inversion.py", line 156, in get_expected_shape
    vec = shared.sd_model.cond_stage_model.encode_embedding_init_text(",", 1)
  File "C:\git\stable-diffusion-webui-amdgpu\modules\sd_hijack_clip.py", line 344, in encode_embedding_init_text
    embedded = embedding_layer.token_embedding.wrapped(ids.to(embedding_layer.token_embedding.wrapped.weight.device)).squeeze(0)
  File "C:\git\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:\git\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:\git\stable-diffusion-webui-amdgpu\venv\lib\site-packages\torch\nn\modules\sparse.py", line 163, in forward
    return F.embedding(
  File "C:\git\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: CUDA error: operation not supported
CUDA kernel errors might be asynchronously reported at some other API call, so the stacktrace below might be incorrect.
For debugging consider passing CUDA_LAUNCH_BLOCKING=1.
Compile with `TORCH_USE_CUDA_DSA` to enable device-side assertions.



Stable diffusion model failed to load

Additional information

I updated my GPU driver to the latest AMD Adrenaline Version 24.5.1

@CS1o
Copy link

CS1o commented Jun 22, 2024

Hey, the cause of the error is this part here:

Failed to install ZLUDA: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: certificate has expired (_ssl.c:997)>
Using CPU-only torch

I dont know which Certificate has expired. but what you can try to fix is doing these steps:

  • Verify your PCs System Time and date is Correct.
  • Install Python 3.10.11 64bit like stated in my Guide.
  • Open up a cmd and run pip cache purge to remove broken packages and temp stuff.
  • Delete the venv folder and the .zluda folder and rerun the webui-user.bat

Let me know if it works then.

@ju-h4
Copy link
Author

ju-h4 commented Jun 22, 2024

Ah. Thanks, I completely overlooked the "preparation" point, my mistake.
I'll try it out tonight and let you know if I've got it right.

@ju-h4
Copy link
Author

ju-h4 commented Jun 23, 2024

Hey @CS1o,
Unfortunately, it didn't work.
I have upgraded the Python version, emptied the pip cache, deleted the venv folder (I could not find a .zluda folder, maybe because zluda was not started properly?) and executed webui-user.bat again. Unfortunately with the same result:

Logs
PS C:\git\stable-diffusion-webui-amdgpu> .\webui-user.bat
Creating venv in directory C:\git\stable-diffusion-webui-amdgpu\venv using python "C:\Users\xxxxx\AppData\Local\Programs\Python\Python310\python.exe"
venv "C:\git\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.9.3-amd-26-g50d3cf78
Commit hash: 50d3cf7852cfe07bd562440246202d8925be98a4
Installing torch and torchvision
Looking in indexes: https://download.pytorch.org/whl/cu118
Collecting torch==2.3.0
  Downloading https://download.pytorch.org/whl/cu118/torch-2.3.0%2Bcu118-cp310-cp310-win_amd64.whl (2673.0 MB)
     ---------------------------------------- 2.7/2.7 GB 929.9 kB/s eta 0:00:00
Collecting torchvision
  Downloading https://download.pytorch.org/whl/cu118/torchvision-0.18.1%2Bcu118-cp310-cp310-win_amd64.whl (4.9 MB)
     ---------------------------------------- 4.9/4.9 MB 12.1 MB/s eta 0:00:00
Collecting mkl<=2021.4.0,>=2021.1.1
  Downloading https://download.pytorch.org/whl/mkl-2021.4.0-py2.py3-none-win_amd64.whl (228.5 MB)
     ---------------------------------------- 228.5/228.5 MB 5.2 MB/s eta 0:00:00
Collecting typing-extensions>=4.8.0
  Downloading https://download.pytorch.org/whl/typing_extensions-4.9.0-py3-none-any.whl (32 kB)
Collecting networkx
  Downloading https://download.pytorch.org/whl/networkx-3.2.1-py3-none-any.whl (1.6 MB)
     ---------------------------------------- 1.6/1.6 MB 13.1 MB/s eta 0:00:00
Collecting fsspec
  Downloading https://download.pytorch.org/whl/fsspec-2024.2.0-py3-none-any.whl (170 kB)
     ---------------------------------------- 170.9/170.9 kB 10.0 MB/s eta 0:00:00
Collecting jinja2
  Downloading https://download.pytorch.org/whl/Jinja2-3.1.3-py3-none-any.whl (133 kB)
     ---------------------------------------- 133.2/133.2 kB 8.2 MB/s eta 0:00:00
Collecting filelock
  Downloading https://download.pytorch.org/whl/filelock-3.13.1-py3-none-any.whl (11 kB)
Collecting sympy
  Downloading https://download.pytorch.org/whl/sympy-1.12-py3-none-any.whl (5.7 MB)
     ---------------------------------------- 5.7/5.7 MB 12.2 MB/s eta 0:00:00
Collecting torchvision
  Downloading https://download.pytorch.org/whl/cu118/torchvision-0.18.0%2Bcu118-cp310-cp310-win_amd64.whl (4.9 MB)
     ---------------------------------------- 4.9/4.9 MB 12.6 MB/s eta 0:00:00
Collecting numpy
  Downloading https://download.pytorch.org/whl/numpy-1.26.3-cp310-cp310-win_amd64.whl (15.8 MB)
     ---------------------------------------- 15.8/15.8 MB 11.7 MB/s eta 0:00:00
Collecting pillow!=8.3.*,>=5.3.0
  Downloading https://download.pytorch.org/whl/pillow-10.2.0-cp310-cp310-win_amd64.whl (2.6 MB)
     ---------------------------------------- 2.6/2.6 MB 11.9 MB/s eta 0:00:00
Collecting tbb==2021.*
  Downloading https://download.pytorch.org/whl/tbb-2021.11.0-py3-none-win_amd64.whl (298 kB)
     ---------------------------------------- 298.3/298.3 kB 18.0 MB/s eta 0:00:00
Collecting intel-openmp==2021.*
  Downloading https://download.pytorch.org/whl/intel_openmp-2021.4.0-py2.py3-none-win_amd64.whl (3.5 MB)
     ---------------------------------------- 3.5/3.5 MB 14.9 MB/s eta 0:00:00
Collecting MarkupSafe>=2.0
  Downloading https://download.pytorch.org/whl/MarkupSafe-2.1.5-cp310-cp310-win_amd64.whl (17 kB)
Collecting mpmath>=0.19
  Downloading https://download.pytorch.org/whl/mpmath-1.3.0-py3-none-any.whl (536 kB)
     ---------------------------------------- 536.2/536.2 kB 17.0 MB/s eta 0:00:00
Installing collected packages: tbb, mpmath, intel-openmp, typing-extensions, sympy, pillow, numpy, networkx, mkl, MarkupSafe, fsspec, filelock, jinja2, torch, torchvision
Successfully installed MarkupSafe-2.1.5 filelock-3.13.1 fsspec-2024.2.0 intel-openmp-2021.4.0 jinja2-3.1.3 mkl-2021.4.0 mpmath-1.3.0 networkx-3.2.1 numpy-1.26.3 pillow-10.2.0 sympy-1.12 tbb-2021.11.0 torch-2.3.0+cu118 torchvision-0.18.0+cu118 typing-extensions-4.9.0

[notice] A new release of pip is available: 23.0.1 -> 24.0
[notice] To update, run: C:\git\stable-diffusion-webui-amdgpu\venv\Scripts\python.exe -m pip install --upgrade pip
Failed to install ZLUDA: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: certificate has expired (_ssl.c:1007)>
Using CPU-only torch
Installing clip
Installing open_clip
Installing requirements
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:\git\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 5700 XT [ZLUDA]
CUDA error: CUBLAS_STATUS_NOT_SUPPORTED when calling `cublasSgemm( handle, opa, opb, m, n, k, &alpha, a, lda, b, ldb, &beta, c, ldc)`
Loading weights [879db523c3] from C:\git\stable-diffusion-webui-amdgpu\models\Stable-diffusion\dreamshaper_8.safetensors
Creating model from config: C:\git\stable-diffusion-webui-amdgpu\configs\v1-inference.yaml
C:\git\stable-diffusion-webui-amdgpu\venv\lib\site-packages\diffusers\models\transformers\transformer_2d.py:34: FutureWarning: `Transformer2DModelOutput` is deprecated and will be removed in version 1.0.0. Importing `Transformer2DModelOutput` from `diffusers.models.transformer_2d` is deprecated and this will be removed in a future version. Please use `from diffusers.models.modeling_outputs import Transformer2DModelOutput`, instead.
  deprecate("Transformer2DModelOutput", "1.0.0", deprecation_message)
C:\git\stable-diffusion-webui-amdgpu\venv\lib\site-packages\huggingface_hub\file_download.py:1132: 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: 492.5s (prepare environment: 492.0s, initialize shared: 5.2s, other imports: 0.7s, load scripts: 0.8s, create ui: 0.9s, gradio launch: 0.5s).
Exception in thread MemMon:
Traceback (most recent call last):
  File "C:\Users\xxxxx\AppData\Local\Programs\Python\Python310\lib\threading.py", line 1016, in _bootstrap_inner
    self.run()
  File "C:\git\stable-diffusion-webui-amdgpu\modules\memmon.py", line 43, in run
    torch.cuda.reset_peak_memory_stats()
  File "C:\git\stable-diffusion-webui-amdgpu\venv\lib\site-packages\torch\cuda\memory.py", line 309, in reset_peak_memory_stats
    return torch._C._cuda_resetPeakMemoryStats(device)
RuntimeError: invalid argument to reset_peak_memory_stats
Applying attention optimization: InvokeAI... done.
loading stable diffusion model: RuntimeError
Traceback (most recent call last):
  File "C:\Users\xxxxx\AppData\Local\Programs\Python\Python310\lib\threading.py", line 973, in _bootstrap
    self._bootstrap_inner()
  File "C:\Users\xxxxx\AppData\Local\Programs\Python\Python310\lib\threading.py", line 1016, in _bootstrap_inner
    self.run()
  File "C:\Users\xxxxx\AppData\Local\Programs\Python\Python310\lib\threading.py", line 953, in run
    self._target(*self._args, **self._kwargs)
  File "C:\git\stable-diffusion-webui-amdgpu\modules\initialize.py", line 149, in load_model
    shared.sd_model  # noqa: B018
  File "C:\git\stable-diffusion-webui-amdgpu\modules\shared_items.py", line 190, in sd_model
    return modules.sd_models.model_data.get_sd_model()
  File "C:\git\stable-diffusion-webui-amdgpu\modules\sd_models.py", line 621, in get_sd_model
    load_model()
  File "C:\git\stable-diffusion-webui-amdgpu\modules\sd_models.py", line 783, in load_model
    sd_model.cond_stage_model_empty_prompt = get_empty_cond(sd_model)
  File "C:\git\stable-diffusion-webui-amdgpu\modules\sd_models.py", line 659, in get_empty_cond
    return sd_model.cond_stage_model([""])
  File "C:\git\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:\git\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:\git\stable-diffusion-webui-amdgpu\modules\sd_hijack_clip.py", line 234, in forward
    z = self.process_tokens(tokens, multipliers)
  File "C:\git\stable-diffusion-webui-amdgpu\modules\sd_hijack_clip.py", line 276, in process_tokens
    z = self.encode_with_transformers(tokens)
  File "C:\git\stable-diffusion-webui-amdgpu\modules\sd_hijack_clip.py", line 331, in encode_with_transformers
    outputs = self.wrapped.transformer(input_ids=tokens, output_hidden_states=-opts.CLIP_stop_at_last_layers)
  File "C:\git\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:\git\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:\git\stable-diffusion-webui-amdgpu\venv\lib\site-packages\transformers\models\clip\modeling_clip.py", line 822, in forward
    return self.text_model(
  File "C:\git\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:\git\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:\git\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:\git\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:\git\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:\git\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:\git\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:\git\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:\git\stable-diffusion-webui-amdgpu\modules\sd_hijack.py", line 348, in forward
    inputs_embeds = self.wrapped(input_ids)
  File "C:\git\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:\git\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:\git\stable-diffusion-webui-amdgpu\venv\lib\site-packages\torch\nn\modules\sparse.py", line 163, in forward
    return F.embedding(
  File "C:\git\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)


Stable diffusion model failed to load
*** Error completing request
*** Arguments: ('task(ep1n0odjv2zm9q4)', <gradio.routes.Request object at 0x00000206E1C66560>, 'hgdfg', '', [], 1, 1, 7, 512, 512, False, 0.7, 2, 'Latent', 0, 0, 0, 'Use same checkpoint', 'Use same sampler', 'Use same scheduler', '', '', [], 0, 20, 'DPM++ 2M', 'Automatic', False, '', 0.8, -1, False, -1, 0, 0, 0, False, False, 'positive', 'comma', 0, False, False, 'start', '', 1, '', [], 0, '', [], 0, '', [], True, False, False, False, False, False, False, 0, False) {}
    Traceback (most recent call last):
      File "C:\git\stable-diffusion-webui-amdgpu\modules\call_queue.py", line 57, in f
        res = list(func(*args, **kwargs))
      File "C:\git\stable-diffusion-webui-amdgpu\modules\call_queue.py", line 36, in f
        res = func(*args, **kwargs)
      File "C:\git\stable-diffusion-webui-amdgpu\modules\txt2img.py", line 109, in txt2img
        processed = processing.process_images(p)
      File "C:\git\stable-diffusion-webui-amdgpu\modules\processing.py", line 834, in process_images
        sd_models.reload_model_weights()
      File "C:\git\stable-diffusion-webui-amdgpu\modules\sd_models.py", line 876, in reload_model_weights
        sd_model = reuse_model_from_already_loaded(sd_model, checkpoint_info, timer)
      File "C:\git\stable-diffusion-webui-amdgpu\modules\sd_models.py", line 805, in reuse_model_from_already_loaded
        send_model_to_cpu(sd_model)
      File "C:\git\stable-diffusion-webui-amdgpu\modules\sd_models.py", line 663, in send_model_to_cpu
        if m.lowvram:
    AttributeError: 'NoneType' object has no attribute 'lowvram'

---
Traceback (most recent call last):
  File "C:\git\stable-diffusion-webui-amdgpu\venv\lib\site-packages\gradio\routes.py", line 488, in run_predict
    output = await app.get_blocks().process_api(
  File "C:\git\stable-diffusion-webui-amdgpu\venv\lib\site-packages\gradio\blocks.py", line 1431, in process_api
    result = await self.call_function(
  File "C:\git\stable-diffusion-webui-amdgpu\venv\lib\site-packages\gradio\blocks.py", line 1103, in call_function
    prediction = await anyio.to_thread.run_sync(
  File "C:\git\stable-diffusion-webui-amdgpu\venv\lib\site-packages\anyio\to_thread.py", line 33, in run_sync
    return await get_asynclib().run_sync_in_worker_thread(
  File "C:\git\stable-diffusion-webui-amdgpu\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 877, in run_sync_in_worker_thread
    return await future
  File "C:\git\stable-diffusion-webui-amdgpu\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 807, in run
    result = context.run(func, *args)
  File "C:\git\stable-diffusion-webui-amdgpu\venv\lib\site-packages\gradio\utils.py", line 707, in wrapper
    response = f(*args, **kwargs)
  File "C:\git\stable-diffusion-webui-amdgpu\modules\call_queue.py", line 95, in f
    mem_stats = {k: -(v//-(1024*1024)) for k, v in shared.mem_mon.stop().items()}
  File "C:\git\stable-diffusion-webui-amdgpu\modules\memmon.py", line 99, in stop
    return self.read()
  File "C:\git\stable-diffusion-webui-amdgpu\modules\memmon.py", line 81, in read
    torch_stats = torch.cuda.memory_stats(self.device)
  File "C:\git\stable-diffusion-webui-amdgpu\venv\lib\site-packages\torch\cuda\memory.py", line 258, in memory_stats
    stats = memory_stats_as_nested_dict(device=device)
  File "C:\git\stable-diffusion-webui-amdgpu\venv\lib\site-packages\torch\cuda\memory.py", line 270, in memory_stats_as_nested_dict
    return torch._C._cuda_memoryStats(device)
RuntimeError: invalid argument to memory_allocated

Is there any debug option that I can see which certificate might be affected?
Thanks & Regards

@ju-h4
Copy link
Author

ju-h4 commented Jun 24, 2024

Hey @CS1o,
I fixed the issue.
urllib, that was used in zluda_installer.py can be erratic on Windows see: python/cpython#101738
I replaced it by using the python requests library:

import requests
...
open('_zluda', 'wb').write(requests.get(f'https://github.com/lshqqytiger/ZLUDA/releases/download/{RELEASE}/ZLUDA-windows-amd64.zip', allow_redirects=True).content)

Sorry, I'm not a python developer, so maybe it's not a good idea if I would create a pull request for that change.
And I don't know why others do not run in that error in Windows - so I don't know, if one should replace urllib lib by requests lib.

Update: Dude, that's so nice with ZLUDA, so fast, I like <3.

@lshqqytiger lshqqytiger self-assigned this Jun 25, 2024
@lshqqytiger lshqqytiger added bug Something isn't working zluda About ZLUDA labels Jun 25, 2024
@lshqqytiger lshqqytiger reopened this Jun 28, 2024
@upright2003
Copy link

Can rx5500 xt also be used??

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working zluda About ZLUDA
Development

No branches or pull requests

4 participants