Skip to content

[Issue]: AMD GPU is not being utilized, although ZLUDA loads successfully #3918

Closed
@Kolopsel

Description

@Kolopsel

Issue Description

I'm unfortunately having a bit of a problem trying to get the newest version of SDNext running on my AMD GPU utilizing ZLUDA. The following output log is from a fresh SDNext installation (dev-branch) on Windows 11 with the newest AMD display drivers (25.5.1) and ROCM 6.2 (HIP-SDK) installed.

I tried all of this on the master branch of SDNext aswell, but unfortunately got the exact same result. During my first boot of SDNext I used the following startup-arguments "--use-zluda --use-nightly --debug".

17:36:06-588150 INFO     Starting SD.Next
17:36:06-588150 INFO     Logger: file="C:\Users\User\Desktop\SDNext\sdnext-dev\sdnext\sdnext.log" level=DEBUG host="DESKTOP-9PQ20S2" size=83 mode=create
17:36:06-588150 INFO     Python: version=3.11.9 platform=Windows bin="C:\Users\User\Desktop\SDNext\sdnext-dev\sdnext\venv\Scripts\python.exe"
                         venv="C:\Users\User\Desktop\SDNext\sdnext-dev\sdnext\venv"
17:36:06-721881 INFO     Version: app=sd.next updated=2025-05-08 hash=55b1cb8c branch=dev url=https://github.com/vladmandic/sdnext.git/tree/dev ui=main
17:36:06-721881 DEBUG    Branch mismatch: sdnext=dev ui=main
17:36:06-876008 DEBUG    Branch sync failed: sdnext=dev ui=dev
17:36:07-557417 INFO     Version: check latest available hash=9141e060 updated=2025-05-06T18:17:05Z
17:36:07-568105 INFO     Platform: arch=AMD64 cpu=AMD64 Family 25 Model 97 Stepping 2, AuthenticAMD system=Windows release=Windows-10-10.0.26100-SP0 python=3.11.9 locale=('English_Germany',
                         '1252') docker=False
17:36:07-568105 DEBUG    Packages: prefix=venv site=['venv', 'venv\\Lib\\site-packages']
17:36:07-568105 WARNING  Packages: site="venv\Lib\site-packages" invalid=['~umpy', '~umpy.libs'] removing
17:36:07-586254 INFO     Args: ['--use-zluda', '--use-nightly', '--debug']
17:36:07-586254 DEBUG    Setting environment tuning
17:36:07-586254 DEBUG    Torch allocator: "garbage_collection_threshold:0.80,max_split_size_mb:512"
17:36:07-596247 DEBUG    Torch overrides: cuda=False rocm=False ipex=False directml=False openvino=False zluda=True
17:36:07-616162 INFO     ROCm: AMD toolkit detected
17:36:08-276185 INFO     ROCm: agents=['gfx1100', 'gfx1036']
17:36:08-276185 INFO     ROCm: version=6.2, using agent gfx1100
17:36:08-276185 INFO     Python: version=3.11.9 platform=Windows bin="C:\Users\User\Desktop\SDNext\sdnext-dev\sdnext\venv\Scripts\python.exe"
                         venv="C:\Users\User\Desktop\SDNext\sdnext-dev\sdnext\venv"
17:36:08-288268 INFO     ZLUDA load: path='C:\Users\User\Desktop\SDNext\sdnext-dev\sdnext\.zluda' nightly=True
17:36:10-183246 INFO     Diffusers update: package=diffusers 0.34.0.dev0 current= target=8c661ea586bf11cb2440da740dd3c4cf84679b85
17:36:36-647650 INFO     Install: verifying requirements
17:36:36-686731 DEBUG    Timestamp repository update time: Thu May  8 16:14:15 2025
17:36:36-689482 INFO     Startup: standard
17:36:36-689482 INFO     Verifying submodules
17:36:38-440967 DEBUG    Git submodule: extensions-builtin/sd-extension-chainner / main
17:36:38-506486 DEBUG    Git submodule: extensions-builtin/sd-extension-system-info / main
17:36:38-566676 DEBUG    Git submodule: extensions-builtin/sd-webui-agent-scheduler / main
17:36:38-623246 DEBUG    Git submodule: extensions-builtin/sdnext-modernui / dev
17:36:38-682587 DEBUG    Git submodule: extensions-builtin/stable-diffusion-webui-rembg / master
17:36:38-740609 DEBUG    Git submodule: modules/k-diffusion / master
17:36:38-800487 DEBUG    Git submodule: wiki / master
17:36:38-838614 DEBUG    Register paths
17:36:38-886689 DEBUG    Installed packages: 160
17:36:38-888703 DEBUG    Extensions all: ['Lora', 'sd-extension-chainner', 'sd-extension-system-info', 'sd-webui-agent-scheduler', 'sdnext-modernui', 'stable-diffusion-webui-rembg']
17:36:39-018203 DEBUG    Extension installer: builtin=True file="C:\Users\User\Desktop\SDNext\sdnext-dev\sdnext\extensions-builtin\sd-webui-agent-scheduler\install.py"
17:36:39-118608 DEBUG    Extension installer: builtin=True file="C:\Users\User\Desktop\SDNext\sdnext-dev\sdnext\extensions-builtin\stable-diffusion-webui-rembg\install.py"
17:36:39-169439 DEBUG    Extensions all: []
17:36:39-170443 INFO     Extensions enabled: ['Lora', 'sd-extension-chainner', 'sd-extension-system-info', 'sd-webui-agent-scheduler', 'sdnext-modernui', 'stable-diffusion-webui-rembg']
17:36:39-170443 INFO     Install: verifying requirements
17:36:39-171957 DEBUG    Setup complete without errors: 1746718599
17:36:39-179981 DEBUG    Extension preload: {'extensions-builtin': 0.0, 'extensions': 0.0}
17:36:39-179981 INFO     Installer time: total=62.94 pip=26.36 diffusers=26.36 torch=2.60 git=2.29 submodules=2.15 latest=0.96 amd=0.70 branch=0.42 version=0.24 base=0.18 ui=0.15
                         sd-webui-agent-scheduler=0.06 files=0.06 requirements=0.05 installed=0.05 stable-diffusion-webui-rembg=0.05
