automatic icon indicating copy to clipboard operation
automatic copied to clipboard

[Bug]: GFX906+SD.Next+ZLUDA and Seek for Solution to Use GFX906 on Windows

Open ENDlezZenith opened this issue 2 years ago • 7 comments

Issue Description

I used the wiki steps for installing ZLUDA+SD.Next. Yet when I ran it, I found that the image generated was in chaos. Interestingly, I can't find any error in the log. Here are the screenshots of the situation I met, and also two control groups for comparation: DirectML+GFX906 GPU (Success): DirectML On GPU ZLUDA+CPU (Success): ZLUDA On CPU ZLUDA+GFX906 GPU (Chaos): ZLUDA On GPU The HIP bin and ZLUDA directory are properly stated in the PATH. And I tried using the ROCmLibs.zip library to override the official ROCm library. The log I provided in this Issue is with ROCmLibs library overridden (Without ROCmLibs library was also tried, log may differ but same chaos result).

Version Platform Description

OS: Windows 10 Version 22H2 Build 19045.4046 HIP SDK: 5.7.1 ZLUDA: 3.5 SD.Next: Commit 1759f69637089ab75d6855672fc403be45721d18 (latest in dev branch) GPU: AMD Radeon Pro VII (GFX906) Model: Anything V5 (Base Model: SD 1.5)

Relevant log output

D:\Artificial Intelligence\automatic>webui.bat --use-zluda --debug --autolaunch
Using VENV: D:\Artificial Intelligence\automatic\venv
18:49:24-365798 INFO     Starting SD.Next
18:49:24-370799 INFO     Logger: file="D:\Artificial Intelligence\automatic\sdnext.log" level=DEBUG size=65 mode=create
18:49:24-373799 INFO     Python 3.10.11 on Windows
18:49:24-545801 INFO     Version: app=sd.next updated=2024-02-24 hash=1759f696
                         url=https://github.com/vladmandic/automatic/tree/dev
18:49:25-985798 INFO     Latest published version: c5f6c25a37858daedc6c59988d2e684c4fa7ddfb 2024-02-23T14:53:07Z
18:49:25-996798 INFO     Platform: arch=AMD64 cpu=Intel64 Family 6 Model 85 Stepping 6, GenuineIntel system=Windows
                         release=Windows-10-10.0.19045-SP0 python=3.10.11
18:49:26-001798 DEBUG    Setting environment tuning
18:49:26-003799 DEBUG    HF cache folder: C:\Users\ENDzZ\.cache\huggingface\hub
18:49:26-004798 DEBUG    Torch overrides: cuda=False rocm=False ipex=False diml=False openvino=False
18:49:26-007798 DEBUG    Torch allowed: cuda=True rocm=True ipex=True diml=True openvino=True
18:49:26-019799 DEBUG    Package not found: torch-directml
18:49:26-021798 INFO     AMD ROCm toolkit detected
18:49:27-023802 DEBUG    ROCm agents detected: ['gfx906:sramecc-:xnack-', 'gfx906:sramecc-:xnack-']
18:49:27-044802 DEBUG    ROCm hipconfig failed: local variable 'rocm_ver' referenced before assignment
18:49:27-046800 WARNING  ZLUDA support: experimental
18:49:27-047801 DEBUG    Installing torch: torch==2.2.0 torchvision --index-url https://download.pytorch.org/whl/cu118
18:49:27-156798 DEBUG    Repository update time: Sat Feb 24 14:54:08 2024
18:49:27-159798 INFO     Startup: standard
18:49:27-160798 INFO     Verifying requirements
18:49:27-175798 INFO     Verifying packages
18:49:27-178798 INFO     Verifying submodules
18:49:29-866799 DEBUG    Submodule: extensions-builtin/sd-extension-chainner / main
18:49:29-954798 DEBUG    Submodule: extensions-builtin/sd-extension-system-info / main
18:49:30-045799 DEBUG    Submodule: extensions-builtin/sd-webui-agent-scheduler / main
18:49:30-138799 DEBUG    Submodule: extensions-builtin/sd-webui-controlnet / main
18:49:30-254801 DEBUG    Submodule: extensions-builtin/stable-diffusion-webui-images-browser / main
18:49:30-340799 DEBUG    Submodule: extensions-builtin/stable-diffusion-webui-rembg / master
18:49:30-429799 DEBUG    Submodule: modules/k-diffusion / master
18:49:30-520802 DEBUG    Submodule: wiki / master
18:49:30-583799 DEBUG    Register paths
18:49:30-809800 DEBUG    Installed packages: 239
18:49:30-812800 DEBUG    Extensions all: ['Lora', 'sd-extension-chainner', 'sd-extension-system-info',
                         'sd-webui-agent-scheduler', 'sd-webui-controlnet', 'stable-diffusion-webui-images-browser',
                         'stable-diffusion-webui-rembg']
