AUTOMATIC1111 / stable-diffusion-webui-tensorrt

MIT License
309 stars 20 forks source link

pycuda not installing properly #9

Open zaazii opened 1 year ago

zaazii commented 1 year ago

RuntimeError: Couldn't install pycuda. Command: "D:\sd2\stable-diffusion-webui\venv\Scripts\python.exe" -m pip install pycuda --prefer-binary Error code: 1 stdout: Collecting pycuda Downloading pycuda-2022.2.2.tar.gz (1.7 MB) ---------------------------------------- 1.7/1.7 MB 2.8 MB/s eta 0:00:00 Installing build dependencies: started Installing build dependencies: finished with status 'done' Getting requirements to build wheel: started Getting requirements to build wheel: finished with status 'done' Preparing metadata (pyproject.toml): started Preparing metadata (pyproject.toml): finished with status 'done' Collecting appdirs>=1.4.0 Downloading appdirs-1.4.4-py2.py3-none-any.whl (9.6 kB) Collecting mako Downloading Mako-1.2.4-py3-none-any.whl (78 kB) ---------------------------------------- 78.7/78.7 kB 1.5 MB/s eta 0:00:00 Collecting pytools>=2011.2 Downloading pytools-2014.2-py2.py3-none-any.whl (51 kB) ---------------------------------------- 51.7/51.7 kB ? eta 0:00:00 Collecting decorator>=3.2.0 Downloading decorator-5.1.1-py3-none-any.whl (9.1 kB) Requirement already satisfied: MarkupSafe>=0.9.2 in d:\sd2\stable-diffusion-webui\venv\lib\site-packages (from mako->pycuda) (2.1.2) Building wheels for collected packages: pycuda Building wheel for pycuda (pyproject.toml): started Building wheel for pycuda (pyproject.toml): finished with status 'error' Failed to build pycuda

stderr: error: subprocess-exited-with-error

Building wheel for pycuda (pyproject.toml) did not run successfully. exit code: 1

[133 lines of output]


*** I have detected that you have not run configure.py.


Additionally, no global config files were found. I will go ahead with the default configuration. *** In all likelihood, this will not work out.


*** See README_SETUP.txt for more information.


If the build does fail, just re-run configure.py with the correct arguments, and then retry. Good luck!


*** HIT Ctrl-C NOW IF THIS IS NOT WHAT YOU WANT


Continuing in 10 seconds... Continuing in 9 seconds... Continuing in 8 seconds... Continuing in 7 seconds... Continuing in 6 seconds... Continuing in 5 seconds... Continuing in 4 seconds... Continuing in 3 seconds... Continuing in 2 seconds... Continuing in 1 seconds... C:\Users\amout\AppData\Local\Temp\pip-build-env-soyi40\overlay\Lib\site-packages\setuptools_distutils\dist.py:265: UserWarning: Unknown distribution option: 'test_requires' warnings.warn(msg)

