AUTOMATIC1111 / stable-diffusion-webui-tensorrt

MIT License
313 stars 21 forks source link

Failed to build pycuda #11

Closed Kaiten10 closed 1 year ago

Kaiten10 commented 1 year ago

This error occurs when starting SD with this extension and it's building the pycuda wheel. I've tried uninstalling and reinstalling VS Build Tools 2022, but it still comes up with th error below.

I notice this line is repeated many times: "Unknown compiler version - please run the configure tests and report the results"

Both master and dev branches give this error. Thanks in advance for any help.

Log (shortened repeated lines during build):

venv "E:\ProgramsE\stable-diffusion-webui-dev\venv\Scripts\Python.exe"
Python 3.10.8 (tags/v3.10.8:aaaf517, Oct 11 2022, 16:50:30) [MSC v.1933 64 bit (AMD64)]
Version: v1.3.0-72-gb957dcfe
Commit hash: b957dcfece29c84ac0cfcd5a69475ff8684c531f
Installing requirements
Error running install.py for extension E:\ProgramsE\stable-diffusion-webui-dev\extensions\stable-diffusion-webui-tensorrt.
Command: "E:\ProgramsE\stable-diffusion-webui-dev\venv\Scripts\python.exe" "E:\ProgramsE\stable-diffusion-webui-dev\extensions\stable-diffusion-webui-tensorrt\install.py"
Error code: 1
stdout: Installing TensorRT wheel
Installing pycuda

stderr: Traceback (most recent call last):
  File "E:\ProgramsE\stable-diffusion-webui-dev\extensions\stable-diffusion-webui-tensorrt\install.py", line 30, in <module>
    install()
  File "E:\ProgramsE\stable-diffusion-webui-dev\extensions\stable-diffusion-webui-tensorrt\install.py", line 23, in install
    launch.run_pip(f'install pycuda', "pycuda")
  File "E:\ProgramsE\stable-diffusion-webui-dev\modules\launch_utils.py", line 124, in run_pip
    return run(f'"{python}" -m pip {command} --prefer-binary{index_url_line}', desc=f"Installing {desc}", errdesc=f"Couldn't install {desc}", live=live)
  File "E:\ProgramsE\stable-diffusion-webui-dev\modules\launch_utils.py", line 101, in run
    raise RuntimeError("\n".join(error_bits))
RuntimeError: Couldn't install pycuda.
Command: "E:\ProgramsE\stable-diffusion-webui-dev\venv\Scripts\python.exe" -m pip install pycuda --prefer-binary
Error code: 1
stdout: Collecting pycuda
  Using cached pycuda-2022.2.2.tar.gz (1.7 MB)
  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
  Using cached appdirs-1.4.4-py2.py3-none-any.whl (9.6 kB)
Collecting mako
  Using cached Mako-1.2.4-py3-none-any.whl (78 kB)
Collecting pytools>=2011.2
  Using cached pytools-2014.2-py2.py3-none-any.whl (51 kB)
Collecting decorator>=3.2.0
  Using cached decorator-5.1.1-py3-none-any.whl (9.1 kB)
Requirement already satisfied: MarkupSafe>=0.9.2 in e:\programse\stable-diffusion-webui-dev\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

  [376 lines of output]
  ***************************************************************
  *** WARNING: nvcc not in path.
  *** May need to set CUDA_INC_DIR for installation to succeed.
  ***************************************************************
  *************************************************************
  *** 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\abah\AppData\Local\Temp\pip-build-env-f48dhjs1\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\abah\AppData\Local\Temp\pip-build-env-f48dhjs1\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
  creating build\temp.win-amd64-cpython-310
  creating build\temp.win-amd64-cpython-310\Release
  creating build\temp.win-amd64-cpython-310\Release\bpl-subset
  creating build\temp.win-amd64-cpython-310\Release\bpl-subset\bpl_subset
  creating build\temp.win-amd64-cpython-310\Release\bpl-subset\bpl_subset\libs
  creating build\temp.win-amd64-cpython-310\Release\bpl-subset\bpl_subset\libs\python
  creating build\temp.win-amd64-cpython-310\Release\bpl-subset\bpl_subset\libs\python\src
  creating build\temp.win-amd64-cpython-310\Release\bpl-subset\bpl_subset\libs\python\src\converter
  creating build\temp.win-amd64-cpython-310\Release\bpl-subset\bpl_subset\libs\python\src\object
  creating build\temp.win-amd64-cpython-310\Release\bpl-subset\bpl_subset\libs\smart_ptr
  creating build\temp.win-amd64-cpython-310\Release\bpl-subset\bpl_subset\libs\smart_ptr\src
  creating build\temp.win-amd64-cpython-310\Release\bpl-subset\bpl_subset\libs\system
  creating build\temp.win-amd64-cpython-310\Release\bpl-subset\bpl_subset\libs\system\src
  creating build\temp.win-amd64-cpython-310\Release\bpl-subset\bpl_subset\libs\thread
  creating build\temp.win-amd64-cpython-310\Release\bpl-subset\bpl_subset\libs\thread\src
  creating build\temp.win-amd64-cpython-310\Release\bpl-subset\bpl_subset\libs\thread\src\win32
  creating build\temp.win-amd64-cpython-310\Release\src
  creating build\temp.win-amd64-cpython-310\Release\src\cpp
  creating build\temp.win-amd64-cpython-310\Release\src\wrapper
  "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.36.32532\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -DBOOST_ALL_NO_LIB=1 -DBOOST_THREAD_BUILD_DLL=1 -DBOOST_MULTI_INDEX_DISABLE_SERIALIZATION=1 -DBOOST_PYTHON_SOURCE=1 -Dboost=pycudaboost -DBOOST_THREAD_DONT_USE_CHRONO=1 -DPYGPU_PACKAGE=pycuda -DPYGPU_PYCUDA=1 -DHAVE_CURAND=1 -Isrc/cpp -Ibpl-subset/bpl_subset -IC:\Users\abah\AppData\Local\Temp\pip-build-env-f48dhjs1\overlay\Lib\site-packages\numpy\core\include -IE:\ProgramsE\stable-diffusion-webui-dev\venv\include -IC:\Users\abah\AppData\Local\Programs\Python\Python310\include -IC:\Users\abah\AppData\Local\Programs\Python\Python310\Include "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.36.32532\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.36.32532\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\VS\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22000.0\\um" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22000.0\\shared" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22000.0\\winrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22000.0\\cppwinrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" /EHsc /Tpbpl-subset/bpl_subset/libs/python/src/converter/arg_to_python_base.cpp /Fobuild\temp.win-amd64-cpython-310\Release\bpl-subset/bpl_subset/libs/python/src/converter/arg_to_python_base.obj /EHsc
  arg_to_python_base.cpp
  Unknown compiler version - please run the configure tests and report the results
  "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.36.32532\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -DBOOST_ALL_NO_LIB=1 -DBOOST_THREAD_BUILD_DLL=1 -DBOOST_MULTI_INDEX_DISABLE_SERIALIZATION=1 -DBOOST_PYTHON_SOURCE=1 -Dboost=pycudaboost -DBOOST_THREAD_DONT_USE_CHRONO=1 -DPYGPU_PACKAGE=pycuda -DPYGPU_PYCUDA=1 -DHAVE_CURAND=1 -Isrc/cpp -Ibpl-subset/bpl_subset -IC:\Users\abah\AppData\Local\Temp\pip-build-env-f48dhjs1\overlay\Lib\site-packages\numpy\core\include -IE:\ProgramsE\stable-diffusion-webui-dev\venv\include -IC:\Users\abah\AppData\Local\Programs\Python\Python310\include -IC:\Users\abah\AppData\Local\Programs\Python\Python310\Include "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.36.32532\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.36.32532\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\VS\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22000.0\\um" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22000.0\\shared" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22000.0\\winrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22000.0\\cppwinrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" /EHsc /Tpbpl-subset/bpl_subset/libs/thread/src/tss_null.cpp /Fobuild\temp.win-amd64-cpython-310\Release\bpl-subset/bpl_subset/libs/thread/src/tss_null.obj /EHsc
  tss_null.cpp
  Unknown compiler version - please run the configure tests and report the results
  "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.36.32532\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -DBOOST_ALL_NO_LIB=1 -DBOOST_THREAD_BUILD_DLL=1 -DBOOST_MULTI_INDEX_DISABLE_SERIALIZATION=1 -DBOOST_PYTHON_SOURCE=1 -Dboost=pycudaboost -DBOOST_THREAD_DONT_USE_CHRONO=1 -DPYGPU_PACKAGE=pycuda -DPYGPU_PYCUDA=1 -DHAVE_CURAND=1 -Isrc/cpp -Ibpl-subset/bpl_subset -IC:\Users\abah\AppData\Local\Temp\pip-build-env-f48dhjs1\overlay\Lib\site-packages\numpy\core\include -IE:\ProgramsE\stable-diffusion-webui-dev\venv\include -IC:\Users\abah\AppData\Local\Programs\Python\Python310\include -IC:\Users\abah\AppData\Local\Programs\Python\Python310\Include "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.36.32532\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.36.32532\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\VS\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22000.0\\um" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22000.0\\shared" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22000.0\\winrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22000.0\\cppwinrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" /EHsc /Tpbpl-subset/bpl_subset/libs/thread/src/win32\thread.cpp /Fobuild\temp.win-amd64-cpython-310\Release\bpl-subset/bpl_subset/libs/thread/src/win32\thread.obj /EHsc
  thread.cpp
  Unknown compiler version - please run the configure tests and report the results
  bpl-subset/bpl_subset\boost/thread/win32/thread_data.hpp(90): warning C4251: 'pycudaboost::detail::thread_data_base::thread_handle': class 'pycudaboost::detail::win32::handle_manager' needs to have dll-interface to be used by clients of struct 'pycudaboost::detail::thread_data_base'
  bpl-subset/bpl_subset\boost/thread/win32/thread_primitives.hpp(235): note: see declaration of 'pycudaboost::detail::win32::handle_manager'
  bpl-subset/bpl_subset\boost/thread/win32/thread_data.hpp(91): warning C4251: 'pycudaboost::detail::thread_data_base::interruption_handle': class 'pycudaboost::detail::win32::handle_manager' needs to have dll-interface to be used by clients of struct 'pycudaboost::detail::thread_data_base'
  bpl-subset/bpl_subset\boost/thread/win32/thread_primitives.hpp(235): note: see declaration of 'pycudaboost::detail::win32::handle_manager'
  bpl-subset/bpl_subset\boost/thread/win32/thread_data.hpp(93): warning C4251: 'pycudaboost::detail::thread_data_base::tss_data': class 'std::map<const void *,pycudaboost::detail::tss_data_node,std::less<const void *>,std::allocator<std::pair<const void *const ,pycudaboost::detail::tss_data_node>>>' needs to have dll-interface to be used by clients of struct 'pycudaboost::detail::thread_data_base'
  bpl-subset/bpl_subset\boost/thread/win32/thread_data.hpp(93): note: see declaration of 'std::map<const void *,pycudaboost::detail::tss_data_node,std::less<const void *>,std::allocator<std::pair<const void *const ,pycudaboost::detail::tss_data_node>>>'
  bpl-subset/bpl_subset\boost/thread/win32/thread_data.hpp(99): warning C4251: 'pycudaboost::detail::thread_data_base::notify': class 'std::vector<std::pair<pycudaboost::condition_variable *,pycudaboost::mutex *>,std::allocator<std::pair<pycudaboost::condition_variable *,pycudaboost::mutex *>>>' needs to have dll-interface to be used by clients of struct 'pycudaboost::detail::thread_data_base'
  bpl-subset/bpl_subset\boost/thread/win32/thread_data.hpp(96): note: see declaration of 'std::vector<std::pair<pycudaboost::condition_variable *,pycudaboost::mutex *>,std::allocator<std::pair<pycudaboost::condition_variable *,pycudaboost::mutex *>>>'
  "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.36.32532\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -DBOOST_ALL_NO_LIB=1 -DBOOST_THREAD_BUILD_DLL=1 -DBOOST_MULTI_INDEX_DISABLE_SERIALIZATION=1 -DBOOST_PYTHON_SOURCE=1 -Dboost=pycudaboost -DBOOST_THREAD_DONT_USE_CHRONO=1 -DPYGPU_PACKAGE=pycuda -DPYGPU_PYCUDA=1 -DHAVE_CURAND=1 -Isrc/cpp -Ibpl-subset/bpl_subset -IC:\Users\abah\AppData\Local\Temp\pip-build-env-f48dhjs1\overlay\Lib\site-packages\numpy\core\include -IE:\ProgramsE\stable-diffusion-webui-dev\venv\include -IC:\Users\abah\AppData\Local\Programs\Python\Python310\include -IC:\Users\abah\AppData\Local\Programs\Python\Python310\Include "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.36.32532\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.36.32532\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\VS\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22000.0\\um" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22000.0\\shared" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22000.0\\winrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22000.0\\cppwinrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" /EHsc /Tpbpl-subset/bpl_subset/libs/thread/src/win32\tss_dll.cpp /Fobuild\temp.win-amd64-cpython-310\Release\bpl-subset/bpl_subset/libs/thread/src/win32\tss_dll.obj /EHsc
  tss_dll.cpp
  Unknown compiler version - please run the configure tests and report the results
  "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.36.32532\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -DBOOST_ALL_NO_LIB=1 -DBOOST_THREAD_BUILD_DLL=1 -DBOOST_MULTI_INDEX_DISABLE_SERIALIZATION=1 -DBOOST_PYTHON_SOURCE=1 -Dboost=pycudaboost -DBOOST_THREAD_DONT_USE_CHRONO=1 -DPYGPU_PACKAGE=pycuda -DPYGPU_PYCUDA=1 -DHAVE_CURAND=1 -Isrc/cpp -Ibpl-subset/bpl_subset -IC:\Users\abah\AppData\Local\Temp\pip-build-env-f48dhjs1\overlay\Lib\site-packages\numpy\core\include -IE:\ProgramsE\stable-diffusion-webui-dev\venv\include -IC:\Users\abah\AppData\Local\Programs\Python\Python310\include -IC:\Users\abah\AppData\Local\Programs\Python\Python310\Include "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.36.32532\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.36.32532\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\VS\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22000.0\\um" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22000.0\\shared" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22000.0\\winrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22000.0\\cppwinrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" /EHsc /Tpbpl-subset/bpl_subset/libs/thread/src/win32\tss_pe.cpp /Fobuild\temp.win-amd64-cpython-310\Release\bpl-subset/bpl_subset/libs/thread/src/win32\tss_pe.obj /EHsc
  tss_pe.cpp
  Unknown compiler version - please run the configure tests and report the results
  "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.36.32532\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -DBOOST_ALL_NO_LIB=1 -DBOOST_THREAD_BUILD_DLL=1 -DBOOST_MULTI_INDEX_DISABLE_SERIALIZATION=1 -DBOOST_PYTHON_SOURCE=1 -Dboost=pycudaboost -DBOOST_THREAD_DONT_USE_CHRONO=1 -DPYGPU_PACKAGE=pycuda -DPYGPU_PYCUDA=1 -DHAVE_CURAND=1 -Isrc/cpp -Ibpl-subset/bpl_subset -IC:\Users\abah\AppData\Local\Temp\pip-build-env-f48dhjs1\overlay\Lib\site-packages\numpy\core\include -IE:\ProgramsE\stable-diffusion-webui-dev\venv\include -IC:\Users\abah\AppData\Local\Programs\Python\Python310\include -IC:\Users\abah\AppData\Local\Programs\Python\Python310\Include "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.36.32532\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.36.32532\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\VS\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22000.0\\um" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22000.0\\shared" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22000.0\\winrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22000.0\\cppwinrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" /EHsc /Tpsrc/cpp/bitlog.cpp /Fobuild\temp.win-amd64-cpython-310\Release\src/cpp/bitlog.obj /EHsc
  bitlog.cpp
  Unknown compiler version - please run the configure tests and report the results
  "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.36.32532\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -DBOOST_ALL_NO_LIB=1 -DBOOST_THREAD_BUILD_DLL=1 -DBOOST_MULTI_INDEX_DISABLE_SERIALIZATION=1 -DBOOST_PYTHON_SOURCE=1 -Dboost=pycudaboost -DBOOST_THREAD_DONT_USE_CHRONO=1 -DPYGPU_PACKAGE=pycuda -DPYGPU_PYCUDA=1 -DHAVE_CURAND=1 -Isrc/cpp -Ibpl-subset/bpl_subset -IC:\Users\abah\AppData\Local\Temp\pip-build-env-f48dhjs1\overlay\Lib\site-packages\numpy\core\include -IE:\ProgramsE\stable-diffusion-webui-dev\venv\include -IC:\Users\abah\AppData\Local\Programs\Python\Python310\include -IC:\Users\abah\AppData\Local\Programs\Python\Python310\Include "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.36.32532\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.36.32532\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\VS\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22000.0\\um" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22000.0\\shared" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22000.0\\winrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22000.0\\cppwinrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" /EHsc /Tpsrc/cpp/cuda.cpp /Fobuild\temp.win-amd64-cpython-310\Release\src/cpp/cuda.obj /EHsc
  cuda.cpp
  C:\Users\abah\AppData\Local\Temp\pip-install-dnjrgmqy\pycuda_a31b37ad3fe94263b94509aafedff2ea\src\cpp\cuda.hpp(14): fatal error C1083: Cannot open include file: 'cuda.h': No such file or directory
  error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\VC\\Tools\\MSVC\\14.36.32532\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
  [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

Launching Web UI with arguments:
No module 'xformers'. Proceeding without it.
Error loading script: trt.py
Traceback (most recent call last):
  File "E:\ProgramsE\stable-diffusion-webui-dev\modules\scripts.py", line 263, in load_scripts
    script_module = script_loading.load_module(scriptfile.path)
  File "E:\ProgramsE\stable-diffusion-webui-dev\modules\script_loading.py", line 10, in load_module
    module_spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "E:\ProgramsE\stable-diffusion-webui-dev\extensions\stable-diffusion-webui-tensorrt\scripts\trt.py", line 11, in <module>
    import pycuda.driver as cuda
ModuleNotFoundError: No module named 'pycuda'
MoreColors123 commented 1 year ago

Install exactly these modules: https://github.com/AUTOMATIC1111/stable-diffusion-webui-tensorrt/issues/7#issuecomment-1566156761

Kaiten10 commented 1 year ago

Install exactly these modules: #7 (comment)

When I activate C++ CMake tools, it requires MSVC 143 so it automatically activates it and can't be unchecked. So I can't seem to follow exactly the modules listed in #7. This is the closest I can follow and it still gives the same errors:

cpp modules now highlight

ClipSkipper commented 1 year ago

I also had to install Nvidia CUDA Toolkit for this to work

Kaiten10 commented 1 year ago

I also had to install Nvidia CUDA Toolkit for this to work

Thanks, that solved it! Here's what I had to do:

  1. Uninstall VS Build Tools 2022
  2. Install VS Build Tools 2019 (with modules from #7)
  3. Install Nvidia CUDA Toolkit 11.8
  4. Install dev branch of stable-diffusion-webui

And voila, the TensorRT tab shows up and I can train the tensorrt model :)