18:49:31-194799 DEBUG    Running extension installer: D:\Artificial
                         Intelligence\automatic\extensions-builtin\sd-extension-system-info\install.py
18:49:31-794800 DEBUG    Running extension installer: D:\Artificial
                         Intelligence\automatic\extensions-builtin\sd-webui-agent-scheduler\install.py
18:49:32-386801 DEBUG    Running extension installer: D:\Artificial
                         Intelligence\automatic\extensions-builtin\sd-webui-controlnet\install.py
18:49:32-996831 DEBUG    Running extension installer: D:\Artificial
                         Intelligence\automatic\extensions-builtin\stable-diffusion-webui-images-browser\install.py
18:49:33-588030 DEBUG    Running extension installer: D:\Artificial
                         Intelligence\automatic\extensions-builtin\stable-diffusion-webui-rembg\install.py
18:49:34-189145 DEBUG    Extensions all: []
18:49:34-191144 INFO     Extensions enabled: ['Lora', 'sd-extension-chainner', 'sd-extension-system-info',
                         'sd-webui-agent-scheduler', 'sd-webui-controlnet', 'stable-diffusion-webui-images-browser',
                         'stable-diffusion-webui-rembg']
18:49:34-196145 INFO     Verifying requirements
18:49:34-210145 DEBUG    Setup complete without errors: 1708771774
18:49:34-218145 DEBUG    Extension preload: {'extensions-builtin': 0.0, 'extensions': 0.0}
18:49:34-221145 DEBUG    Starting module: <module 'webui' from 'D:\\Artificial Intelligence\\automatic\\webui.py'>
18:49:34-224145 INFO     Command line args: ['--use-zluda', '--debug', '--autolaunch'] autolaunch=True use_zluda=True
                         debug=True
18:49:34-229145 DEBUG    Env flags: []
18:49:40-780034 DEBUG    Package not found: olive-ai
18:49:42-224854 INFO     Load packages: {'torch': '2.2.0+cu118', 'diffusers': '0.26.3', 'gradio': '3.43.2'}
18:49:43-346854 DEBUG    Read: file="config.json" json=33 bytes=1374 time=0.000
18:49:43-353854 INFO     Engine: backend=Backend.DIFFUSERS compute=cuda device=cuda attention="Scaled-Dot-Product"
                         mode=no_grad
18:49:43-391853 INFO     Device: device=AMD Radeon Pro VII [ZLUDA] n=2 arch=compute_37 cap=(8, 8) cuda=11.8 cudnn=8700
                         driver=
18:49:45-836804 DEBUG    ONNX: version=1.17.0 provider=CUDAExecutionProvider, available=['DmlExecutionProvider',
                         'CPUExecutionProvider']
18:49:45-978800 DEBUG    Importing LDM
18:49:46-006800 DEBUG    Entering start sequence
18:49:46-011317 DEBUG    Initializing
18:49:46-041317 INFO     Available VAEs: path="models\VAE" items=0
18:49:46-044317 INFO     Disabled extensions: ['sd-webui-controlnet']
18:49:46-047318 DEBUG    Scanning diffusers cache: ['models\\Diffusers'] items=0 time=0.00
18:49:46-050318 DEBUG    Read: file="cache.json" json=1 bytes=184 time=0.000
18:49:46-053317 DEBUG    Read: file="metadata.json" json=1 bytes=109 time=0.000
18:49:46-058317 INFO     Available models: path="models\Stable-diffusion" items=1 time=0.01
18:49:46-154317 DEBUG    Load extensions
18:49:46-215317 INFO     Extension: script='extensions-builtin\Lora\scripts\lora_script.py'
                         18:49:46-210316 INFO     LoRA networks: available=0
                         folders=2
18:49:46-852317 INFO     Extension: script='extensions-builtin\sd-webui-agent-scheduler\scripts\task_scheduler.py'
                         Using sqlite file: extensions-builtin\sd-webui-agent-scheduler\task_scheduler.sqlite3
18:49:47-204839 DEBUG    Extensions init time: 1.05 sd-webui-agent-scheduler=0.58
                         stable-diffusion-webui-images-browser=0.33
18:49:47-226840 DEBUG    Read: file="html/upscalers.json" json=4 bytes=2672 time=0.000
18:49:47-230839 DEBUG    Read: file="extensions-builtin\sd-extension-chainner\models.json" json=24 bytes=2719
                         time=0.000
18:49:47-236837 DEBUG    chaiNNer models: path="models\chaiNNer" defined=24 discovered=0 downloaded=0
18:49:47-242839 DEBUG    Load upscalers: total=52 downloaded=0 user=0 time=0.03 ['None', 'Lanczos', 'Nearest',
                         'ChaiNNer', 'ESRGAN', 'LDSR', 'RealESRGAN', 'SCUNet', 'SD', 'SwinIR']
18:49:47-267838 DEBUG    Load styles: folder="models\styles" items=288 time=0.02
18:49:47-275838 DEBUG    Creating UI
18:49:47-277839 INFO     UI theme: name="black-teal" style=Auto base=sdnext.css
18:49:47-288838 DEBUG    UI initialize: txt2img
18:49:47-303839 DEBUG    Read: file="html\reference.json" json=37 bytes=20003 time=0.001
18:49:47-324839 DEBUG    Extra networks: page='model' items=38 subfolders=2 tab=txt2img
                         folders=['models\\Stable-diffusion', 'models\\Diffusers', 'models\\Reference'] list=0.01
                         thumb=0.00 desc=0.00 info=0.00 workers=4
18:49:47-355839 DEBUG    Extra networks: page='style' items=288 subfolders=1 tab=txt2img folders=['models\\styles',
                         'html'] list=0.02 thumb=0.00 desc=0.00 info=0.00 workers=4
18:49:47-363838 DEBUG    Extra networks: page='embedding' items=0 subfolders=0 tab=txt2img
                         folders=['models\\embeddings'] list=0.00 thumb=0.00 desc=0.00 info=0.00 workers=4
18:49:47-369838 DEBUG    Extra networks: page='hypernetwork' items=0 subfolders=0 tab=txt2img
                         folders=['models\\hypernetworks'] list=0.00 thumb=0.00 desc=0.00 info=0.00 workers=4
18:49:47-379838 DEBUG    Extra networks: page='vae' items=0 subfolders=0 tab=txt2img folders=['models\\VAE'] list=0.00
                         thumb=0.00 desc=0.00 info=0.00 workers=4
18:49:47-385839 DEBUG    Extra networks: page='lora' items=0 subfolders=0 tab=txt2img folders=['models\\Lora',
                         'models\\LyCORIS'] list=0.00 thumb=0.00 desc=0.00 info=0.00 workers=4
