stable-diffusion-webui-amdgpu icon indicating copy to clipboard operation
stable-diffusion-webui-amdgpu copied to clipboard

[Bug]: error with "torch_directml_native.dll"

Open Schiwi17 opened this issue 5 months ago • 1 comments

Checklist

  • [ ] The issue exists after disabling all extensions
  • [x] 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?

when i try to run WebUI DirectML, i get the following (my pc is in spanish but most of it is understandable)

Python 3.10.6 (tags/v3.10.6:9c7b4bd, Aug 1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)] Version: v1.10.1-amd-39-g6d85a7df Commit hash: 6d85a7dfa4977ae4eece9cbbab4725123833be14 WARNING: you should not skip torch test unless you want CPU to work. D:\StableDiffusion\stable-diffusion-webui-directml\venv\lib\site-packages\timm\models\layers_init_.py:48: FutureWarning: Importing from timm.models.layers is deprecated, please import via timm.layers warnings.warn(f"Importing from {name} is deprecated, please import via timm.layers", FutureWarning) no module 'xformers'. Processing without... no module 'xformers'. Processing without... No module 'xformers'. Proceeding without it. D:\StableDiffusion\stable-diffusion-webui-directml\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-directml --skip-torch-cuda-test --no-half --precision full --lowvram DirectML initialization failed: DLL load failed while importing torch_directml_native: No se encontró el proceso especificado. Traceback (most recent call last): File "D:\StableDiffusion\stable-diffusion-webui-directml\launch.py", line 48, in main() File "D:\StableDiffusion\stable-diffusion-webui-directml\launch.py", line 44, in main start() File "D:\StableDiffusion\stable-diffusion-webui-directml\modules\launch_utils.py", line 714, in start import webui File "D:\StableDiffusion\stable-diffusion-webui-directml\webui.py", line 13, in initialize.imports() File "D:\StableDiffusion\stable-diffusion-webui-directml\modules\initialize.py", line 36, in imports shared_init.initialize() File "D:\StableDiffusion\stable-diffusion-webui-directml\modules\shared_init.py", line 30, in initialize directml_do_hijack() File "D:\StableDiffusion\stable-diffusion-webui-directml\modules\dml_init_.py", line 83, in directml_do_hijack set_memory_provider() File "D:\StableDiffusion\stable-diffusion-webui-directml\modules\dml_init.py", line 18, in set_memory_provider from .backend import pdh_mem_get_info File "D:\StableDiffusion\stable-diffusion-webui-directml\modules\dml\backend.py", line 4, in import torch_directml # pylint: disable=import-error File "D:\StableDiffusion\stable-diffusion-webui-directml\venv\lib\site-packages\torch_directml_init.py", line 21, in import torch_directml_native ImportError: DLL load failed while importing torch_directml_native: No se encontró el proceso especificado.

i know that this issue has been solved and answered, but i can't find the link for the issue ticket, so if anyone knows it, point me there. i'm new to all of this and barely understand anything, i was just following an online tutorial without really knowing what i was doing. many thanks in advance

Steps to reproduce the problem

run webui-user.bat

What should have happened?

the WebUI page should have opened on my browser

What browsers do you use to access the UI ?

Google Chrome

Sysinfo

i can't find it, i have no idea, sorry

Console logs

Python 3.10.6 (tags/v3.10.6:9c7b4bd, Aug  1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)]
Version: v1.10.1-amd-39-g6d85a7df
Commit hash: 6d85a7dfa4977ae4eece9cbbab4725123833be14
WARNING: you should not skip torch test unless you want CPU to work.
D:\StableDiffusion\stable-diffusion-webui-directml\venv\lib\site-packages\timm\models\layers\__init__.py:48: FutureWarning: Importing from timm.models.layers is deprecated, please import via timm.layers
  warnings.warn(f"Importing from {__name__} is deprecated, please import via timm.layers", FutureWarning)
no module 'xformers'. Processing without...
no module 'xformers'. Processing without...
No module 'xformers'. Proceeding without it.
D:\StableDiffusion\stable-diffusion-webui-directml\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-directml --skip-torch-cuda-test --no-half --precision full --lowvram
DirectML initialization failed: DLL load failed while importing torch_directml_native: No se encontró el proceso especificado.
Traceback (most recent call last):
  File "D:\StableDiffusion\stable-diffusion-webui-directml\launch.py", line 48, in <module>
    main()
  File "D:\StableDiffusion\stable-diffusion-webui-directml\launch.py", line 44, in main
    start()
  File "D:\StableDiffusion\stable-diffusion-webui-directml\modules\launch_utils.py", line 714, in start
    import webui
  File "D:\StableDiffusion\stable-diffusion-webui-directml\webui.py", line 13, in <module>
    initialize.imports()
  File "D:\StableDiffusion\stable-diffusion-webui-directml\modules\initialize.py", line 36, in imports
    shared_init.initialize()
  File "D:\StableDiffusion\stable-diffusion-webui-directml\modules\shared_init.py", line 30, in initialize
    directml_do_hijack()
  File "D:\StableDiffusion\stable-diffusion-webui-directml\modules\dml\__init__.py", line 83, in directml_do_hijack
    _set_memory_provider()
  File "D:\StableDiffusion\stable-diffusion-webui-directml\modules\dml\__init__.py", line 18, in _set_memory_provider
    from .backend import pdh_mem_get_info
  File "D:\StableDiffusion\stable-diffusion-webui-directml\modules\dml\backend.py", line 4, in <module>
    import torch_directml # pylint: disable=import-error
  File "D:\StableDiffusion\stable-diffusion-webui-directml\venv\lib\site-packages\torch_directml\__init__.py", line 21, in <module>
    import torch_directml_native
ImportError: DLL load failed while importing torch_directml_native: No se encontró el proceso especificado.

Additional information

No response

Schiwi17 avatar Jul 16 '25 22:07 Schiwi17

Hey, whats your GPU? DirectML is not that recommended to use unless you have a very old GPU. Better use ZLUDA as backend. If you still want to get DirectML to work, first remove --skip-torch-cuda-test --no-half --precision-full --lowvram from the webui-user.bat Instead add these --medvram --opt-sub-quad-attention --opt-split-attention --no-half-vae --upcast-sampling Then save and close the file. Delete the venv folder before relaunching the webui-user.bat

Let me know if it worked.

If you want to setup the Webui with ZLUDA, follow my Setup Guide here: https://github.com/CS1o/Stable-Diffusion-Info/wiki/Webui-Installation-Guides

CS1o avatar Jul 23 '25 20:07 CS1o