kohya-ss / sd-scripts

Apache License 2.0
4.95k stars 828 forks source link

Error loading fbgemm.dll #1597

Open AndreR opened 4 days ago

AndreR commented 4 days ago

Seems like I'm having a similar issue as in #1557. When I run gui.bat, I get the following error.

PS P:\AI\kohya_ss> .\gui.bat
02:54:15-632812 INFO     Kohya_ss GUI version: v24.2.0

02:54:16-474771 INFO     Submodule initialized and updated.
02:54:16-476773 INFO     nVidia toolkit detected
02:54:18-197331 ERROR    Could not load torch: [WinError 126] Das angegebene Modul wurde nicht gefunden. Error loading
                         "P:\AI\kohya_ss\venv\lib\site-packages\torch\lib\fbgemm.dll" or one of its dependencies.

This happens since I updated to the Flux compatible branch. It worked with the standard version.


PS: Setup gives me a similar error:

  DEPRECATION: Legacy editable install of library==0.0.0 from file:///P:/AI/kohya_ss/sd-scripts (from -r requirements.txt (line 38)) (setup.py develop) is deprecated. pip 25.0 will enforce this behaviour change. A possible replacement is to add a pyproject.toml or enable --use-pep517, and use setuptools >= 64. If the resulting installation is not behaving as expected, try using --config-settings editable_mode=compat. Please consult the setuptools documentation for more information. Discussion can be found at https://github.com/pypa/pip/issues/11457
  Running setup.py develop for library
Successfully installed library
03:06:09-592874 INFO     Requirements from requirements_windows.txt installed.
Traceback (most recent call last):
  File "C:\Program Files\Python310\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Program Files\Python310\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "P:\AI\kohya_ss\venv\Scripts\accelerate.exe\__main__.py", line 4, in <module>
  File "P:\AI\kohya_ss\venv\lib\site-packages\accelerate\__init__.py", line 16, in <module>
    from .accelerator import Accelerator
  File "P:\AI\kohya_ss\venv\lib\site-packages\accelerate\accelerator.py", line 32, in <module>
    import torch
  File "P:\AI\kohya_ss\venv\lib\site-packages\torch\__init__.py", line 148, in <module>
    raise err
OSError: [WinError 126] Das angegebene Modul wurde nicht gefunden. Error loading "P:\AI\kohya_ss\venv\lib\site-packages\torch\lib\fbgemm.dll" or one of its dependencies.
AndreR commented 4 days ago

I actually found the solution myself. fbgemm.dll seems to require _libomp140.x8664.dll, and that one was removed from the Windows 11 C++ redistributables, as it seems. According to this post, I had to use the Visual Studio installer to add the MSVC v143 – VS 2022 C++ – x64/x86 build tools (latest) package. Now, the missing DLL has suddenly appeared in my system32 folder.

The problem appeared after updating torch. Torch 2.3 and early don't require this DLL.