18:49:47-477838 DEBUG    UI initialize: img2img
18:49:47-700354 DEBUG    UI initialize: control models=models\control
18:49:47-992353 DEBUG    Read: file="ui-config.json" json=0 bytes=2 time=0.000
18:49:48-096372 DEBUG    Themes: builtin=12 gradio=5 huggingface=0
18:49:48-978973 INFO     Extension list is empty: refresh required
18:49:49-784501 DEBUG    Extension list: processed=7 installed=7 enabled=6 disabled=1 visible=7 hidden=0
18:49:49-981707 DEBUG    Root paths: ['D:\\Artificial Intelligence\\automatic']
18:49:50-102709 INFO     Local URL: http://127.0.0.1:7860/
18:49:50-104710 DEBUG    Gradio functions: registered=2063
18:49:50-108710 DEBUG    FastAPI middleware: ['Middleware', 'Middleware']
18:49:50-113722 DEBUG    Creating API
18:49:50-320760 INFO     [AgentScheduler] Task queue is empty
18:49:50-322761 INFO     [AgentScheduler] Registering APIs
18:49:50-822759 DEBUG    Scripts setup: ['IP Adapters:0.017', 'AnimateDiff:0.01', 'Prompt Matrix:0.005', 'X/Y/Z
                         Grid:0.014', 'Face:0.016']
18:49:50-827760 DEBUG    Model metadata: file="metadata.json" no changes
18:49:50-831760 DEBUG    Model requested: fn=<lambda>
18:49:50-834760 INFO     Select: model="anything-v5-PrtRE [7f96a1a9ca]"
18:49:50-838759 DEBUG    Load model: existing=False target=D:\Artificial
                         Intelligence\automatic\models\Stable-diffusion\anything-v5-PrtRE.safetensors info=None
18:49:50-842760 INFO     Torch override dtype: no-half set
18:49:50-843759 INFO     Torch override VAE dtype: no-half set
18:49:50-845759 DEBUG    Desired Torch parameters: dtype=FP32 no-half=True no-half-vae=True upscast=False
18:49:50-849759 INFO     Setting Torch parameters: device=cuda dtype=torch.float32 vae=torch.float32 unet=torch.float32
                         context=no_grad fp16=None bf16=None optimization=Scaled-Dot-Product
18:49:50-853759 DEBUG    Diffusers loading: path="D:\Artificial
                         Intelligence\automatic\models\Stable-diffusion\anything-v5-PrtRE.safetensors"
18:49:50-856759 INFO     Autodetect: model="Stable Diffusion" class=StableDiffusionPipeline file="D:\Artificial
                         Intelligence\automatic\models\Stable-diffusion\anything-v5-PrtRE.safetensors" size=2034MB
18:49:53-921759 DEBUG    Setting model: pipeline=StableDiffusionPipeline config={'low_cpu_mem_usage': True,
                         'torch_dtype': torch.float32, 'load_connected_pipeline': True, 'extract_ema': True,
                         'use_safetensors': True}
18:49:53-928761 DEBUG    Setting model: enable VAE slicing
18:49:56-300117 INFO     Load embeddings: loaded=0 skipped=0 time=0.01
18:49:56-630175 DEBUG    GC: collected=5198 device=cuda {'ram': {'used': 1.96, 'total': 190.61}, 'gpu': {'used': 5.1,
                         'total': 15.98}, 'retries': 0, 'oom': 0} time=0.33
18:49:56-640175 INFO     Load model: time=5.46 load=5.46 native=512 {'ram': {'used': 1.96, 'total': 190.61}, 'gpu':
                         {'used': 5.1, 'total': 15.98}, 'retries': 0, 'oom': 0}
18:49:56-648175 DEBUG    Script callback init time: image_browser.py:ui_tabs=0.73 system-info.py:app_started=0.08
                         task_scheduler.py:app_started=0.52
18:49:56-650191 DEBUG    Save: file="config.json" json=33 bytes=1327 time=0.003
18:49:56-655175 INFO     Startup time: 22.41 torch=6.46 olive=0.09 gradio=1.44 libraries=3.75 extensions=1.05
                         face-restore=0.09 ui-en=0.32 ui-txt2img=0.06 ui-img2img=0.08 ui-control=0.11 ui-settings=0.25
                         ui-extensions=1.58 ui-defaults=0.10 launch=0.20 api=0.11 app-started=0.61 checkpoint=5.82
18:49:56-668175 INFO     Launching browser
18:49:59-929316 DEBUG    Server: alive=True jobs=1 requests=41 uptime=17 memory=1.1/190.61 backend=Backend.DIFFUSERS
                         state=idle
18:50:01-406316 INFO     MOTD: N/A
18:50:07-333316 DEBUG    Themes: builtin=12 gradio=5 huggingface=0
18:50:11-527316 INFO     Browser session: user=None client=127.0.0.1 agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64)
                         AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36 Edg/121.0.0.0
18:51:59-701777 DEBUG    Server: alive=True jobs=1 requests=170 uptime=137 memory=1.1/190.61 backend=Backend.DIFFUSERS
                         state=idle