17:36:39-184089 INFO     Command line args: ['--use-zluda', '--use-nightly', '--debug'] use_nightly=True use_zluda=True debug=True args=[]
17:36:39-184089 DEBUG    Env flags: []
17:36:39-186610 DEBUG    Starting module: <module 'webui' from 'C:\\Users\\User\\Desktop\\SDNext\\sdnext-dev\\sdnext\\webui.py'>
17:36:57-090553 INFO     Torch: torch==2.6.0+cu118 torchvision==0.21.0+cu118
17:36:57-097165 INFO     Packages: diffusers==0.34.0.dev0 transformers==4.51.3 accelerate==1.6.0 gradio==3.43.2 pydantic==1.10.21
17:36:58-767012 DEBUG    ONNX: version=1.21.1, available=['AzureExecutionProvider', 'CPUExecutionProvider']
17:36:59-525761 DEBUG    Settings: fn="C:\Users\User\Desktop\SDNext\sdnext-dev\sdnext\config.json" created
17:36:59-526766 INFO     Engine: backend=Backend.DIFFUSERS compute=cpu device=cpu attention="Scaled-Dot-Product" mode=no_grad
17:36:59-526766 DEBUG    Save: file="C:\Users\User\Desktop\SDNext\sdnext-dev\sdnext\config.json" json=0 bytes=2 time=0.000
17:36:59-530097 DEBUG    Read: file="html\reference.json" json=77 bytes=39555 time=0.003 fn=_call_with_frames_removed:<module>
17:36:59-530097 DEBUG    Torch attention: type="sdpa" flash=True memory=True math=True
17:36:59-536777 INFO     Torch parameters: backend=cpu device=cpu config=Auto dtype=torch.bfloat16 context=no_grad nohalf=False nohalfvae=False upcast=False deterministic=False
                         tunable=[False, True] fp16=pass bf16=pass optimization="Scaled-Dot-Product"
17:36:59-538522 INFO     Device:
17:37:00-582999 DEBUG    Entering start sequence

First thing I noticed was ROCM detected both my 7900 XT and my integrated graphics card, as you can see in these lines:

17:36:07-616162 INFO ROCm: AMD toolkit detected 17:36:08-276185 INFO ROCm: agents=['gfx1100', 'gfx1036'] 17:36:08-276185 INFO ROCm: version=6.2, using agent gfx1100

however here:

17:36:59-526766 INFO Engine: backend=Backend.DIFFUSERS compute=cpu device=cpu attention="Scaled-Dot-Product" mode=no_grad

and in the line right before the end:

17:36:59-538522 INFO Device:

I can see that SDNext is not able to utilize my GPU and falls back to the CPU. I'm unfortunately not really sure what the problem here seems to be - I saw a couple of threads with ZLUDA failing to load, causing SDNext to utilize the CPU instead, but my problem seems to be a little different.

This is a screenshot of my "System Info" tab, which again shows SDNext utilizing my CPU instead:

Image

I really appreciate any help in solving this issue. Thank you!

If more information is needed, I would be happy to supply it.

Version Platform Description

Windows 11, Python 3.11.9, ROCM 6.2, SDNext 55b1cb8 (dev-branch)

Relevant log output

Backend

Diffusers

Compute

ZLUDA

UI

Standard

Branch

Dev

Model

Other

Acknowledgements

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    platformPlatform specific problem

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions