lshqqytiger / stable-diffusion-webui-amdgpu

Stable Diffusion web UI
GNU Affero General Public License v3.0
1.87k stars 192 forks source link

[Bug]: RuntimeError: The GPU device instance has been suspended. Use GetDeviceRemovedReason to determine the appropriate action. #71

Open Krblanc opened 1 year ago

Krblanc commented 1 year ago

Is there an existing issue for this?

What happened?

Reopening issue #22 since DirectX seems not to be the problem for me - I am running Directx12.

Steps to reproduce the problem

  1. open stable-diffusion-webui-directml-master folder
  2. load the ui
  3. generate a picture
  4. error

What should have happened?

I would expect the percent in the command prompt to go to 100% and the picture to load

Commit where the problem happens

### What platforms do you use to access the UI ? Windows ### What browsers do you use to access the UI ? Google Chrome ### Command Line Arguments ```Shell --disable-safe-unpickle --precision full --no-half --lowvram ``` ### List of extensions no ### Console logs ```Shell venv "C:\Users\SurfacePro 4\Documents\stable-diffusion-webui-directml-master\venv\Scripts\Python.exe" Python 3.10.11 (tags/v3.10.11:7d4cc5a, Apr 5 2023, 00:38:17) [MSC v.1929 64 bit (AMD64)] Commit hash: Installing requirements for Web UI Launching Web UI with arguments: --disable-safe-unpickle --precision full --no-half --lowvram Warning: experimental graphic memory optimization is disabled due to gpu vendor. Currently this optimization is only available for AMDGPUs. Disabled experimental graphic memory optimizations. Interrogations are fallen back to cpu. This doesn't affect on image generation. But if you want to use interrogate (CLIP or DeepBooru), check out this issue: https://github.com/lshqqytiger/stable-diffusion-webui-directml/issues/10 Warning: caught exception 'Torch not compiled with CUDA enabled', memory monitor disabled No module 'xformers'. Proceeding without it. Loading weights [fe4efff1e1] from C:\Users\SurfacePro 4\Documents\stable-diffusion-webui-directml-master\models\Stable-diffusion\sd-v1-4.ckpt Creating model from config: C:\Users\SurfacePro 4\Documents\stable-diffusion-webui-directml-master\configs\v1-inference.yaml LatentDiffusion: Running in eps-prediction mode DiffusionWrapper has 859.52 M params. Applying cross attention optimization (InvokeAI). Textual inversion embeddings loaded(0): Model loaded in 232.5s (load weights from disk: 55.1s, load config: 5.6s, create model: 22.1s, apply weights to model: 148.7s, apply dtype to VAE: 0.3s, load VAE: 0.1s, move model to device: 0.1s, hijack: 0.3s, load textual inversion embeddings: 0.3s). Running on local URL: http://127.0.0.1:7860 To create a public link, set `share=True` in `launch()`. Startup time: 322.9s (import torch: 30.5s, import gradio: 20.1s, import ldm: 9.3s, other imports: 18.2s, list SD models: 0.1s, setup codeformer: 1.8s, list builtin upscalers: 0.3s, load scripts: 4.8s, load SD checkpoint: 233.7s, create ui: 2.1s, gradio launch: 1.9s). 0%| | 0/20 [02:26 samples = self.launch_sampling(steps, lambda: self.func(self.model_wrap_cfg, x, extra_args={ File "C:\Users\SurfacePro 4\Documents\stable-diffusion-webui-directml-master\venv\lib\site-packages\torch\autograd\grad_mode.py", line 27, in decorate_context return func(*args, **kwargs) File "C:\Users\SurfacePro 4\Documents\stable-diffusion-webui-directml-master\repositories\k-diffusion\k_diffusion\sampling.py", line 150, in sample_euler_ancestral denoised = model(x, sigmas[i] * s_in, **extra_args) File "C:\Users\SurfacePro 4\Documents\stable-diffusion-webui-directml-master\venv\lib\site-packages\torch\nn\modules\module.py", line 1194, in _call_impl return forward_call(*input, **kwargs) File "C:\Users\SurfacePro 4\Documents\stable-diffusion-webui-directml-master\modules\sd_samplers_kdiffusion.py", line 132, in forward x_out[a:b] = self.inner_model(x_in[a:b], sigma_in[a:b], cond=make_condition_dict([cond_in[a:b]], image_cond_in[a:b])) File "C:\Users\SurfacePro 4\Documents\stable-diffusion-webui-directml-master\venv\lib\site-packages\torch\nn\modules\module.py", line 1194, in _call_impl return forward_call(*input, **kwargs) File "C:\Users\SurfacePro 4\Documents\stable-diffusion-webui-directml-master\repositories\k-diffusion\k_diffusion\external.py", line 112, in forward eps = self.get_eps(input * c_in, self.sigma_to_t(sigma), **kwargs) File "C:\Users\SurfacePro 4\Documents\stable-diffusion-webui-directml-master\repositories\k-diffusion\k_diffusion\external.py", line 138, in get_eps return self.inner_model.apply_model(*args, **kwargs) File "C:\Users\SurfacePro 4\Documents\stable-diffusion-webui-directml-master\modules\sd_hijack_utils.py", line 17, in setattr(resolved_obj, func_path[-1], lambda *args, **kwargs: self(*args, **kwargs)) File "C:\Users\SurfacePro 4\Documents\stable-diffusion-webui-directml-master\modules\sd_hijack_utils.py", line 28, in __call__ return self.__orig_func(*args, **kwargs) File "C:\Users\SurfacePro 4\Documents\stable-diffusion-webui-directml-master\repositories\stable-diffusion-stability-ai\ldm\models\diffusion\ddpm.py", line 858, in apply_model x_recon = self.model(x_noisy, t, **cond) File "C:\Users\SurfacePro 4\Documents\stable-diffusion-webui-directml-master\venv\lib\site-packages\torch\nn\modules\module.py", line 1194, in _call_impl return forward_call(*input, **kwargs) File "C:\Users\SurfacePro 4\Documents\stable-diffusion-webui-directml-master\repositories\stable-diffusion-stability-ai\ldm\models\diffusion\ddpm.py", line 1335, in forward out = self.diffusion_model(x, t, context=cc) File "C:\Users\SurfacePro 4\Documents\stable-diffusion-webui-directml-master\venv\lib\site-packages\torch\nn\modules\module.py", line 1194, in _call_impl return forward_call(*input, **kwargs) File "C:\Users\SurfacePro 4\Documents\stable-diffusion-webui-directml-master\repositories\stable-diffusion-stability-ai\ldm\modules\diffusionmodules\openaimodel.py", line 802, in forward h = module(h, emb, context) File "C:\Users\SurfacePro 4\Documents\stable-diffusion-webui-directml-master\venv\lib\site-packages\torch\nn\modules\module.py", line 1212, in _call_impl result = forward_call(*input, **kwargs) File "C:\Users\SurfacePro 4\Documents\stable-diffusion-webui-directml-master\repositories\stable-diffusion-stability-ai\ldm\modules\diffusionmodules\openaimodel.py", line 84, in forward x = layer(x, context) File "C:\Users\SurfacePro 4\Documents\stable-diffusion-webui-directml-master\venv\lib\site-packages\torch\nn\modules\module.py", line 1194, in _call_impl return forward_call(*input, **kwargs) File "C:\Users\SurfacePro 4\Documents\stable-diffusion-webui-directml-master\repositories\stable-diffusion-stability-ai\ldm\modules\attention.py", line 334, in forward x = block(x, context=context[i]) File "C:\Users\SurfacePro 4\Documents\stable-diffusion-webui-directml-master\venv\lib\site-packages\torch\nn\modules\module.py", line 1194, in _call_impl return forward_call(*input, **kwargs) File "C:\Users\SurfacePro 4\Documents\stable-diffusion-webui-directml-master\repositories\stable-diffusion-stability-ai\ldm\modules\attention.py", line 269, in forward return checkpoint(self._forward, (x, context), self.parameters(), self.checkpoint) File "C:\Users\SurfacePro 4\Documents\stable-diffusion-webui-directml-master\repositories\stable-diffusion-stability-ai\ldm\modules\diffusionmodules\util.py", line 121, in checkpoint return CheckpointFunction.apply(func, len(inputs), *args) File "C:\Users\SurfacePro 4\Documents\stable-diffusion-webui-directml-master\repositories\stable-diffusion-stability-ai\ldm\modules\diffusionmodules\util.py", line 136, in forward output_tensors = ctx.run_function(*ctx.input_tensors) File "C:\Users\SurfacePro 4\Documents\stable-diffusion-webui-directml-master\repositories\stable-diffusion-stability-ai\ldm\modules\attention.py", line 272, in _forward x = self.attn1(self.norm1(x), context=context if self.disable_self_attn else None) + x File "C:\Users\SurfacePro 4\Documents\stable-diffusion-webui-directml-master\venv\lib\site-packages\torch\nn\modules\module.py", line 1194, in _call_impl return forward_call(*input, **kwargs) File "C:\Users\SurfacePro 4\Documents\stable-diffusion-webui-directml-master\modules\sd_hijack_optimizations.py", line 246, in split_cross_attention_forward_invokeAI r = einsum_op(q, k, v) File "C:\Users\SurfacePro 4\Documents\stable-diffusion-webui-directml-master\modules\sd_hijack_optimizations.py", line 225, in einsum_op return einsum_op_tensor_mem(q, k, v, 32) File "C:\Users\SurfacePro 4\Documents\stable-diffusion-webui-directml-master\modules\sd_hijack_optimizations.py", line 194, in einsum_op_tensor_mem return einsum_op_slice_1(q, k, v, max(q.shape[1] // div, 1)) File "C:\Users\SurfacePro 4\Documents\stable-diffusion-webui-directml-master\modules\sd_hijack_optimizations.py", line 169, in einsum_op_slice_1 r[:, i:end] = einsum_op_compvis(q[:, i:end], k, v) File "C:\Users\SurfacePro 4\Documents\stable-diffusion-webui-directml-master\modules\sd_hijack_optimizations.py", line 155, in einsum_op_compvis s = s.softmax(dim=-1, dtype=s.dtype) RuntimeError: The GPU device instance has been suspended. Use GetDeviceRemovedReason to determine the appropriate action. ``` ### Additional information Also wondering why I dont have a commit hash?
duclong2502 commented 1 year ago

image my bug