18:52:46-226155 DEBUG    Diffuser pipeline: StableDiffusionPipeline task=DiffusersTaskType.TEXT_2_IMAGE
                         set={'prompt_embeds': torch.Size([1, 77, 768]), 'negative_prompt_embeds': torch.Size([1, 77,
                         768]), 'guidance_scale': 6, 'generator': device(type='cuda'), 'output_type': 'latent',
                         'num_inference_steps': 20, 'eta': 1.0, 'guidance_rescale': 0.7, 'width': 512, 'height': 512,
                         'parser': 'Full parser'}
Progress  2.62it/s █████████████▌                      40% 8/20 00:03 00:04 Base18:52:49-879799 DEBUG    VAE load: type=approximate model=models\VAE-approx\model.pt
Progress  2.57it/s █████████████████████████████████ 100% 20/20 00:07 00:00 Base
18:52:55-073212 INFO     Saving: image="outputs\text\00006-anything-v5-PrtRE-masterpiece long black hair girl blue eyes
                         high.jpg" type=JPEG resolution=512x512 size=0
18:52:55-081206 INFO     Processed: images=1 time=9.89 its=2.02 memory={'ram': {'used': 1.36, 'total': 190.61}, 'gpu':
                         {'used': 12.56, 'total': 15.98}, 'retries': 0, 'oom': 0}

Backend

Diffusers

Branch

Dev

Model

SD 1.5

Acknowledgements

  • [X] I have read the above and searched for existing issues
  • [X] I confirm that this is classified correctly and its not an extension issue

ENDlezZenith avatar Feb 24 '24 10:02 ENDlezZenith

We are trying to build necessary kernel binaries for gfx1010, gfx803, etc in our Discord. You can trace it and try to build for gfx906. Discord Thread

lshqqytiger avatar Feb 24 '24 11:02 lshqqytiger

We are trying to build necessary kernel binaries for gfx1010, gfx803, etc in our Discord. You can trace it and try to build for gfx906. Discord Thread

Thanks, I’ll try.

ENDlezZenith avatar Feb 24 '24 12:02 ENDlezZenith

closing the issue as wiki clearly states do-not-open-issues and reach out on discord instead.

vladmandic avatar Feb 24 '24 12:02 vladmandic

We are trying to build necessary kernel binaries for gfx1010, gfx803, etc in our Discord. You can trace it and try to build for gfx906. Discord Thread

Is there any reference material for this, I'd also like to try building my own binaries.He is gfx1010.

wongdi avatar Feb 24 '24 23:02 wongdi

We are trying to build necessary kernel binaries for gfx1010, gfx803, etc in our Discord. You can trace it and try to build for gfx906. Discord Thread

Is there any reference material for this, I'd also like to try building my own binaries.He is gfx1010.

Try ROCmLibs_Testing.zip library from https://github.com/brknsoul/ROCmLibs. This is aimed to support more gfx archs, like gfx1010 as you mentioned. And you can submit Issue in that repository or contact in discord if there are any problems.

ENDlezZenith avatar Feb 25 '24 05:02 ENDlezZenith

We are trying to build necessary kernel binaries for gfx1010, gfx803, etc in our Discord. You can trace it and try to build for gfx906. Discord Thread

Is there any reference material for this, I'd also like to try building my own binaries.He is gfx1010.

If you insists to build by yourself, here are two guides that may help: https://github.com/LostRuins/koboldcpp/issues/655 https://www.reddit.com/r/LocalLLaMA/comments/16d1hi0/guide_build_llamacpp_on_windows_with_amd_gpus_and/?rdt=59968

ENDlezZenith avatar Feb 25 '24 05:02 ENDlezZenith

We are trying to build necessary kernel binaries for gfx1010, gfx803, etc in our Discord. You can trace it and try to build for gfx906. Discord Thread

Is there any reference material for this, I'd also like to try building my own binaries.He is gfx1010.

If you insists to build by yourself, here are two guides that may help: LostRuins/koboldcpp#655 https://www.reddit.com/r/LocalLLaMA/comments/16d1hi0/guide_build_llamacpp_on_windows_with_amd_gpus_and/?rdt=59968

thk bro,I'm trying to use existing libs to work

wongdi avatar Feb 27 '24 14:02 wongdi