running bdist_wheel running build running build_py creating build creating build\lib.win-amd64-cpython-310 creating build\lib.win-amd64-cpython-310\pycuda copying pycuda\autoinit.py -> build\lib.win-amd64-cpython-310\pycuda copying pycuda\autoprimaryctx.py -> build\lib.win-amd64-cpython-310\pycuda copying pycuda\characterize.py -> build\lib.win-amd64-cpython-310\pycuda copying pycuda\compiler.py -> build\lib.win-amd64-cpython-310\pycuda copying pycuda\cumath.py -> build\lib.win-amd64-cpython-310\pycuda copying pycuda\curandom.py -> build\lib.win-amd64-cpython-310\pycuda copying pycuda\debug.py -> build\lib.win-amd64-cpython-310\pycuda copying pycuda\driver.py -> build\lib.win-amd64-cpython-310\pycuda copying pycuda\elementwise.py -> build\lib.win-amd64-cpython-310\pycuda copying pycuda\gpuarray.py -> build\lib.win-amd64-cpython-310\pycuda copying pycuda\reduction.py -> build\lib.win-amd64-cpython-310\pycuda copying pycuda\scan.py -> build\lib.win-amd64-cpython-310\pycuda copying pycuda\tools.py -> build\lib.win-amd64-cpython-310\pycuda copying pycuda_cluda.py -> build\lib.win-amd64-cpython-310\pycuda copying pycuda_mymako.py -> build\lib.win-amd64-cpython-310\pycuda copying pycuda__init.py -> build\lib.win-amd64-cpython-310\pycuda creating build\lib.win-amd64-cpython-310\pycuda\gl copying pycuda\gl\autoinit.py -> build\lib.win-amd64-cpython-310\pycuda\gl copying pycuda\gl__init__.py -> build\lib.win-amd64-cpython-310\pycuda\gl creating build\lib.win-amd64-cpython-310\pycuda\sparse copying pycuda\sparse\cg.py -> build\lib.win-amd64-cpython-310\pycuda\sparse copying pycuda\sparse\coordinate.py -> build\lib.win-amd64-cpython-310\pycuda\sparse copying pycuda\sparse\inner.py -> build\lib.win-amd64-cpython-310\pycuda\sparse copying pycuda\sparse\operator.py -> build\lib.win-amd64-cpython-310\pycuda\sparse copying pycuda\sparse\packeted.py -> build\lib.win-amd64-cpython-310\pycuda\sparse copying pycuda\sparse\pkt_build.py -> build\lib.win-amd64-cpython-310\pycuda\sparse copying pycuda\sparse\init.py -> build\lib.win-amd64-cpython-310\pycuda\sparse creating build\lib.win-amd64-cpython-310\pycuda\compyte copying pycuda\compyte\array.py -> build\lib.win-amd64-cpython-310\pycuda\compyte copying pycuda\compyte\dtypes.py -> build\lib.win-amd64-cpython-310\pycuda\compyte copying pycuda\compyte\init__.py -> build\lib.win-amd64-cpython-310\pycuda\compyte running egg_info writing pycuda.egg-info\PKG-INFO writing dependency_links to pycuda.egg-info\dependency_links.txt writing requirements to pycuda.egg-info\requires.txt writing top-level names to pycuda.egg-info\top_level.txt reading manifest file 'pycuda.egg-info\SOURCES.txt' reading manifest template 'MANIFEST.in' warning: no files found matching 'doc\source*.rst' warning: no files found matching 'doc\source\conf.py' warning: no files found matching 'doc\source_static*.css' warning: no files found matching 'doc\source_templates*.html' warning: no files found matching '.cpp' under directory 'bpl-subset\bpl_subset\boost' warning: no files found matching '.html' under directory 'bpl-subset\bpl_subset\boost' warning: no files found matching '.inl' under directory 'bpl-subset\bpl_subset\boost' warning: no files found matching '.txt' under directory 'bpl-subset\bpl_subset\boost' warning: no files found matching '.h' under directory 'bpl-subset\bpl_subset\libs' warning: no files found matching '.ipp' under directory 'bpl-subset\bpl_subset\libs' warning: no files found matching '*.pl' under directory 'bpl-subset\bpl_subset\libs' adding license file 'LICENSE' writing manifest file 'pycuda.egg-info\SOURCES.txt' C:\Users\amout\AppData\Local\Temp\pip-build-env-soyi40\overlay\Lib\site-packages\setuptools\command\build_py.py:201: _Warning: Package 'pycuda.cuda' is absent from the packages configuration. !!

      ********************************************************************************
      ############################
      # Package would be ignored #
      ############################
      Python recognizes 'pycuda.cuda' as an importable package[^1],
      but it is absent from setuptools' `packages` configuration.

      This leads to an ambiguous overall configuration. If you want to distribute this
      package, please make sure that 'pycuda.cuda' is explicitly added
      to the `packages` configuration field.

      Alternatively, you can also rely on setuptools' discovery methods
      (for example by using `find_namespace_packages(...)`/`find_namespace:`
      instead of `find_packages(...)`/`find:`).

      You can read more about "package discovery" on setuptools documentation page:

      - https://setuptools.pypa.io/en/latest/userguide/package_discovery.html

      If you don't want 'pycuda.cuda' to be distributed and are
      already explicitly excluding 'pycuda.cuda' via
      `find_namespace_packages(...)/find_namespace` or `find_packages(...)/find`,
      you can try to use `exclude_package_data`, or `include-package-data=False` in
      combination with a more fine grained `package-data` configuration.

      You can read more about "package data files" on setuptools documentation page:

      - https://setuptools.pypa.io/en/latest/userguide/datafiles.html

      [^1]: For Python, any directory (with suitable naming) can be imported,
            even if it does not contain any `.py` files.
            On the other hand, currently there is no concept of package data
            directory, all directories are treated like packages.
      ********************************************************************************

!! check.warn(importable) creating build\lib.win-amd64-cpython-310\pycuda\cuda copying pycuda\cuda\pycuda-complex-impl.hpp -> build\lib.win-amd64-cpython-310\pycuda\cuda copying pycuda\cuda\pycuda-complex.hpp -> build\lib.win-amd64-cpython-310\pycuda\cuda copying pycuda\cuda\pycuda-helpers.hpp -> build\lib.win-amd64-cpython-310\pycuda\cuda copying pycuda\sparse\pkt_build_cython.pyx -> build\lib.win-amd64-cpython-310\pycuda\sparse running build_ext building '_driver' extension error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/ [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for pycuda ERROR: Could not build wheels for pycuda, which is required to install pyproject.toml-based projects

[notice] A new release of pip available: 22.3.1 -> 23.1.2 [notice] To update, run: D:\sd2\stable-diffusion-webui\venv\Scripts\python.exe -m pip install --upgrade pip

Launching Web UI with arguments: --xformers --no-half-vae Error loading script: trt.py Traceback (most recent call last): File "D:\sd2\stable-diffusion-webui\modules\scripts.py", line 256, in load_scripts script_module = script_loading.load_module(scriptfile.path) File "D:\sd2\stable-diffusion-webui\modules\script_loading.py", line 11, in load_module module_spec.loader.exec_module(module) File "", line 883, in exec_module File "", line 241, in _call_with_frames_removed File "D:\sd2\stable-diffusion-webui\extensions\stable-diffusion-webui-tensorrt\scripts\trt.py", line 6, in from modules import script_callbacks, sd_unet, devices, shared, paths_internal ImportError: cannot import name 'sd_unet' from 'modules' (unknown location)

JilekJosef commented 1 year ago

May be similar to this #7 try installing https://visualstudio.microsoft.com/cs/visual-cpp-build-tools/

zaazii commented 1 year ago

May be similar to this #7 try installing https://visualstudio.microsoft.com/cs/visual-cpp-build-tools/

Thank. No error message anymore but the TensorRT tab isn't appearing.

Adolfiux commented 1 year ago

May be similar to this #7 try installing https://visualstudio.microsoft.com/cs/visual-cpp-build-tools/

Thank. No error message anymore but the TensorRT tab isn't appearing.

Could you tell me which version of PyCuda you have installed in your Python environment?

zaazii commented 1 year ago

Could you tell me which version of PyCuda you have installed in your Python environment?

Sorry my mistake there's actually the following error:

Launching Web UI with arguments: --xformers --no-half-vae Error loading script: trt.py Traceback (most recent call last): File "D:\sd2\stable-diffusion-webui\modules\scripts.py", line 256, in load_scripts script_module = script_loading.load_module(scriptfile.path) File "D:\sd2\stable-diffusion-webui\modules\script_loading.py", line 11, in load_module module_spec.loader.exec_module(module) File "", line 883, in exec_module File "", line 241, in _call_with_frames_removed File "D:\sd2\stable-diffusion-webui\extensions\stable-diffusion-webui-tensorrt\scripts\trt.py", line 6, in from modules import script_callbacks, sd_unet, devices, shared, paths_internal ImportError: cannot import name 'sd_unet' from 'modules' (unknown location)

JilekJosef commented 1 year ago

Seems like old version of webui considering you still use Xformers, you need to upgrade to dev channel to use this