Stability-AI / stable-fast-3d

SF3D: Stable Fast 3D Mesh Reconstruction with UV-unwrapping and Illumination Disentanglement
https://stable-fast-3d.github.io
Other
975 stars 86 forks source link

Could not run 'texture_baker_cpp::rasterize' with arguments from the 'CUDA' backend. #39

Open deanvilgel opened 1 week ago

deanvilgel commented 1 week ago

So I been trying so hard with this cuda backend problem, I intalled cuda 12.1, python 3.10, pytorch 2.4.0 and installed all the requirement without error, but when ever i run run.py this error popup

I was installing all the requirements in conda environment, can this be problem?

NotImplementedError: Could not run 'texture_baker_cpp::rasterize' with arguments from the 'CUDA' backend. This could be because the operator doesn't exist for this backend, or was omitted during the selective/custom build process (if using custom build). If you are a Facebook employee using PyTorch on mobile, please visit https://fburl.com/ptmfixes for possible resolutions. 'texture_baker_cpp::rasterize' is only available for these backends: [CPU, Meta, BackendSelect, Python, FuncTorchDynamicLayerBackMode, Functionalize, Named, Conjugate, Negative, ZeroTensor, ADInplaceOrView, AutogradOther, AutogradCPU, AutogradCUDA, AutogradXLA, AutogradMPS, AutogradXPU, AutogradHPU, AutogradLazy, AutogradMeta, Tracer, AutocastCPU, AutocastXPU, AutocastCUDA, FuncTorchBatched, BatchedNestedTensor, FuncTorchVmapMode, Batched, VmapMode, FuncTorchGradWrapper, PythonTLSSnapshot, FuncTorchDynamicLayerFrontMode, PreDispatch, PythonDispatcher].

jammm commented 1 week ago

It appears as if the CUDA extension wasn't compiled. setup.py detects whether your machine supports CUDA or not using torch.cuda.is_available() Did you install the CUDA enabled PyTorch for CUDA 12.1?

It could be the case that conda environment didn't use the CUDA enabled PyTorch, causing torch.cuda.is_available() to return False which prevents the CUDA files from being compiled.

Perhaps you can reinstalling after setting the environment variable USE_CUDA=1 ?

deanvilgel commented 1 week ago

`import torch, os

print(torch.cuda.is_available()) ` when i ran this code on my environment, it seems to print out true. But since i installed torch on my anaconda environment, I'm not sure setup.py can result same result as this.

`import torch, os

os.environ["USE_CUDA"] = "1"`

i ran this code and did the reinstallationof texture_baker and requirements.txt, which seems to be not working too.

jammm commented 1 week ago

Can you try setting USE_CUDA by running the command export USE_CUDA=1 then pip install ./texture_baker?

deanvilgel commented 1 week ago

Since I'm using window(maybe i should have mentioned this first. Sorry), I used set instead of export. So I ran

set USE_CUDA=1 pip install ./texture_baker python run.py demo_files/examples/chair1.png --output-dir output/

but issue persists. maybe this is window related problem?

jammm commented 1 week ago

hmm. Can you try completely deleting the texture_baker/build folder, then re-run the above commands except use pip install -v ./texture_baker (note the -v) ?

Once that's done, share the full output logs of that pip install command here.

deanvilgel commented 1 week ago
Using pip 24.2 from C:\Users\ERSATZ-CAMPUSTOWN\anaconda3\envs\stable-fast\lib\site-packages\pip (python 3.10)
Processing c:\users\ersatz-campustown\stable-fast-3d\texture_baker
  Running command python setup.py egg_info
  True
  [<setuptools.extension.Extension('texture_baker._C') at 0x1b54cc48640>]
  running egg_info
  creating C:\Users\ERSATZ-CAMPUSTOWN\AppData\Local\Temp\pip-pip-egg-info-ch6ntkzq\texture_baker.egg-info
  writing C:\Users\ERSATZ-CAMPUSTOWN\AppData\Local\Temp\pip-pip-egg-info-ch6ntkzq\texture_baker.egg-info\PKG-INFO
  writing dependency_links to C:\Users\ERSATZ-CAMPUSTOWN\AppData\Local\Temp\pip-pip-egg-info-ch6ntkzq\texture_baker.egg-info\dependency_links.txt
  writing top-level names to C:\Users\ERSATZ-CAMPUSTOWN\AppData\Local\Temp\pip-pip-egg-info-ch6ntkzq\texture_baker.egg-info\top_level.txt
  writing manifest file 'C:\Users\ERSATZ-CAMPUSTOWN\AppData\Local\Temp\pip-pip-egg-info-ch6ntkzq\texture_baker.egg-info\SOURCES.txt'
  C:\Users\ERSATZ-CAMPUSTOWN\anaconda3\envs\stable-fast\lib\site-packages\torch\utils\cpp_extension.py:495: UserWarning: Attempted to use ninja as the BuildExtension backend but we could not find ninja.. Falling back to using the slow distutils backend.
    warnings.warn(msg.format('we could not find ninja.'))
  reading manifest file 'C:\Users\ERSATZ-CAMPUSTOWN\AppData\Local\Temp\pip-pip-egg-info-ch6ntkzq\texture_baker.egg-info\SOURCES.txt'
  writing manifest file 'C:\Users\ERSATZ-CAMPUSTOWN\AppData\Local\Temp\pip-pip-egg-info-ch6ntkzq\texture_baker.egg-info\SOURCES.txt'
  Preparing metadata (setup.py) ... done
Building wheels for collected packages: texture_baker
  Running command python setup.py bdist_wheel
  True
  [<setuptools.extension.Extension('texture_baker._C') at 0x25c642b98d0>]
  running bdist_wheel
  C:\Users\ERSATZ-CAMPUSTOWN\anaconda3\envs\stable-fast\lib\site-packages\torch\utils\cpp_extension.py:495: UserWarning: Attempted to use ninja as the BuildExtension backend but we could not find ninja.. Falling back to using the slow distutils backend.
    warnings.warn(msg.format('we could not find ninja.'))
  running build
  running build_py
  creating build
  creating build\lib.win-amd64-cpython-310
  creating build\lib.win-amd64-cpython-310\texture_baker
  copying .\texture_baker\baker.py -> build\lib.win-amd64-cpython-310\texture_baker
  copying .\texture_baker\__init__.py -> build\lib.win-amd64-cpython-310\texture_baker
  creating build\lib.win-amd64-cpython-310\texture_baker\csrc
  copying .\texture_baker\csrc\baker.h -> build\lib.win-amd64-cpython-310\texture_baker\csrc     
  copying .\texture_baker\csrc\baker_kernel.metal -> build\lib.win-amd64-cpython-310\texture_baker\csrc
  running build_ext
  C:\Users\ERSATZ-CAMPUSTOWN\anaconda3\envs\stable-fast\lib\site-packages\torch\utils\cpp_extension.py:380: UserWarning: Error checking compiler version for cl: [WinError 2] 지정된 파일을 찾을  수 없습니다
    warnings.warn(f'Error checking compiler version for {compiler}: {error}')
  building 'texture_baker._C' extension
  creating build\temp.win-amd64-cpython-310
  creating build\temp.win-amd64-cpython-310\Release
  creating build\temp.win-amd64-cpython-310\Release\texture_baker
  creating build\temp.win-amd64-cpython-310\Release\texture_baker\csrc
  "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -DTHRUST_IGNORE_CUB_VERSION_CHECK -IC:\Users\ERSATZ-CAMPUSTOWN\anaconda3\envs\stable-fast\lib\site-packages\torch\include -IC:\Users\ERSATZ-CAMPUSTOWN\anaconda3\envs\stable-fast\lib\site-packages\torch\include\torch\csrc\api\include -IC:\Users\ERSATZ-CAMPUSTOWN\anaconda3\envs\stable-fast\lib\site-packages\torch\include\TH -IC:\Users\ERSATZ-CAMPUSTOWN\anaconda3\envs\stable-fast\lib\site-packages\torch\include\THC "-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.1\include" -IC:\Users\ERSATZ-CAMPUSTOWN\anaconda3\envs\stable-fast\include -IC:\Users\ERSATZ-CAMPUSTOWN\anaconda3\envs\stable-fast\Include "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\ATLMFC\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\VS\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\shared" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\winrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\cppwinrt" /EHsc /Tptexture_baker\csrc\baker.cpp /Fobuild\temp.win-amd64-cpython-310\Release\texture_baker\csrc\baker.obj /MD /wd4819 /wd4251 /wd4244 /wd4267 /wd4275 /wd4018 /wd4190 /wd4624 /wd4067 /wd4068 /EHsc -O3 -fdiagnostics-color=always -fopenmp -march=native -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=0 /std:c++17 
  cl : 명령줄 warning D9002 : 알 수 없는 '-O3' 옵션을 무시합니다.
  cl : 명령줄 warning D9002 : 알 수 없는 '-fdiagnostics-color=always' 옵션을 무시합니다.
  cl : 명령줄 warning D9002 : 알 수 없는 '-fopenmp' 옵션을 무시합니다.
  cl : 명령줄 warning D9002 : 알 수 없는 '-march=native' 옵션을 무시합니다.
  baker.cpp
  C:\Users\ERSATZ-CAMPUSTOWN\anaconda3\envs\stable-fast\lib\site-packages\torch\utils\cpp_extension.py:1965: UserWarning: TORCH_CUDA_ARCH_LIST is not set, all archs for visible cards are included for compilation.
  If this is not desired, please set os.environ['TORCH_CUDA_ARCH_LIST'].
    warnings.warn(
  "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.1\bin\nvcc" -c texture_baker\csrc\baker_kernel.cu -o build\temp.win-amd64-cpython-310\Release\texture_baker\csrc\baker_kernel.obj -IC:\Users\ERSATZ-CAMPUSTOWN\anaconda3\envs\stable-fast\lib\site-packages\torch\include -IC:\Users\ERSATZ-CAMPUSTOWN\anaconda3\envs\stable-fast\lib\site-packages\torch\include\torch\csrc\api\include -IC:\Users\ERSATZ-CAMPUSTOWN\anaconda3\envs\stable-fast\lib\site-packages\torch\include\TH -IC:\Users\ERSATZ-CAMPUSTOWN\anaconda3\envs\stable-fast\lib\site-packages\torch\include\THC "-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.1\include" -IC:\Users\ERSATZ-CAMPUSTOWN\anaconda3\envs\stable-fast\include -IC:\Users\ERSATZ-CAMPUSTOWN\anaconda3\envs\stable-fast\Include "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\ATLMFC\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\VS\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\shared" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\winrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\cppwinrt" -Xcudafe --diag_suppress=dll_interface_conflict_dllexport_assumed -Xcudafe --diag_suppress=dll_interface_conflict_none_assumed -Xcudafe --diag_suppress=field_without_dll_interface -Xcudafe --diag_suppress=base_class_has_different_dll_interface -Xcompiler /EHsc -Xcompiler /wd4068 -Xcompiler /wd4067 -Xcompiler /wd4624 -Xcompiler /wd4190 -Xcompiler /wd4018 -Xcompiler /wd4275 -Xcompiler /wd4267 -Xcompiler /wd4244 -Xcompiler /wd4251 -Xcompiler /wd4819 -Xcompiler /MD -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_BFLOAT16_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr -O3 -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_86,code=compute_86 -gencode=arch=compute_86,code=sm_86 -std=c++17 --use-local-env
  C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.1\include\crt/host_config.h(153): fatal error C1189: #error:  -- unsupported Microsoft Visual Studio version! Only the versions between 2017 and 2022 (inclusive) are supported! The nvcc flag '-allow-unsupported-compiler' can be used to override this version check; however, using an unsupported host compiler may cause compilation failure or incorrect run time execution. Use at your own risk.
  baker_kernel.cu
  error: command 'C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v12.1\\bin\\nvcc.exe' failed with exit code 2
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> See above for output.

  note: This error originates from a subprocess, and is likely not a problem with pip.
  full command: 'C:\Users\ERSATZ-CAMPUSTOWN\anaconda3\envs\stable-fast\python.exe' -u -c '       
  exec(compile('"'"''"'"''"'"'
  # This is <pip-setuptools-caller> -- a caller that pip uses to run setup.py
  #
  # - It imports setuptools before invoking setup.py, to enable projects that directly
  #   import from `distutils.core` to work with newer packaging standards.
  # - It provides a clear error message when setuptools is not installed.
  # - It sets `sys.argv[0]` to the underlying `setup.py`, when invoking `setup.py` so
  #   setuptools doesn'"'"'t think the script is `-c`. This avoids the following warning:        
  #     manifest_maker: standard file '"'"'-c'"'"' not found".
  # - It generates a shim setup.py, for handling setup.cfg-only projects.
  import os, sys, tokenize

  try:
      import setuptools
  except ImportError as error:
      print(
          "ERROR: Can not execute `setup.py` since setuptools is not available in "
          "the build environment.",
          file=sys.stderr,
      )
      sys.exit(1)

  __file__ = %r
  sys.argv[0] = __file__

  if os.path.exists(__file__):
      filename = __file__
      with tokenize.open(__file__) as f:
          setup_py_code = f.read()
  else:
      filename = "<auto-generated setuptools caller>"
      setup_py_code = "from setuptools import setup; setup()"

  exec(compile(setup_py_code, filename, "exec"))
  '"'"''"'"''"'"' % ('"'"'C:\\Users\\ERSATZ-CAMPUSTOWN\\stable-fast-3d\\texture_baker\\setup.py'"'"',), "<pip-setuptools-caller>", "exec"))' bdist_wheel -d 'C:\Users\ERSATZ-CAMPUSTOWN\AppData\Local\Temp\pip-wheel-gg2o7kzh'
  cwd: C:\Users\ERSATZ-CAMPUSTOWN\stable-fast-3d\texture_baker\\
  Building wheel for texture_baker (setup.py) ... error
  ERROR: Failed building wheel for texture_baker
  Running setup.py clean for texture_baker
  Running command python setup.py clean
  True
  [<setuptools.extension.Extension('texture_baker._C') at 0x1c255979900>]
  running clean
  removing 'build\temp.win-amd64-cpython-310' (and everything under it)
  removing 'build\lib.win-amd64-cpython-310' (and everything under it)
  'build\bdist.win-amd64' does not exist -- can't clean it
  'build\scripts-3.10' does not exist -- can't clean it
  removing 'build'
Failed to build texture_baker
ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (texture_baker)

here is the full log. thks for your help

deanvilgel commented 1 week ago

Ok, I see this error log now.

#error:  -- unsupported Microsoft Visual Studio version! Only the versions between 2017 and 2022 (inclusive) are supported! The nvcc flag '-allow-unsupported-compiler' can be used to override this version check; however, using an unsupported host compiler may cause compilation failure or incorrect run time execution. Use at your own risk.
  baker_kernel.cu

but i installed and unintalled visual code redist 2022 like 5times, but didn't fix the issue.

I downloaded the vs redist from here.

is there option i need to bare upon or is there other version that i don't know?

jammm commented 1 week ago

Thanks for posting the logs! The issue is likely that you need to install visual studio, not just the redist. Install visual studio from https://visualstudio.microsoft.com/downloads/ (community version should work fine)

Note that this was mentioned in the README under installation https://github.com/Stability-AI/stable-fast-3d?tab=readme-ov-file#installation For Windows (experimental): Visual Studio 2022

deanvilgel commented 1 week ago

actually, visual studio 2022 community version is already installed in my computer. (yes i read readme. no offense). is there some hidden option that i should turn on?

jammm commented 1 week ago

Ah okay, my bad! Generally when installing Visual Studio was the Desktop development with C++ option checked? If yes, then I'm not sure what the issue is exactly. How about you retry the above commands but using the Developer Command prompt for VS 2022? It should be available when you search it on the start menu.

deanvilgel commented 1 week ago
Building wheels for collected packages: texture_baker
  Building wheel for texture_baker (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [54 lines of output]
      [<setuptools.extension.Extension('texture_baker._C') at 0x23c7b9fd8d0>]
      running bdist_wheel
      running build
      running build_py
      creating build\lib.win32-cpython-310
      creating build\lib.win32-cpython-310\texture_baker
      copying .\texture_baker\baker.py -> build\lib.win32-cpython-310\texture_baker
      copying .\texture_baker\__init__.py -> build\lib.win32-cpython-310\texture_baker
      creating build\lib.win32-cpython-310\texture_baker\csrc
      copying .\texture_baker\csrc\baker.h -> build\lib.win32-cpython-310\texture_baker\csrc
      copying .\texture_baker\csrc\baker_kernel.metal -> build\lib.win32-cpython-310\texture_baker\csrc
      running build_ext
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "C:\Users\ERSATZ-CAMPUSTOWN\stable-fast-3d\texture_baker\setup.py", line 109, in <module>
          setup(
        File "C:\Users\ERSATZ-CAMPUSTOWN\anaconda3\envs\stable-fast\lib\site-packages\setuptools\__init__.py", line 104, in setup
          return distutils.core.setup(**attrs)
        File "C:\Users\ERSATZ-CAMPUSTOWN\anaconda3\envs\stable-fast\lib\site-packages\setuptools\_distutils\core.py", line 184, in setup
          return run_commands(dist)
        File "C:\Users\ERSATZ-CAMPUSTOWN\anaconda3\envs\stable-fast\lib\site-packages\setuptools\_distutils\core.py", line 200, in run_commands
          dist.run_commands()
        File "C:\Users\ERSATZ-CAMPUSTOWN\anaconda3\envs\stable-fast\lib\site-packages\setuptools\_distutils\dist.py", line 969, in run_commands
          self.run_command(cmd)
        File "C:\Users\ERSATZ-CAMPUSTOWN\anaconda3\envs\stable-fast\lib\site-packages\setuptools\dist.py", line 967, in run_command
          super().run_command(command)
        File "C:\Users\ERSATZ-CAMPUSTOWN\anaconda3\envs\stable-fast\lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
          cmd_obj.run()
        File "C:\Users\ERSATZ-CAMPUSTOWN\anaconda3\envs\stable-fast\lib\site-packages\wheel\bdist_wheel.py", line 368, in run
          self.run_command("build")
        File "C:\Users\ERSATZ-CAMPUSTOWN\anaconda3\envs\stable-fast\lib\site-packages\setuptools\_distutils\cmd.py", line 316, in run_command
          self.distribution.run_command(command)
        File "C:\Users\ERSATZ-CAMPUSTOWN\anaconda3\envs\stable-fast\lib\site-packages\setuptools\dist.py", line 967, in run_command
          super().run_command(command)
        File "C:\Users\ERSATZ-CAMPUSTOWN\anaconda3\envs\stable-fast\lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
          cmd_obj.run()
        File "C:\Users\ERSATZ-CAMPUSTOWN\anaconda3\envs\stable-fast\lib\site-packages\setuptools\_distutils\command\build.py", line 132, in run
          self.run_command(cmd_name)
        File "C:\Users\ERSATZ-CAMPUSTOWN\anaconda3\envs\stable-fast\lib\site-packages\setuptools\_distutils\cmd.py", line 316, in run_command
          self.distribution.run_command(command)
        File "C:\Users\ERSATZ-CAMPUSTOWN\anaconda3\envs\stable-fast\lib\site-packages\setuptools\dist.py", line 967, in run_command
          super().run_command(command)
        File "C:\Users\ERSATZ-CAMPUSTOWN\anaconda3\envs\stable-fast\lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
          cmd_obj.run()
        File "C:\Users\ERSATZ-CAMPUSTOWN\anaconda3\envs\stable-fast\lib\site-packages\setuptools\command\build_ext.py", line 91, in run
          _build_ext.run(self)
        File "C:\Users\ERSATZ-CAMPUSTOWN\anaconda3\envs\stable-fast\lib\site-packages\setuptools\_distutils\command\build_ext.py", line 359, in run
          self.build_extensions()
        File "C:\Users\ERSATZ-CAMPUSTOWN\anaconda3\envs\stable-fast\lib\site-packages\torch\utils\cpp_extension.py", line 504, in build_extensions
          compiler_name, compiler_version = self._check_abi()
        File "C:\Users\ERSATZ-CAMPUSTOWN\anaconda3\envs\stable-fast\lib\site-packages\torch\utils\cpp_extension.py", line 896, in _check_abi
          raise UserWarning(msg)
      UserWarning: It seems that the VC environment is activated but DISTUTILS_USE_SDK is not set.This may lead to multiple activations of the VC env.Please set `DISTUTILS_USE_SDK=1` and try again.
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for texture_baker
  Running setup.py clean for texture_baker
Failed to build texture_baker
ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (texture_baker)

Okay new kind of error pops up when using Developer Command prompt for VS 2022. I don't know i should be happy or not. (I reinstalled vs community edition with Desktop development with C++. which was no use when using conda environment. and I'm pretty sure i checked this option was on when i initially installed. ) I tryed set DISTUTILS_USE_SDK=1 and runned {conda python path } -r requirements.txt but it was no use. I'm doupting there might be problem when setting os environment variables.

maybe tomorrow I will try setting this with resetting conda environment one more time, but when it does not work I will try setting this up in Colab. Thank you sincerely for your help.

jammm commented 1 week ago

Sounds good. It could be conda related, not sure. I've tested it to be working fine without Conda. Perhaps in the future you can try using normal python+pytorch (CUDA 12.1/12.4) with VS2022 installation with a venv if needed.

sinaiyuc commented 1 week ago

Hello! I also have this same issue:

NotImplementedError: Could not run 'texture_baker_cpp::rasterize' with arguments from the 'CUDA' backend. This could be because the operator doesn't exist for this backend, or was omitted during the selective/custom build process (if using custom build). If you are a Facebook employee using PyTorch on mobile, please visit https://fburl.com/ptmfixes for possible resolutions. 'texture_baker_cpp::rasterize' is only available for these backends: [CPU, Meta, BackendSelect, Python, FuncTorchDynamicLayerBackMode, Functionalize, Named, Conjugate, Negative, ZeroTensor, ADInplaceOrView, AutogradOther, AutogradCPU, AutogradCUDA, AutogradXLA, AutogradMPS, AutogradXPU, AutogradHPU, AutogradLazy, AutogradMeta, Tracer, AutocastCPU, AutocastCUDA, FuncTorchBatched, BatchedNestedTensor, FuncTorchVmapMode, Batched, VmapMode, FuncTorchGradWrapper, PythonTLSSnapshot, FuncTorchDynamicLayerFrontMode, PreDispatch, PythonDispatcher].

I tried the same steps above and get the following error when building TextureBaker:

`Building wheels for collected packages: texture_baker Building wheel for texture_baker (setup.py) ... error error: subprocess-exited-with-error

× python setup.py bdist_wheel did not run successfully. │ exit code: 1 ╰─> [54 lines of output] [<setuptools.extension.Extension('texture_baker._C') at 0x1d9d7535cc0>] running bdist_wheel running build running build_py creating build\lib.win32-cpython-310 creating build\lib.win32-cpython-310\texture_baker copying .\texture_baker\baker.py -> build\lib.win32-cpython-310\texture_baker copying .\texture_baker__init__.py -> build\lib.win32-cpython-310\texture_baker creating build\lib.win32-cpython-310\texture_baker\csrc copying .\texture_baker\csrc\baker.h -> build\lib.win32-cpython-310\texture_baker\csrc copying .\texture_baker\csrc\baker_kernel.metal -> build\lib.win32-cpython-310\texture_baker\csrc running build_ext Traceback (most recent call last): File "", line 2, in File "", line 34, in File "F:\ComfyFresh\ComfyUI\custom_nodes\stable-fast-3d\texture_baker\setup.py", line 109, in setup( File "C:\Users\Teh1P\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\setuptools__init__.py", line 104, in setup return distutils.core.setup(**attrs) File "C:\Users\Teh1P\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\setuptools_distutils\core.py", line 184, in setup return run_commands(dist) File "C:\Users\Teh1P\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\setuptools_distutils\core.py", line 200, in run_commands dist.run_commands() File "C:\Users\Teh1P\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\setuptools_distutils\dist.py", line 969, in run_commands self.run_command(cmd) File "C:\Users\Teh1P\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\setuptools\dist.py", line 967, in run_command super().run_command(command) File "C:\Users\Teh1P\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\setuptools_distutils\dist.py", line 988, in run_command cmd_obj.run() File "C:\Users\Teh1P\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\wheel\bdist_wheel.py", line 364, in run self.run_command("build") File "C:\Users\Teh1P\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\setuptools_distutils\cmd.py", line 316, in run_command self.distribution.run_command(command) File "C:\Users\Teh1P\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\setuptools\dist.py", line 967, in run_command super().run_command(command) File "C:\Users\Teh1P\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\setuptools_distutils\dist.py", line 988, in run_command cmd_obj.run() File "C:\Users\Teh1P\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\setuptools_distutils\command\build.py", line 132, in run self.run_command(cmd_name) File "C:\Users\Teh1P\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\setuptools_distutils\cmd.py", line 316, in run_command self.distribution.run_command(command) File "C:\Users\Teh1P\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\setuptools\dist.py", line 967, in run_command super().run_command(command) File "C:\Users\Teh1P\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\setuptools_distutils\dist.py", line 988, in run_command cmd_obj.run() File "C:\Users\Teh1P\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\setuptools\command\build_ext.py", line 91, in run _build_ext.run(self) File "C:\Users\Teh1P\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\setuptools_distutils\command\build_ext.py", line 359, in run self.build_extensions() File "C:\Users\Teh1P\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\torch\utils\cpp_extension.py", line 508, in build_extensions compiler_name, compiler_version = self._check_abi() File "C:\Users\Teh1P\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\torch\utils\cpp_extension.py", line 900, in _check_abi raise UserWarning(msg) UserWarning: It seems that the VC environment is activated but DISTUTILS_USE_SDK is not set.This may lead to multiple activations of the VC env.Please set DISTUTILS_USE_SDK=1 and try again. [end of output]

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

Please let me know how to continue!

Thanks!

I am on a windows machine with a 2080 and VS2022 installed. I did this inside of the Visual Studio 2022 Developer Command Prompt v17.11.2

jammm commented 1 week ago

@sinaiyuc can you try after setting DISTUTILS_USE_SDK=1 environment variable?

sinaiyuc commented 1 week ago

Quick update, I set DISTUTILS_USE_SDK=1 and now I get the following error:

Building wheels for collected packages: texture_baker Building wheel for texture_baker (setup.py) ... error error: subprocess-exited-with-error

× python setup.py bdist_wheel did not run successfully. │ exit code: 1 ╰─> [93 lines of output] [<setuptools.extension.Extension('texture_baker._C') at 0x26149735cc0>] running bdist_wheel running build running build_py creating build\lib.win32-cpython-310 creating build\lib.win32-cpython-310\texture_baker copying .\texture_baker\baker.py -> build\lib.win32-cpython-310\texture_baker copying .\texture_baker__init.py -> build\lib.win32-cpython-310\texture_baker creating build\lib.win32-cpython-310\texture_baker\csrc copying .\texture_baker\csrc\baker.h -> build\lib.win32-cpython-310\texture_baker\csrc copying .\texture_baker\csrc\baker_kernel.metal -> build\lib.win32-cpython-310\texture_baker\csrc running build_ext building 'texture_baker._C' extension creating F:\ComfyFresh\ComfyUI\custom_nodes\stable-fast-3d\texture_baker\build\temp.win32-cpython-310 creating F:\ComfyFresh\ComfyUI\custom_nodes\stable-fast-3d\texture_baker\build\temp.win32-cpython-310\Release creating F:\ComfyFresh\ComfyUI\custom_nodes\stable-fast-3d\texture_baker\build\temp.win32-cpython-310\Release\texture_baker creating F:\ComfyFresh\ComfyUI\custom_nodes\stable-fast-3d\texture_baker\build\temp.win32-cpython-310\Release\texture_baker\csrc Emitting ninja build file F:\ComfyFresh\ComfyUI\custom_nodes\stable-fast-3d\texture_baker\build\temp.win32-cpython-310\Release\build.ninja... Compiling objects... Allowing ninja to set a default number of workers... (overridable by setting the environment variable MAX_JOBS=N) [1/1] cl /showIncludes /nologo /O2 /W3 /GL /DNDEBUG /MD /MD /wd4819 /wd4251 /wd4244 /wd4267 /wd4275 /wd4018 /wd4190 /wd4624 /wd4067 /wd4068 /EHsc -IC:\Users\Teh1P\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\torch\include -IC:\Users\Teh1P\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\torch\include\torch\csrc\api\include -IC:\Users\Teh1P\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\torch\include\TH -IC:\Users\Teh1P\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\torch\include\THC "-IC:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.3056.0_x64qbz5n2kfra8p0\include" "-IC:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.3056.0_x64qbz5n2kfra8p0\Include" "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\ATLMFC\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\VS\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\cppwinrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" -c F:\ComfyFresh\ComfyUI\custom_nodes\stable-fast-3d\texture_baker\texture_baker\csrc\baker.cpp /FoF:\ComfyFresh\ComfyUI\custom_nodes\stable-fast-3d\texture_baker\build\temp.win32-cpython-310\Release\texture_baker\csrc\baker.obj -O3 -fdiagnostics-color=always -fopenmp -march=native -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=0 /std:c++17 FAILED: F:/ComfyFresh/ComfyUI/custom_nodes/stable-fast-3d/texture_baker/build/temp.win32-cpython-310/Release/texture_baker/csrc/baker.obj cl /showIncludes /nologo /O2 /W3 /GL /DNDEBUG /MD /MD /wd4819 /wd4251 /wd4244 /wd4267 /wd4275 /wd4018 /wd4190 /wd4624 /wd4067 /wd4068 /EHsc -IC:\Users\Teh1P\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\torch\include -IC:\Users\Teh1P\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\torch\include\torch\csrc\api\include -IC:\Users\Teh1P\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\torch\include\TH -IC:\Users\Teh1P\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\torch\include\THC "-IC:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.3056.0_x64qbz5n2kfra8p0\include" "-IC:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.3056.0_x64qbz5n2kfra8p0\Include" "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\ATLMFC\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\VS\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\cppwinrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" -c F:\ComfyFresh\ComfyUI\custom_nodes\stable-fast-3d\texture_baker\texture_baker\csrc\baker.cpp /FoF:\ComfyFresh\ComfyUI\custom_nodes\stable-fast-3d\texture_baker\build\temp.win32-cpython-310\Release\texture_baker\csrc\baker.obj -O3 -fdiagnostics-color=always -fopenmp -march=native -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=0 /std:c++17 cl : Command line warning D9002 : ignoring unknown option '-O3' cl : Command line warning D9002 : ignoring unknown option '-fdiagnostics-color=always' cl : Command line warning D9002 : ignoring unknown option '-fopenmp' cl : Command line warning D9002 : ignoring unknown option '-march=native' C:\Users\Teh1P\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\torch\include\c10/util/safe_numerics.h(23): error C3861: '_addcarry_u64': identifier not found F:\ComfyFresh\ComfyUI\custom_nodes\stable-fast-3d\texture_baker\texture_baker\csrc\baker.cpp(96): error C2181: illegal else without matching if ninja: build stopped: subcommand failed. Traceback (most recent call last): File "C:\Users\Teh1P\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\torch\utils\cpp_extension.py", line 2107, in _run_ninja_build subprocess.run( File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.3056.0_x64qbz5n2kfra8p0\lib\subprocess.py", line 526, in run raise CalledProcessError(retcode, process.args, subprocess.CalledProcessError: Command '['ninja', '-v']' returned non-zero exit status 1.

  The above exception was the direct cause of the following exception:

  Traceback (most recent call last):
    File "<string>", line 2, in <module>
    File "<pip-setuptools-caller>", line 34, in <module>
    File "F:\ComfyFresh\ComfyUI\custom_nodes\stable-fast-3d\texture_baker\setup.py", line 109, in <module>
      setup(
    File "C:\Users\Teh1P\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\setuptools\__init__.py", line 104, in setup
      return distutils.core.setup(**attrs)
    File "C:\Users\Teh1P\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\setuptools\_distutils\core.py", line 184, in setup
      return run_commands(dist)
    File "C:\Users\Teh1P\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\setuptools\_distutils\core.py", line 200, in run_commands
      dist.run_commands()
    File "C:\Users\Teh1P\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\setuptools\_distutils\dist.py", line 969, in run_commands
      self.run_command(cmd)
    File "C:\Users\Teh1P\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\setuptools\dist.py", line 967, in run_command
      super().run_command(command)
    File "C:\Users\Teh1P\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
      cmd_obj.run()
    File "C:\Users\Teh1P\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\wheel\bdist_wheel.py", line 364, in run
      self.run_command("build")
    File "C:\Users\Teh1P\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\setuptools\_distutils\cmd.py", line 316, in run_command
      self.distribution.run_command(command)
    File "C:\Users\Teh1P\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\setuptools\dist.py", line 967, in run_command
      super().run_command(command)
    File "C:\Users\Teh1P\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
      cmd_obj.run()
    File "C:\Users\Teh1P\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\setuptools\_distutils\command\build.py", line 132, in run
      self.run_command(cmd_name)
    File "C:\Users\Teh1P\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\setuptools\_distutils\cmd.py", line 316, in run_command
      self.distribution.run_command(command)
    File "C:\Users\Teh1P\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\setuptools\dist.py", line 967, in run_command
      super().run_command(command)
    File "C:\Users\Teh1P\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
      cmd_obj.run()
    File "C:\Users\Teh1P\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\setuptools\command\build_ext.py", line 91, in run
      _build_ext.run(self)
    File "C:\Users\Teh1P\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\setuptools\_distutils\command\build_ext.py", line 359, in run
      self.build_extensions()
    File "C:\Users\Teh1P\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\torch\utils\cpp_extension.py", line 870, in build_extensions
      build_ext.build_extensions(self)
    File "C:\Users\Teh1P\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\setuptools\_distutils\command\build_ext.py", line 479, in build_extensions
      self._build_extensions_serial()
    File "C:\Users\Teh1P\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\setuptools\_distutils\command\build_ext.py", line 505, in _build_extensions_serial
      self.build_extension(ext)
    File "C:\Users\Teh1P\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\setuptools\command\build_ext.py", line 252, in build_extension
      _build_ext.build_extension(self, ext)
    File "C:\Users\Teh1P\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\setuptools\_distutils\command\build_ext.py", line 560, in build_extension
      objects = self.compiler.compile(
    File "C:\Users\Teh1P\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\torch\utils\cpp_extension.py", line 842, in win_wrap_ninja_compile
      _write_ninja_file_and_compile_objects(
    File "C:\Users\Teh1P\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\torch\utils\cpp_extension.py", line 1783, in _write_ninja_file_and_compile_objects
      _run_ninja_build(
    File "C:\Users\Teh1P\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\torch\utils\cpp_extension.py", line 2123, in _run_ninja_build
      raise RuntimeError(message) from e
  RuntimeError: Error compiling objects for extension
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for texture_baker Running setup.py clean for texture_baker Failed to build texture_baker

priamai commented 1 week ago

Ubuntu user here. I have the same problem. CUDA version: 12.2 Python version: 3.10.12 Torch version: 2.4.1 Ubuntu: 20.04

Python 3.10.12 (main, Jul 29 2024, 16:56:48) [GCC 11.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
p>>> print(torch.cuda.is_available())
True

Yes I recompiled also the texture_baker:

$ python run.py demo_files/examples/chair1.png --output-dir output/
Device used:  cuda
/datadrive/stable-fast-3d/sf3d/models/network.py:22: FutureWarning: `torch.cuda.amp.custom_fwd(args...)` is deprecated. Please use `torch.amp.custom_fwd(args..., device_type='cuda')` instead.
  return decorator_with_args(*args, **kwargs)(fn)
/home/priamai/.pyenv/versions/3d/lib/python3.10/site-packages/open_clip/factory.py:128: FutureWarning: You are using `torch.load` with `weights_only=False` (the current default value), which uses the default pickle module implicitly. It is possible to construct malicious pickle data which will execute arbitrary code during unpickling (See https://github.com/pytorch/pytorch/blob/main/SECURITY.md#untrusted-models for more details). In a future release, the default value for `weights_only` will be flipped to `True`. This limits the functions that could be executed during unpickling. Arbitrary objects will no longer be allowed to be loaded via this mode unless they are explicitly allowlisted by the user via `torch.serialization.add_safe_globals`. We recommend you start setting `weights_only=True` for any use case where you don't have full control of the loaded file. Please open an issue on GitHub for any issues related to this experimental feature.
  checkpoint = torch.load(checkpoint_path, map_location=map_location)
  0%|                                                                                                                                                                                                                                                          | 0/1 [00:00<?, ?it/s]After Remesh 9880 19760
/datadrive/stable-fast-3d/sf3d/box_uv_unwrap.py:524: UserWarning: Using torch.cross without specifying the dim arg is deprecated.
Please either pass the dim explicitly or simply use torch.linalg.cross.
The default value of dim will change to agree with that of linalg.cross in a future release. (Triggered internally at ../aten/src/ATen/native/Cross.cpp:62.)
  torch.cross(main_axis, seconday_axis), dim=-1, eps=1e-6
  0%|                                                                                                                                                                                                                                                          | 0/1 [00:01<?, ?it/s]
Traceback (most recent call last):
  File "/datadrive/stable-fast-3d/run.py", line 122, in <module>
    mesh, glob_dict = model.run_image(
  File "/datadrive/stable-fast-3d/sf3d/system.py", line 277, in run_image
    meshes, global_dict = self.generate_mesh(
  File "/datadrive/stable-fast-3d/sf3d/system.py", line 360, in generate_mesh
    rast = self.baker.rasterize(
  File "/home/priamai/.pyenv/versions/3d/lib/python3.10/site-packages/texture_baker/baker.py", line 28, in rasterize
    return torch.ops.texture_baker_cpp.rasterize(
  File "/home/priamai/.pyenv/versions/3d/lib/python3.10/site-packages/torch/_ops.py", line 1061, in __call__
    return self_._op(*args, **(kwargs or {}))
NotImplementedError: Could not run 'texture_baker_cpp::rasterize' with arguments from the 'CUDA' backend. This could be because the operator doesn't exist for this backend, or was omitted during the selective/custom build process (if using custom build). If you are a Facebook employee using PyTorch on mobile, please visit https://fburl.com/ptmfixes for possible resolutions. 'texture_baker_cpp::rasterize' is only available for these backends: [CPU, Meta, BackendSelect, Python, FuncTorchDynamicLayerBackMode, Functionalize, Named, Conjugate, Negative, ZeroTensor, ADInplaceOrView, AutogradOther, AutogradCPU, AutogradCUDA, AutogradXLA, AutogradMPS, AutogradXPU, AutogradHPU, AutogradLazy, AutogradMeta, Tracer, AutocastCPU, AutocastXPU, AutocastCUDA, FuncTorchBatched, BatchedNestedTensor, FuncTorchVmapMode, Batched, VmapMode, FuncTorchGradWrapper, PythonTLSSnapshot, FuncTorchDynamicLayerFrontMode, PreDispatch, PythonDispatcher].

CPU: registered at texture_baker/csrc/baker.cpp:561 [kernel]
Meta: registered at ../aten/src/ATen/core/MetaFallbackKernel.cpp:23 [backend fallback]
BackendSelect: fallthrough registered at ../aten/src/ATen/core/BackendSelectFallbackKernel.cpp:3 [backend fallback]
Python: registered at ../aten/src/ATen/core/PythonFallbackKernel.cpp:153 [backend fallback]
FuncTorchDynamicLayerBackMode: registered at ../aten/src/ATen/functorch/DynamicLayer.cpp:497 [backend fallback]
Functionalize: registered at ../aten/src/ATen/FunctionalizeFallbackKernel.cpp:349 [backend fallback]
Named: registered at ../aten/src/ATen/core/NamedRegistrations.cpp:7 [backend fallback]
Conjugate: registered at ../aten/src/ATen/ConjugateFallback.cpp:17 [backend fallback]
Negative: registered at ../aten/src/ATen/native/NegateFallback.cpp:18 [backend fallback]
ZeroTensor: registered at ../aten/src/ATen/ZeroTensorFallback.cpp:86 [backend fallback]
ADInplaceOrView: fallthrough registered at ../aten/src/ATen/core/VariableFallbackKernel.cpp:86 [backend fallback]
AutogradOther: registered at ../aten/src/ATen/core/VariableFallbackKernel.cpp:53 [backend fallback]
AutogradCPU: registered at ../aten/src/ATen/core/VariableFallbackKernel.cpp:57 [backend fallback]
AutogradCUDA: registered at ../aten/src/ATen/core/VariableFallbackKernel.cpp:65 [backend fallback]
AutogradXLA: registered at ../aten/src/ATen/core/VariableFallbackKernel.cpp:69 [backend fallback]
AutogradMPS: registered at ../aten/src/ATen/core/VariableFallbackKernel.cpp:77 [backend fallback]
AutogradXPU: registered at ../aten/src/ATen/core/VariableFallbackKernel.cpp:61 [backend fallback]
AutogradHPU: registered at ../aten/src/ATen/core/VariableFallbackKernel.cpp:90 [backend fallback]
AutogradLazy: registered at ../aten/src/ATen/core/VariableFallbackKernel.cpp:73 [backend fallback]
AutogradMeta: registered at ../aten/src/ATen/core/VariableFallbackKernel.cpp:81 [backend fallback]
Tracer: registered at ../torch/csrc/autograd/TraceTypeManual.cpp:297 [backend fallback]
AutocastCPU: fallthrough registered at ../aten/src/ATen/autocast_mode.cpp:209 [backend fallback]
AutocastXPU: fallthrough registered at ../aten/src/ATen/autocast_mode.cpp:351 [backend fallback]
AutocastCUDA: fallthrough registered at ../aten/src/ATen/autocast_mode.cpp:165 [backend fallback]
FuncTorchBatched: registered at ../aten/src/ATen/functorch/LegacyBatchingRegistrations.cpp:731 [backend fallback]
BatchedNestedTensor: registered at ../aten/src/ATen/functorch/LegacyBatchingRegistrations.cpp:758 [backend fallback]
FuncTorchVmapMode: fallthrough registered at ../aten/src/ATen/functorch/VmapModeRegistrations.cpp:27 [backend fallback]
Batched: registered at ../aten/src/ATen/LegacyBatchingRegistrations.cpp:1075 [backend fallback]
VmapMode: fallthrough registered at ../aten/src/ATen/VmapModeRegistrations.cpp:33 [backend fallback]
FuncTorchGradWrapper: registered at ../aten/src/ATen/functorch/TensorWrapper.cpp:207 [backend fallback]
PythonTLSSnapshot: registered at ../aten/src/ATen/core/PythonFallbackKernel.cpp:161 [backend fallback]
FuncTorchDynamicLayerFrontMode: registered at ../aten/src/ATen/functorch/DynamicLayer.cpp:493 [backend fallback]
PreDispatch: registered at ../aten/src/ATen/core/PythonFallbackKernel.cpp:165 [backend fallback]
PythonDispatcher: registered at ../aten/src/ATen/core/PythonFallbackKernel.cpp:157 [backend fallback]

Texture baker install:

Processing ./texture_baker
  Preparing metadata (setup.py) ... done
Building wheels for collected packages: texture_baker
  Building wheel for texture_baker (setup.py) ... done
  Created wheel for texture_baker: filename=texture_baker-0.0.1-cp310-cp310-linux_x86_64.whl size=2939729 sha256=e0f5f1a9c5ab1451ec90c6845d9823fb47746239f43c7a11b2c6df6a876d9807
  Stored in directory: /tmp/pip-ephem-wheel-cache-3txkh8ao/wheels/1f/ef/c3/1275bf52702b6616ca38306fd443fec7e6386e250a4513ebdf
Successfully built texture_baker
Installing collected packages: texture_baker
  Attempting uninstall: texture_baker
    Found existing installation: texture_baker 0.0.1
    Uninstalling texture_baker-0.0.1:
      Successfully uninstalled texture_baker-0.0.1
Successfully installed texture_baker-0.0.1
jammm commented 1 week ago

@priamai try export USE_CUDA=1 then pip install -v ./texture_baker

jammm commented 1 week ago

@sinaiyuc try using x64 Native Tools Command Prompt for VS 2022 instead. @deanvilgel I suggest you try this as well. The non-x64 command prompt was probably trying to compile in 32 bit mode.

make sure to set DISTUTILS_USE_SDK=1 as well.

priamai commented 1 week ago

@priamai try export USE_CUDA=1 then pip install -v ./texture_baker

That's exactly what I did.

jammm commented 1 week ago

@priamai okay. Can you delete the texture_baker/build folder, then try again with pip install -v ./texture_baker and share the build logs?

sinaiyuc commented 1 week ago

Progress! Still not fixed though. Update below:

It looks like texture_baker was successfully installed.

pip install -v ./texture_baker Using pip 24.0 from C:\Users\Teh1P\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\pip (python 3.10) Processing f:\comfyfresh\comfyui\custom_nodes\stable-fast-3d\texture_baker Running command python setup.py egg_info [<setuptools.extension.Extension('texture_baker._C') at 0x1c608a35cf0>] running egg_info creating C:\Users\Teh1P\AppData\Local\Temp\pip-pip-egg-info-p5odq3og\texture_baker.egg-info writing C:\Users\Teh1P\AppData\Local\Temp\pip-pip-egg-info-p5odq3og\texture_baker.egg-info\PKG-INFO writing dependency_links to C:\Users\Teh1P\AppData\Local\Temp\pip-pip-egg-info-p5odq3og\texture_baker.egg-info\dependency_links.txt writing top-level names to C:\Users\Teh1P\AppData\Local\Temp\pip-pip-egg-info-p5odq3og\texture_baker.egg-info\top_level.txt writing manifest file 'C:\Users\Teh1P\AppData\Local\Temp\pip-pip-egg-info-p5odq3og\texture_baker.egg-info\SOURCES.txt' reading manifest file 'C:\Users\Teh1P\AppData\Local\Temp\pip-pip-egg-info-p5odq3og\texture_baker.egg-info\SOURCES.txt' writing manifest file 'C:\Users\Teh1P\AppData\Local\Temp\pip-pip-egg-info-p5odq3og\texture_baker.egg-info\SOURCES.txt' Preparing metadata (setup.py) ... done Building wheels for collected packages: texture_baker Running command python setup.py bdist_wheel [<setuptools.extension.Extension('texture_baker._C') at 0x1d195235cc0>] running bdist_wheel running build running build_py copying .\texture_baker\baker.py -> build\lib.win-amd64-cpython-310\texture_baker copying .\texture_baker__init__.py -> build\lib.win-amd64-cpython-310\texture_baker copying .\texture_baker\csrc\baker.h -> build\lib.win-amd64-cpython-310\texture_baker\csrc copying .\texture_baker\csrc\baker_kernel.metal -> build\lib.win-amd64-cpython-310\texture_baker\csrc running build_ext building 'texture_baker._C' extension Emitting ninja build file F:\ComfyFresh\ComfyUI\custom_nodes\stable-fast-3d\texture_baker\build\temp.win-amd64-cpython-310\Release\build.ninja... Compiling objects... Allowing ninja to set a default number of workers... (overridable by setting the environment variable MAX_JOBS=N) ninja: no work to do. "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\bin\HostX64\x64\link.exe" /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:C:\Users\Teh1P\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\torch\lib "/LIBPATH:C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.3056.0_x64qbz5n2kfra8p0\libs" "/LIBPATH:C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.3056.0_x64qbz5n2kfra8p0" "/LIBPATH:C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.3056.0_x64qbz5n2kfra8p0\PCbuild\amd64" "/LIBPATH:C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\ATLMFC\lib\x64" "/LIBPATH:C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\lib\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\lib\um\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.22621.0\ucrt\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.22621.0\um\x64" c10.lib torch.lib torch_cpu.lib torch_python.lib c10.lib torch.lib torch_cpu.lib torch_python.lib /EXPORT:PyInitC F:\ComfyFresh\ComfyUI\custom_nodes\stable-fast-3d\texture_baker\build\temp.win-amd64-cpython-310\Release\texture_baker\csrc\baker.obj /OUT:build\lib.win-amd64-cpython-310\texture_baker_C.cp310-win_amd64.pyd /IMPLIB:F:\ComfyFresh\ComfyUI\custom_nodes\stable-fast-3d\texture_baker\build\temp.win-amd64-cpython-310\Release\texture_baker\csrc_C.cp310-win_amd64.lib Creating library F:\ComfyFresh\ComfyUI\custom_nodes\stable-fast-3d\texture_baker\build\temp.win-amd64-cpython-310\Release\texture_baker\csrc_C.cp310-win_amd64.lib and object F:\ComfyFresh\ComfyUI\custom_nodes\stable-fast-3d\texture_baker\build\temp.win-amd64-cpython-310\Release\texture_baker\csrc_C.cp310-win_amd64.exp Generating code Finished generating code C:\Users\Teh1P\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\setuptools_distutils\cmd.py:66: SetuptoolsDeprecationWarning: setup.py install is deprecated. !!

      ********************************************************************************
      Please avoid running ``setup.py`` directly.
      Instead, use pypa/build, pypa/installer or other
      standards-based tools.

      See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details.
      ********************************************************************************

!! self.initialize_options() installing to build\bdist.win-amd64\wheel running install running install_lib creating build\bdist.win-amd64\wheel creating build\bdist.win-amd64\wheel\texture_baker copying build\lib.win-amd64-cpython-310\texture_baker\baker.py -> build\bdist.win-amd64\wheel.\texture_baker creating build\bdist.win-amd64\wheel\texture_baker\csrc copying build\lib.win-amd64-cpython-310\texture_baker\csrc\baker.h -> build\bdist.win-amd64\wheel.\texture_baker\csrc copying build\lib.win-amd64-cpython-310\texture_baker\csrc\baker_kernel.metal -> build\bdist.win-amd64\wheel.\texture_baker\csrc copying build\lib.win-amd64-cpython-310\texture_baker_C.cp310-win_amd64.pyd -> build\bdist.win-amd64\wheel.\texture_baker copying build\lib.win-amd64-cpython-310\texture_baker__init__.py -> build\bdist.win-amd64\wheel.\texture_baker running install_egg_info running egg_info writing texture_baker.egg-info\PKG-INFO writing dependency_links to texture_baker.egg-info\dependency_links.txt writing top-level names to texture_baker.egg-info\top_level.txt reading manifest file 'texture_baker.egg-info\SOURCES.txt' writing manifest file 'texture_baker.egg-info\SOURCES.txt' Copying texture_baker.egg-info to build\bdist.win-amd64\wheel.\texture_baker-0.0.1-py3.10.egg-info running install_scripts C:\Users\Teh1P\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\wheel\bdist_wheel.py:109: RuntimeWarning: Config variable 'Py_DEBUG' is unset, Python ABI tag may be incorrect if get_flag("Py_DEBUG", hasattr(sys, "gettotalrefcount"), warn=(impl == "cp")): creating build\bdist.win-amd64\wheel\texture_baker-0.0.1.dist-info\WHEEL creating 'C:\Users\Teh1P\AppData\Local\Temp\pip-wheel-1vd21yin\texture_baker-0.0.1-cp310-cp310-win_amd64.whl' and adding 'build\bdist.win-amd64\wheel' to it adding 'texture_baker/_C.cp310-win_amd64.pyd' adding 'texture_baker/init.py' adding 'texture_baker/baker.py' adding 'texture_baker/csrc/baker.h' adding 'texture_baker/csrc/baker_kernel.metal' adding 'texture_baker-0.0.1.dist-info/METADATA' adding 'texture_baker-0.0.1.dist-info/WHEEL' adding 'texture_baker-0.0.1.dist-info/top_level.txt' adding 'texture_baker-0.0.1.dist-info/RECORD' removing build\bdist.win-amd64\wheel Building wheel for texture_baker (setup.py) ... done Created wheel for texture_baker: filename=texture_baker-0.0.1-cp310-cp310-win_amd64.whl size=95900 sha256=37179a8c481bc90eb8060a909d246e94c241ab529e1d5eb7dee701e1ac67d806 Stored in directory: C:\Users\Teh1P\AppData\Local\Temp\pip-ephem-wheel-cache-2j33mmps\wheels\cd\44\c8\b0a7aa6fa8ec6cd0779f86612afec238a66f769873b26e9861 Successfully built texture_baker Installing collected packages: texture_baker Attempting uninstall: texture_baker Found existing installation: texture_baker 0.0.1 Uninstalling texture_baker-0.0.1: Removing file or directory c:\users\teh1p\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages\texture_baker-0.0.1.dist-info\ Removing file or directory c:\users\teh1p\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages\texture_baker\ Successfully uninstalled texture_baker-0.0.1 Successfully installed texture_baker-0.0.1

BUT! I am still getting the same error. Here is my output:

`Loaded ViT-B-32 model config. Loading pretrained ViT-B-32 weights (laion2b_s34b_b79k). Using Mask triangle F:\ComfyFresh\ComfyUI\custom_nodes\stable-fast-3d\sf3d\models\tokenizers\dinov2.py:266: UserWarning: 1Torch was not compiled with flash attention. (Triggered internally at ..\aten\src\ATen\native\transformers\cuda\sdp_utils.cpp:455.) context_layer = F.scaled_dot_product_attention( Triangle reduction: 1.2201073694485114 After Remesh 10152 20344 F:\ComfyFresh\ComfyUI\custom_nodes\stable-fast-3d\sf3d\box_uv_unwrap.py:524: UserWarning: Using torch.cross without specifying the dim arg is deprecated. Please either pass the dim explicitly or simply use torch.linalg.cross. The default value of dim will change to agree with that of linalg.cross in a future release. (Triggered internally at ..\aten\src\ATen\native\Cross.cpp:66.) torch.cross(main_axis, seconday_axis), dim=-1, eps=1e-6 !!! Exception during processing!!! Could not run 'texture_baker_cpp::rasterize' with arguments from the 'CUDA' backend. This could be because the operator doesn't exist for this backend, or was omitted during the selective/custom build process (if using custom build). If you are a Facebook employee using PyTorch on mobile, please visit https://fburl.com/ptmfixes for possible resolutions. 'texture_baker_cpp::rasterize' is only available for these backends: [CPU, Meta, BackendSelect, Python, FuncTorchDynamicLayerBackMode, Functionalize, Named, Conjugate, Negative, ZeroTensor, ADInplaceOrView, AutogradOther, AutogradCPU, AutogradCUDA, AutogradXLA, AutogradMPS, AutogradXPU, AutogradHPU, AutogradLazy, AutogradMeta, Tracer, AutocastCPU, AutocastCUDA, FuncTorchBatched, BatchedNestedTensor, FuncTorchVmapMode, Batched, VmapMode, FuncTorchGradWrapper, PythonTLSSnapshot, FuncTorchDynamicLayerFrontMode, PreDispatch, PythonDispatcher].

CPU: registered at F:\ComfyFresh\ComfyUI\custom_nodes\stable-fast-3d\texture_baker\texture_baker\csrc\baker.cpp:561 [kernel] Meta: registered at ..\aten\src\ATen\core\MetaFallbackKernel.cpp:23 [backend fallback] BackendSelect: fallthrough registered at ..\aten\src\ATen\core\BackendSelectFallbackKernel.cpp:3 [backend fallback] Python: registered at ..\aten\src\ATen\core\PythonFallbackKernel.cpp:154 [backend fallback] FuncTorchDynamicLayerBackMode: registered at ..\aten\src\ATen\functorch\DynamicLayer.cpp:497 [backend fallback] Functionalize: registered at ..\aten\src\ATen\FunctionalizeFallbackKernel.cpp:324 [backend fallback] Named: registered at ..\aten\src\ATen\core\NamedRegistrations.cpp:7 [backend fallback] Conjugate: registered at ..\aten\src\ATen\ConjugateFallback.cpp:17 [backend fallback] Negative: registered at ..\aten\src\ATen\native\NegateFallback.cpp:18 [backend fallback] ZeroTensor: registered at ..\aten\src\ATen\ZeroTensorFallback.cpp:86 [backend fallback] ADInplaceOrView: fallthrough registered at ..\aten\src\ATen\core\VariableFallbackKernel.cpp:86 [backend fallback] AutogradOther: registered at ..\aten\src\ATen\core\VariableFallbackKernel.cpp:53 [backend fallback] AutogradCPU: registered at ..\aten\src\ATen\core\VariableFallbackKernel.cpp:57 [backend fallback] AutogradCUDA: registered at ..\aten\src\ATen\core\VariableFallbackKernel.cpp:65 [backend fallback] AutogradXLA: registered at ..\aten\src\ATen\core\VariableFallbackKernel.cpp:69 [backend fallback] AutogradMPS: registered at ..\aten\src\ATen\core\VariableFallbackKernel.cpp:77 [backend fallback] AutogradXPU: registered at ..\aten\src\ATen\core\VariableFallbackKernel.cpp:61 [backend fallback] AutogradHPU: registered at ..\aten\src\ATen\core\VariableFallbackKernel.cpp:90 [backend fallback] AutogradLazy: registered at ..\aten\src\ATen\core\VariableFallbackKernel.cpp:73 [backend fallback] AutogradMeta: registered at ..\aten\src\ATen\core\VariableFallbackKernel.cpp:81 [backend fallback] Tracer: registered at ..\torch\csrc\autograd\TraceTypeManual.cpp:297 [backend fallback] AutocastCPU: fallthrough registered at ..\aten\src\ATen\autocast_mode.cpp:378 [backend fallback] AutocastCUDA: fallthrough registered at ..\aten\src\ATen\autocast_mode.cpp:244 [backend fallback] FuncTorchBatched: registered at ..\aten\src\ATen\functorch\LegacyBatchingRegistrations.cpp:731 [backend fallback] BatchedNestedTensor: registered at ..\aten\src\ATen\functorch\LegacyBatchingRegistrations.cpp:758 [backend fallback] FuncTorchVmapMode: fallthrough registered at ..\aten\src\ATen\functorch\VmapModeRegistrations.cpp:27 [backend fallback] Batched: registered at ..\aten\src\ATen\LegacyBatchingRegistrations.cpp:1075 [backend fallback] VmapMode: fallthrough registered at ..\aten\src\ATen\VmapModeRegistrations.cpp:33 [backend fallback] FuncTorchGradWrapper: registered at ..\aten\src\ATen\functorch\TensorWrapper.cpp:202 [backend fallback] PythonTLSSnapshot: registered at ..\aten\src\ATen\core\PythonFallbackKernel.cpp:162 [backend fallback] FuncTorchDynamicLayerFrontMode: registered at ..\aten\src\ATen\functorch\DynamicLayer.cpp:493 [backend fallback] PreDispatch: registered at ..\aten\src\ATen\core\PythonFallbackKernel.cpp:166 [backend fallback] PythonDispatcher: registered at ..\aten\src\ATen\core\PythonFallbackKernel.cpp:158 [backend fallback]

Traceback (most recent call last): File "F:\ComfyFresh\ComfyUI\execution.py", line 152, in recursive_execute output_data, output_ui = get_output_data(obj, input_data_all) File "F:\ComfyFresh\ComfyUI\execution.py", line 82, in get_output_data return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True) File "F:\ComfyFresh\ComfyUI\execution.py", line 75, in map_node_over_list results.append(getattr(obj, func)(*slice_dict(input_data_all, i))) File "F:\ComfyFresh\ComfyUI\custom_nodes\stable-fast-3d__init.py", line 132, in predict mesh, glob_dict = model.run_image( File "F:\ComfyFresh\ComfyUI\custom_nodes\stable-fast-3d\sf3d\system.py", line 277, in run_image meshes, global_dict = self.generate_mesh( File "F:\ComfyFresh\ComfyUI\custom_nodes\stable-fast-3d\sf3d\system.py", line 360, in generate_mesh rast = self.baker.rasterize( File "C:\Users\Teh1P\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\texture_baker\baker.py", line 28, in rasterize return torch.ops.texture_baker_cpp.rasterize( File "C:\Users\Teh1P\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\torch_ops.py", line 854, in call_ return self._op(args, **(kwargs or {})) NotImplementedError: Could not run 'texture_baker_cpp::rasterize' with arguments from the 'CUDA' backend. This could be because the operator doesn't exist for this backend, or was omitted during the selective/custom build process (if using custom build). If you are a Facebook employee using PyTorch on mobile, please visit https://fburl.com/ptmfixes for possible resolutions. 'texture_baker_cpp::rasterize' is only available for these backends: [CPU, Meta, BackendSelect, Python, FuncTorchDynamicLayerBackMode, Functionalize, Named, Conjugate, Negative, ZeroTensor, ADInplaceOrView, AutogradOther, AutogradCPU, AutogradCUDA, AutogradXLA, AutogradMPS, AutogradXPU, AutogradHPU, AutogradLazy, AutogradMeta, Tracer, AutocastCPU, AutocastCUDA, FuncTorchBatched, BatchedNestedTensor, FuncTorchVmapMode, Batched, VmapMode, FuncTorchGradWrapper, PythonTLSSnapshot, FuncTorchDynamicLayerFrontMode, PreDispatch, PythonDispatcher].

CPU: registered at F:\ComfyFresh\ComfyUI\custom_nodes\stable-fast-3d\texture_baker\texture_baker\csrc\baker.cpp:561 [kernel] Meta: registered at ..\aten\src\ATen\core\MetaFallbackKernel.cpp:23 [backend fallback] BackendSelect: fallthrough registered at ..\aten\src\ATen\core\BackendSelectFallbackKernel.cpp:3 [backend fallback] Python: registered at ..\aten\src\ATen\core\PythonFallbackKernel.cpp:154 [backend fallback] FuncTorchDynamicLayerBackMode: registered at ..\aten\src\ATen\functorch\DynamicLayer.cpp:497 [backend fallback] Functionalize: registered at ..\aten\src\ATen\FunctionalizeFallbackKernel.cpp:324 [backend fallback] Named: registered at ..\aten\src\ATen\core\NamedRegistrations.cpp:7 [backend fallback] Conjugate: registered at ..\aten\src\ATen\ConjugateFallback.cpp:17 [backend fallback] Negative: registered at ..\aten\src\ATen\native\NegateFallback.cpp:18 [backend fallback] ZeroTensor: registered at ..\aten\src\ATen\ZeroTensorFallback.cpp:86 [backend fallback] ADInplaceOrView: fallthrough registered at ..\aten\src\ATen\core\VariableFallbackKernel.cpp:86 [backend fallback] AutogradOther: registered at ..\aten\src\ATen\core\VariableFallbackKernel.cpp:53 [backend fallback] AutogradCPU: registered at ..\aten\src\ATen\core\VariableFallbackKernel.cpp:57 [backend fallback] AutogradCUDA: registered at ..\aten\src\ATen\core\VariableFallbackKernel.cpp:65 [backend fallback] AutogradXLA: registered at ..\aten\src\ATen\core\VariableFallbackKernel.cpp:69 [backend fallback] AutogradMPS: registered at ..\aten\src\ATen\core\VariableFallbackKernel.cpp:77 [backend fallback] AutogradXPU: registered at ..\aten\src\ATen\core\VariableFallbackKernel.cpp:61 [backend fallback] AutogradHPU: registered at ..\aten\src\ATen\core\VariableFallbackKernel.cpp:90 [backend fallback] AutogradLazy: registered at ..\aten\src\ATen\core\VariableFallbackKernel.cpp:73 [backend fallback] AutogradMeta: registered at ..\aten\src\ATen\core\VariableFallbackKernel.cpp:81 [backend fallback] Tracer: registered at ..\torch\csrc\autograd\TraceTypeManual.cpp:297 [backend fallback] AutocastCPU: fallthrough registered at ..\aten\src\ATen\autocast_mode.cpp:378 [backend fallback] AutocastCUDA: fallthrough registered at ..\aten\src\ATen\autocast_mode.cpp:244 [backend fallback] FuncTorchBatched: registered at ..\aten\src\ATen\functorch\LegacyBatchingRegistrations.cpp:731 [backend fallback] BatchedNestedTensor: registered at ..\aten\src\ATen\functorch\LegacyBatchingRegistrations.cpp:758 [backend fallback] FuncTorchVmapMode: fallthrough registered at ..\aten\src\ATen\functorch\VmapModeRegistrations.cpp:27 [backend fallback] Batched: registered at ..\aten\src\ATen\LegacyBatchingRegistrations.cpp:1075 [backend fallback] VmapMode: fallthrough registered at ..\aten\src\ATen\VmapModeRegistrations.cpp:33 [backend fallback] FuncTorchGradWrapper: registered at ..\aten\src\ATen\functorch\TensorWrapper.cpp:202 [backend fallback] PythonTLSSnapshot: registered at ..\aten\src\ATen\core\PythonFallbackKernel.cpp:162 [backend fallback] FuncTorchDynamicLayerFrontMode: registered at ..\aten\src\ATen\functorch\DynamicLayer.cpp:493 [backend fallback] PreDispatch: registered at ..\aten\src\ATen\core\PythonFallbackKernel.cpp:166 [backend fallback] PythonDispatcher: registered at ..\aten\src\ATen\core\PythonFallbackKernel.cpp:158 [backend fallback] `

sinaiyuc commented 1 week ago

@sinaiyuc try using x64 Native Tools Command Prompt for VS 2022 instead. @deanvilgel I suggest you try this as well. The non-x64 command prompt was probably trying to compile in 32 bit mode.

make sure to set DISTUTILS_USE_SDK=1 as well.

This is what I used btw to get texture_baker to install.

priamai commented 1 week ago

My logs here

priamai@webui8t4:/datadrive/stable-fast-3d$ pip install -v ./texture_baker > compiler.log
  Running command python setup.py egg_info
  [<setuptools.extension.Extension('texture_baker._C') at 0x7ce15c15d150>]
  running egg_info
  creating /tmp/pip-pip-egg-info-5mkbywld/texture_baker.egg-info
  writing /tmp/pip-pip-egg-info-5mkbywld/texture_baker.egg-info/PKG-INFO
  writing dependency_links to /tmp/pip-pip-egg-info-5mkbywld/texture_baker.egg-info/dependency_links.txt
  writing top-level names to /tmp/pip-pip-egg-info-5mkbywld/texture_baker.egg-info/top_level.txt
  writing manifest file '/tmp/pip-pip-egg-info-5mkbywld/texture_baker.egg-info/SOURCES.txt'
  /home/priamai/.pyenv/versions/3d/lib/python3.10/site-packages/torch/utils/cpp_extension.py:495: UserWarning: Attempted to use ninja as the BuildExtension backend but we could not find ninja.. Falling back to using the slow distutils backend.
    warnings.warn(msg.format('we could not find ninja.'))
  reading manifest file '/tmp/pip-pip-egg-info-5mkbywld/texture_baker.egg-info/SOURCES.txt'
  writing manifest file '/tmp/pip-pip-egg-info-5mkbywld/texture_baker.egg-info/SOURCES.txt'
  Running command python setup.py bdist_wheel
  [<setuptools.extension.Extension('texture_baker._C') at 0x7b7ba1a5d120>]
  running bdist_wheel
  /home/priamai/.pyenv/versions/3d/lib/python3.10/site-packages/torch/utils/cpp_extension.py:495: UserWarning: Attempted to use ninja as the BuildExtension backend but we could not find ninja.. Falling back to using the slow distutils backend.
    warnings.warn(msg.format('we could not find ninja.'))
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-cpython-310
  creating build/lib.linux-x86_64-cpython-310/texture_baker
  copying ./texture_baker/__init__.py -> build/lib.linux-x86_64-cpython-310/texture_baker
  copying ./texture_baker/baker.py -> build/lib.linux-x86_64-cpython-310/texture_baker
  creating build/lib.linux-x86_64-cpython-310/texture_baker/csrc
  copying ./texture_baker/csrc/baker.h -> build/lib.linux-x86_64-cpython-310/texture_baker/csrc
  copying ./texture_baker/csrc/baker_kernel.metal -> build/lib.linux-x86_64-cpython-310/texture_baker/csrc
  running build_ext
  building 'texture_baker._C' extension
  creating build/temp.linux-x86_64-cpython-310
  creating build/temp.linux-x86_64-cpython-310/texture_baker
  creating build/temp.linux-x86_64-cpython-310/texture_baker/csrc
  x86_64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I/home/priamai/.pyenv/versions/3d/lib/python3.10/site-packages/torch/include -I/home/priamai/.pyenv/versions/3d/lib/python3.10/site-packages/torch/include/torch/csrc/api/include -I/home/priamai/.pyenv/versions/3d/lib/python3.10/site-packages/torch/include/TH -I/home/priamai/.pyenv/versions/3d/lib/python3.10/site-packages/torch/include/THC -I/home/priamai/.pyenv/versions/3d/include -I/usr/include/python3.10 -c texture_baker/csrc/baker.cpp -o build/temp.linux-x86_64-cpython-310/texture_baker/csrc/baker.o -O3 -fdiagnostics-color=always -fopenmp -march=native -DTORCH_API_INCLUDE_EXTENSION_H -DPYBIND11_COMPILER_TYPE=\"_gcc\" -DPYBIND11_STDLIB=\"_libstdcpp\" -DPYBIND11_BUILD_ABI=\"_cxxabi1011\" -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++17
  texture_baker/csrc/baker.cpp: In member function ‘void texture_baker_cpp::BVH::build(const texture_baker_cpp::tb_float2*, const texture_baker_cpp::tb_int3*, const int64_t&)’:
  texture_baker/csrc/baker.cpp:239:30: warning: comparison of integer expressions of different signedness: ‘size_t’ {aka ‘long unsigned int’} and ‘const int64_t’ {aka ‘const long int’} [-Wsign-compare]
    239 |         for (size_t i = 0; i < num_indices; ++i)
        |                            ~~^~~~~~~~~~~~~
  x86_64-linux-gnu-g++ -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -g -fwrapv -O2 build/temp.linux-x86_64-cpython-310/texture_baker/csrc/baker.o -L/home/priamai/.pyenv/versions/3d/lib/python3.10/site-packages/torch/lib -L/usr/lib/x86_64-linux-gnu -lc10 -ltorch -ltorch_cpu -ltorch_python -lc10 -ltorch -ltorch_cpu -ltorch_python -o build/lib.linux-x86_64-cpython-310/texture_baker/_C.cpython-310-x86_64-linux-gnu.so
  /home/priamai/.pyenv/versions/3d/lib/python3.10/site-packages/setuptools/_distutils/cmd.py:66: SetuptoolsDeprecationWarning: setup.py install is deprecated.
  !!

          ********************************************************************************
          Please avoid running ``setup.py`` directly.
          Instead, use pypa/build, pypa/installer or other
          standards-based tools.

          See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details.
          ********************************************************************************

  !!
    self.initialize_options()
  installing to build/bdist.linux-x86_64/wheel
  running install
  running install_lib
  creating build/bdist.linux-x86_64
  creating build/bdist.linux-x86_64/wheel
  creating build/bdist.linux-x86_64/wheel/texture_baker
  copying build/lib.linux-x86_64-cpython-310/texture_baker/__init__.py -> build/bdist.linux-x86_64/wheel/texture_baker
  copying build/lib.linux-x86_64-cpython-310/texture_baker/baker.py -> build/bdist.linux-x86_64/wheel/texture_baker
  creating build/bdist.linux-x86_64/wheel/texture_baker/csrc
  copying build/lib.linux-x86_64-cpython-310/texture_baker/csrc/baker.h -> build/bdist.linux-x86_64/wheel/texture_baker/csrc
  copying build/lib.linux-x86_64-cpython-310/texture_baker/csrc/baker_kernel.metal -> build/bdist.linux-x86_64/wheel/texture_baker/csrc
  copying build/lib.linux-x86_64-cpython-310/texture_baker/_C.cpython-310-x86_64-linux-gnu.so -> build/bdist.linux-x86_64/wheel/texture_baker
  running install_egg_info
  running egg_info
  writing texture_baker.egg-info/PKG-INFO
  writing dependency_links to texture_baker.egg-info/dependency_links.txt
  writing top-level names to texture_baker.egg-info/top_level.txt
  reading manifest file 'texture_baker.egg-info/SOURCES.txt'
  writing manifest file 'texture_baker.egg-info/SOURCES.txt'
  Copying texture_baker.egg-info to build/bdist.linux-x86_64/wheel/texture_baker-0.0.1-py3.10.egg-info
  running install_scripts
  creating build/bdist.linux-x86_64/wheel/texture_baker-0.0.1.dist-info/WHEEL
  creating '/tmp/pip-wheel-q08wzni1/texture_baker-0.0.1-cp310-cp310-linux_x86_64.whl' and adding 'build/bdist.linux-x86_64/wheel' to it
  adding 'texture_baker/_C.cpython-310-x86_64-linux-gnu.so'
  adding 'texture_baker/__init__.py'
  adding 'texture_baker/baker.py'
  adding 'texture_baker/csrc/baker.h'
  adding 'texture_baker/csrc/baker_kernel.metal'
  adding 'texture_baker-0.0.1.dist-info/METADATA'
  adding 'texture_baker-0.0.1.dist-info/WHEEL'
  adding 'texture_baker-0.0.1.dist-info/top_level.txt'
  adding 'texture_baker-0.0.1.dist-info/RECORD'
  removing build/bdist.linux-x86_64/wheel
jammm commented 1 week ago

@sinaiyuc it doesn't seem like nvcc was invoked while compiling texture baker. Can you delete the texture_baker/build folder and try again with USE_CUDA=1 ?

jammm commented 1 week ago

@priamai for some reason CUDA isn't being detected by setup.py when you do the pip install. I'm not sure why, but it should definitely call CUDAExtension when you set USE_CUDA=1 explicitly.

How about trying USE_CUDA=1 pip install ./texture_baker ?

sinaiyuc commented 1 week ago

I deleted the /build folder and re-installed the texture baker. Here are the logs:

pip install -v ./texture_baker Using pip 24.0 from C:\Users\Teh1P\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\pip (python 3.10) Processing f:\comfyfresh\comfyui\custom_nodes\stable-fast-3d\texture_baker Running command python setup.py egg_info [<setuptools.extension.Extension('texture_baker._C') at 0x21b8a535cc0>] running egg_info creating C:\Users\Teh1P\AppData\Local\Temp\pip-pip-egg-info-dco3awsc\texture_baker.egg-info writing C:\Users\Teh1P\AppData\Local\Temp\pip-pip-egg-info-dco3awsc\texture_baker.egg-info\PKG-INFO writing dependency_links to C:\Users\Teh1P\AppData\Local\Temp\pip-pip-egg-info-dco3awsc\texture_baker.egg-info\dependency_links.txt writing top-level names to C:\Users\Teh1P\AppData\Local\Temp\pip-pip-egg-info-dco3awsc\texture_baker.egg-info\top_level.txt writing manifest file 'C:\Users\Teh1P\AppData\Local\Temp\pip-pip-egg-info-dco3awsc\texture_baker.egg-info\SOURCES.txt' reading manifest file 'C:\Users\Teh1P\AppData\Local\Temp\pip-pip-egg-info-dco3awsc\texture_baker.egg-info\SOURCES.txt' writing manifest file 'C:\Users\Teh1P\AppData\Local\Temp\pip-pip-egg-info-dco3awsc\texture_baker.egg-info\SOURCES.txt' Preparing metadata (setup.py) ... done Building wheels for collected packages: texture_baker Running command python setup.py bdist_wheel [<setuptools.extension.Extension('texture_baker._C') at 0x224af935c90>] running bdist_wheel running build running build_py creating build creating build\lib.win-amd64-cpython-310 creating build\lib.win-amd64-cpython-310\texture_baker copying .\texture_baker\baker.py -> build\lib.win-amd64-cpython-310\texture_baker copying .\texture_baker__init__.py -> build\lib.win-amd64-cpython-310\texture_baker creating build\lib.win-amd64-cpython-310\texture_baker\csrc copying .\texture_baker\csrc\baker.h -> build\lib.win-amd64-cpython-310\texture_baker\csrc copying .\texture_baker\csrc\baker_kernel.metal -> build\lib.win-amd64-cpython-310\texture_baker\csrc running build_ext building 'texture_baker._C' extension creating F:\ComfyFresh\ComfyUI\custom_nodes\stable-fast-3d\texture_baker\build\temp.win-amd64-cpython-310 creating F:\ComfyFresh\ComfyUI\custom_nodes\stable-fast-3d\texture_baker\build\temp.win-amd64-cpython-310\Release creating F:\ComfyFresh\ComfyUI\custom_nodes\stable-fast-3d\texture_baker\build\temp.win-amd64-cpython-310\Release\texture_baker creating F:\ComfyFresh\ComfyUI\custom_nodes\stable-fast-3d\texture_baker\build\temp.win-amd64-cpython-310\Release\texture_baker\csrc Emitting ninja build file F:\ComfyFresh\ComfyUI\custom_nodes\stable-fast-3d\texture_baker\build\temp.win-amd64-cpython-310\Release\build.ninja... Compiling objects... Allowing ninja to set a default number of workers... (overridable by setting the environment variable MAX_JOBS=N) [1/1] cl /showIncludes /nologo /O2 /W3 /GL /DNDEBUG /MD /MD /wd4819 /wd4251 /wd4244 /wd4267 /wd4275 /wd4018 /wd4190 /wd4624 /wd4067 /wd4068 /EHsc -IC:\Users\Teh1P\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\torch\include -IC:\Users\Teh1P\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\torch\include\torch\csrc\api\include -IC:\Users\Teh1P\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\torch\include\TH -IC:\Users\Teh1P\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\torch\include\THC "-IC:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.3056.0_x64qbz5n2kfra8p0\include" "-IC:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.3056.0_x64qbz5n2kfra8p0\Include" "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\ATLMFC\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\VS\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\cppwinrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" -c F:\ComfyFresh\ComfyUI\custom_nodes\stable-fast-3d\texture_baker\texture_baker\csrc\baker.cpp /FoF:\ComfyFresh\ComfyUI\custom_nodes\stable-fast-3d\texture_baker\build\temp.win-amd64-cpython-310\Release\texture_baker\csrc\baker.obj -O3 -fdiagnostics-color=always -fopenmp -march=native -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=0 /std:c++17 cl : Command line warning D9002 : ignoring unknown option '-O3' cl : Command line warning D9002 : ignoring unknown option '-fdiagnostics-color=always' cl : Command line warning D9002 : ignoring unknown option '-fopenmp' cl : Command line warning D9002 : ignoring unknown option '-march=native' "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\bin\HostX64\x64\link.exe" /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:C:\Users\Teh1P\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\torch\lib "/LIBPATH:C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.3056.0_x64qbz5n2kfra8p0\libs" "/LIBPATH:C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.3056.0_x64qbz5n2kfra8p0" "/LIBPATH:C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.3056.0_x64qbz5n2kfra8p0\PCbuild\amd64" "/LIBPATH:C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\ATLMFC\lib\x64" "/LIBPATH:C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\lib\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\lib\um\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.22621.0\ucrt\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.22621.0\um\x64" c10.lib torch.lib torch_cpu.lib torch_python.lib c10.lib torch.lib torch_cpu.lib torch_python.lib /EXPORT:PyInitC F:\ComfyFresh\ComfyUI\custom_nodes\stable-fast-3d\texture_baker\build\temp.win-amd64-cpython-310\Release\texture_baker\csrc\baker.obj /OUT:build\lib.win-amd64-cpython-310\texture_baker_C.cp310-win_amd64.pyd /IMPLIB:F:\ComfyFresh\ComfyUI\custom_nodes\stable-fast-3d\texture_baker\build\temp.win-amd64-cpython-310\Release\texture_baker\csrc_C.cp310-win_amd64.lib Creating library F:\ComfyFresh\ComfyUI\custom_nodes\stable-fast-3d\texture_baker\build\temp.win-amd64-cpython-310\Release\texture_baker\csrc_C.cp310-win_amd64.lib and object F:\ComfyFresh\ComfyUI\custom_nodes\stable-fast-3d\texture_baker\build\temp.win-amd64-cpython-310\Release\texture_baker\csrc_C.cp310-win_amd64.exp Generating code Finished generating code C:\Users\Teh1P\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\setuptools_distutils\cmd.py:66: SetuptoolsDeprecationWarning: setup.py install is deprecated. !!

      ********************************************************************************
      Please avoid running ``setup.py`` directly.
      Instead, use pypa/build, pypa/installer or other
      standards-based tools.

      See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details.
      ********************************************************************************

!! self.initialize_options() installing to build\bdist.win-amd64\wheel running install running install_lib creating build\bdist.win-amd64 creating build\bdist.win-amd64\wheel creating build\bdist.win-amd64\wheel\texture_baker copying build\lib.win-amd64-cpython-310\texture_baker\baker.py -> build\bdist.win-amd64\wheel.\texture_baker creating build\bdist.win-amd64\wheel\texture_baker\csrc copying build\lib.win-amd64-cpython-310\texture_baker\csrc\baker.h -> build\bdist.win-amd64\wheel.\texture_baker\csrc copying build\lib.win-amd64-cpython-310\texture_baker\csrc\baker_kernel.metal -> build\bdist.win-amd64\wheel.\texture_baker\csrc copying build\lib.win-amd64-cpython-310\texture_baker_C.cp310-win_amd64.pyd -> build\bdist.win-amd64\wheel.\texture_baker copying build\lib.win-amd64-cpython-310\texture_baker__init__.py -> build\bdist.win-amd64\wheel.\texture_baker running install_egg_info running egg_info writing texture_baker.egg-info\PKG-INFO writing dependency_links to texture_baker.egg-info\dependency_links.txt writing top-level names to texture_baker.egg-info\top_level.txt reading manifest file 'texture_baker.egg-info\SOURCES.txt' writing manifest file 'texture_baker.egg-info\SOURCES.txt' Copying texture_baker.egg-info to build\bdist.win-amd64\wheel.\texture_baker-0.0.1-py3.10.egg-info running install_scripts C:\Users\Teh1P\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\wheel\bdist_wheel.py:109: RuntimeWarning: Config variable 'Py_DEBUG' is unset, Python ABI tag may be incorrect if get_flag("Py_DEBUG", hasattr(sys, "gettotalrefcount"), warn=(impl == "cp")): creating build\bdist.win-amd64\wheel\texture_baker-0.0.1.dist-info\WHEEL creating 'C:\Users\Teh1P\AppData\Local\Temp\pip-wheel-i5lt67ev\texture_baker-0.0.1-cp310-cp310-win_amd64.whl' and adding 'build\bdist.win-amd64\wheel' to it adding 'texture_baker/_C.cp310-win_amd64.pyd' adding 'texture_baker/init.py' adding 'texture_baker/baker.py' adding 'texture_baker/csrc/baker.h' adding 'texture_baker/csrc/baker_kernel.metal' adding 'texture_baker-0.0.1.dist-info/METADATA' adding 'texture_baker-0.0.1.dist-info/WHEEL' adding 'texture_baker-0.0.1.dist-info/top_level.txt' adding 'texture_baker-0.0.1.dist-info/RECORD' removing build\bdist.win-amd64\wheel Building wheel for texture_baker (setup.py) ... done Created wheel for texture_baker: filename=texture_baker-0.0.1-cp310-cp310-win_amd64.whl size=95899 sha256=e68693fb557d4bd0e96a26712b6fbc77fcd798384b35d3aa46c8840410f0b849 Stored in directory: C:\Users\Teh1P\AppData\Local\Temp\pip-ephem-wheel-cache-geh7i93p\wheels\cd\44\c8\b0a7aa6fa8ec6cd0779f86612afec238a66f769873b26e9861 Successfully built texture_baker Installing collected packages: texture_baker Attempting uninstall: texture_baker Found existing installation: texture_baker 0.0.1 Uninstalling texture_baker-0.0.1: Removing file or directory c:\users\teh1p\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages\texture_baker-0.0.1.dist-info\ Removing file or directory c:\users\teh1p\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages\texture_baker\ Successfully uninstalled texture_baker-0.0.1 Successfully installed texture_baker-0.0.1

sinaiyuc commented 1 week ago

Although it still failed :(

python run.py demo_files/examples/chair1.png --output-dir output/ Device used: cuda 2024-09-06 12:21:32.2442621 [E:onnxruntime:Default, provider_bridge_ort.cc:1978 onnxruntime::TryGetProviderInfo_TensorRT] D:\a_work\1\s\onnxruntime\core\session\provider_bridge_ort.cc:1637 onnxruntime::ProviderLibrary::Get [ONNXRuntimeError] : 1 : FAIL : LoadLibrary failed with error 126 "" when trying to load "C:\Users\Teh1P\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\onnxruntime\capi\onnxruntime_providers_tensorrt.dll"

EP Error EP Error D:\a_work\1\s\onnxruntime\python\onnxruntime_pybind_state.cc:490 onnxruntime::python::RegisterTensorRTPluginsAsCustomOps Please install TensorRT libraries as mentioned in the GPU requirements page, make sure they're in the PATH or LD_LIBRARY_PATH, and that your GPU is supported. when using ['TensorrtExecutionProvider', 'CUDAExecutionProvider', 'CPUExecutionProvider'] Falling back to ['CUDAExecutionProvider', 'CPUExecutionProvider'] and retrying.


2024-09-06 12:21:32.4575931 [E:onnxruntime:Default, provider_bridge_ort.cc:1992 onnxruntime::TryGetProviderInfo_CUDA] D:\a_work\1\s\onnxruntime\core\session\provider_bridge_ort.cc:1637 onnxruntime::ProviderLibrary::Get [ONNXRuntimeError] : 1 : FAIL : LoadLibrary failed with error 126 "" when trying to load "C:\Users\Teh1P\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\onnxruntime\capi\onnxruntime_providers_cuda.dll"

0%| | 0/1 [00:00<?, ?it/s]F:\ComfyFresh\ComfyUI\custom_nodes\stable-fast-3d\sf3d\models\tokenizers\dinov2.py:266: UserWarning: 1Torch was not compiled with flash attention. (Triggered internally at ..\aten\src\ATen\native\transformers\cuda\sdp_utils.cpp:455.) context_layer = F.scaled_dot_product_attention( After Remesh 9874 19748 F:\ComfyFresh\ComfyUI\custom_nodes\stable-fast-3d\sf3d\box_uv_unwrap.py:524: UserWarning: Using torch.cross without specifying the dim arg is deprecated. Please either pass the dim explicitly or simply use torch.linalg.cross. The default value of dim will change to agree with that of linalg.cross in a future release. (Triggered internally at ..\aten\src\ATen\native\Cross.cpp:66.) torch.cross(main_axis, seconday_axis), dim=-1, eps=1e-6 0%| | 0/1 [00:47<?, ?it/s] Traceback (most recent call last): File "F:\ComfyFresh\ComfyUI\custom_nodes\stable-fast-3d\run.py", line 122, in mesh, glob_dict = model.run_image( File "F:\ComfyFresh\ComfyUI\custom_nodes\stable-fast-3d\sf3d\system.py", line 277, in run_image meshes, global_dict = self.generate_mesh( File "F:\ComfyFresh\ComfyUI\custom_nodes\stable-fast-3d\sf3d\system.py", line 360, in generate_mesh rast = self.baker.rasterize( File "C:\Users\Teh1P\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\texture_baker\baker.py", line 28, in rasterize return torch.ops.texture_baker_cpp.rasterize( File "C:\Users\Teh1P\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\torch_ops.py", line 854, in call return self._op(*args, **(kwargs or {})) NotImplementedError: Could not run 'texture_baker_cpp::rasterize' with arguments from the 'CUDA' backend. This could be because the operator doesn't exist for this backend, or was omitted during the selective/custom build process (if using custom build). If you are a Facebook employee using PyTorch on mobile, please visit https://fburl.com/ptmfixes for possible resolutions. 'texture_baker_cpp::rasterize' is only available for these backends: [CPU, Meta, BackendSelect, Python, FuncTorchDynamicLayerBackMode, Functionalize, Named, Conjugate, Negative, ZeroTensor, ADInplaceOrView, AutogradOther, AutogradCPU, AutogradCUDA, AutogradXLA, AutogradMPS, AutogradXPU, AutogradHPU, AutogradLazy, AutogradMeta, Tracer, AutocastCPU, AutocastCUDA, FuncTorchBatched, BatchedNestedTensor, FuncTorchVmapMode, Batched, VmapMode, FuncTorchGradWrapper, PythonTLSSnapshot, FuncTorchDynamicLayerFrontMode, PreDispatch, PythonDispatcher].

CPU: registered at F:\ComfyFresh\ComfyUI\custom_nodes\stable-fast-3d\texture_baker\texture_baker\csrc\baker.cpp:561 [kernel] Meta: registered at ..\aten\src\ATen\core\MetaFallbackKernel.cpp:23 [backend fallback] BackendSelect: fallthrough registered at ..\aten\src\ATen\core\BackendSelectFallbackKernel.cpp:3 [backend fallback] Python: registered at ..\aten\src\ATen\core\PythonFallbackKernel.cpp:154 [backend fallback] FuncTorchDynamicLayerBackMode: registered at ..\aten\src\ATen\functorch\DynamicLayer.cpp:497 [backend fallback] Functionalize: registered at ..\aten\src\ATen\FunctionalizeFallbackKernel.cpp:324 [backend fallback] Named: registered at ..\aten\src\ATen\core\NamedRegistrations.cpp:7 [backend fallback] Conjugate: registered at ..\aten\src\ATen\ConjugateFallback.cpp:17 [backend fallback] Negative: registered at ..\aten\src\ATen\native\NegateFallback.cpp:18 [backend fallback] ZeroTensor: registered at ..\aten\src\ATen\ZeroTensorFallback.cpp:86 [backend fallback] ADInplaceOrView: fallthrough registered at ..\aten\src\ATen\core\VariableFallbackKernel.cpp:86 [backend fallback] AutogradOther: registered at ..\aten\src\ATen\core\VariableFallbackKernel.cpp:53 [backend fallback] AutogradCPU: registered at ..\aten\src\ATen\core\VariableFallbackKernel.cpp:57 [backend fallback] AutogradCUDA: registered at ..\aten\src\ATen\core\VariableFallbackKernel.cpp:65 [backend fallback] AutogradXLA: registered at ..\aten\src\ATen\core\VariableFallbackKernel.cpp:69 [backend fallback] AutogradMPS: registered at ..\aten\src\ATen\core\VariableFallbackKernel.cpp:77 [backend fallback] AutogradXPU: registered at ..\aten\src\ATen\core\VariableFallbackKernel.cpp:61 [backend fallback] AutogradHPU: registered at ..\aten\src\ATen\core\VariableFallbackKernel.cpp:90 [backend fallback] AutogradLazy: registered at ..\aten\src\ATen\core\VariableFallbackKernel.cpp:73 [backend fallback] AutogradMeta: registered at ..\aten\src\ATen\core\VariableFallbackKernel.cpp:81 [backend fallback] Tracer: registered at ..\torch\csrc\autograd\TraceTypeManual.cpp:297 [backend fallback] AutocastCPU: fallthrough registered at ..\aten\src\ATen\autocast_mode.cpp:378 [backend fallback] AutocastCUDA: fallthrough registered at ..\aten\src\ATen\autocast_mode.cpp:244 [backend fallback] FuncTorchBatched: registered at ..\aten\src\ATen\functorch\LegacyBatchingRegistrations.cpp:731 [backend fallback] BatchedNestedTensor: registered at ..\aten\src\ATen\functorch\LegacyBatchingRegistrations.cpp:758 [backend fallback] FuncTorchVmapMode: fallthrough registered at ..\aten\src\ATen\functorch\VmapModeRegistrations.cpp:27 [backend fallback] Batched: registered at ..\aten\src\ATen\LegacyBatchingRegistrations.cpp:1075 [backend fallback] VmapMode: fallthrough registered at ..\aten\src\ATen\VmapModeRegistrations.cpp:33 [backend fallback] FuncTorchGradWrapper: registered at ..\aten\src\ATen\functorch\TensorWrapper.cpp:202 [backend fallback] PythonTLSSnapshot: registered at ..\aten\src\ATen\core\PythonFallbackKernel.cpp:162 [backend fallback] FuncTorchDynamicLayerFrontMode: registered at ..\aten\src\ATen\functorch\DynamicLayer.cpp:493 [backend fallback] PreDispatch: registered at ..\aten\src\ATen\core\PythonFallbackKernel.cpp:166 [backend fallback] PythonDispatcher: registered at ..\aten\src\ATen\core\PythonFallbackKernel.cpp:158 [backend fallback]

jammm commented 1 week ago

@sinaiyuc did you set USE_CUDA=1 ?

sinaiyuc commented 1 week ago

@jammm image

Yeah, I set both things before installing ./texture_baker

jammm commented 1 week ago

@sinaiyuc in that case, it should have executed this code https://github.com/Stability-AI/stable-fast-3d/blob/main/texture_baker/setup.py#L65-L72 It doesn't seem like it is doing that. Somehow python isn't passing USA_CUDA into setup.py. How about forcing use_cuda = True in this line https://github.com/Stability-AI/stable-fast-3d/blob/main/texture_baker/setup.py#L19 and then trying pip install -v ./texture_baker again? Also delete texture_baker/build just in case.

sinaiyuc commented 1 week ago

I got it!! Okay, somehow my CUDA got installed but the CUDA_PATH was never set.

So I had to go manually set my CUDA_PATH and that worked to get everything working! Thanks so much!

For anyone else on windows that finds this...

Make sure that you have either CUDA_PATH or CUDA_HOME set or else it will fail. Even if CUDA is installed.

jammm commented 1 week ago

Great! Glad it was fixed for you.

priamai commented 1 week ago

@priamai for some reason CUDA isn't being detected by setup.py when you do the pip install. I'm not sure why, but it should definitely call CUDAExtension when you set USE_CUDA=1 explicitly.

How about trying USE_CUDA=1 pip install ./texture_baker ?

Here you go:

$ USE_CUDA=1 pip install ./texture_baker
Processing ./texture_baker
  Preparing metadata (setup.py) ... done
Building wheels for collected packages: texture_baker
  Building wheel for texture_baker (setup.py) ... done
  Created wheel for texture_baker: filename=texture_baker-0.0.1-cp310-cp310-linux_x86_64.whl size=2939729 sha256=a1016d28e90949578ac0ab15debe7cc5b38a1343f17ed041910dafc9d8a7ebae
  Stored in directory: /tmp/pip-ephem-wheel-cache-htgms_fm/wheels/1f/ef/c3/1275bf52702b6616ca38306fd443fec7e6386e250a4513ebdf
Successfully built texture_baker
Installing collected packages: texture_baker
  Attempting uninstall: texture_baker
    Found existing installation: texture_baker 0.0.1
    Uninstalling texture_baker-0.0.1:
      Successfully uninstalled texture_baker-0.0.1
Successfully installed texture_baker-0.0.1

But I still get the same error when I run the demo files. Do you think it could be relate to pyenv somehow?

priamai commented 1 week ago

Full log of the install:

USE_CUDA=1 pip install -v ./texture_baker
Using pip 22.0.2 from /home/priamai/.pyenv/versions/3d/lib/python3.10/site-packages/pip (python 3.10)
Processing ./texture_baker
  Running command python setup.py egg_info
  [<setuptools.extension.Extension('texture_baker._C') at 0x7faf7b1b5000>]
  running egg_info
  creating /tmp/pip-pip-egg-info-832ir541/texture_baker.egg-info
  writing /tmp/pip-pip-egg-info-832ir541/texture_baker.egg-info/PKG-INFO
  writing dependency_links to /tmp/pip-pip-egg-info-832ir541/texture_baker.egg-info/dependency_links.txt
  writing top-level names to /tmp/pip-pip-egg-info-832ir541/texture_baker.egg-info/top_level.txt
  writing manifest file '/tmp/pip-pip-egg-info-832ir541/texture_baker.egg-info/SOURCES.txt'
  /home/priamai/.pyenv/versions/3d/lib/python3.10/site-packages/torch/utils/cpp_extension.py:495: UserWarning: Attempted to use ninja as the BuildExtension backend but we could not find ninja.. Falling back to using the slow distutils backend.
    warnings.warn(msg.format('we could not find ninja.'))
  reading manifest file '/tmp/pip-pip-egg-info-832ir541/texture_baker.egg-info/SOURCES.txt'
  writing manifest file '/tmp/pip-pip-egg-info-832ir541/texture_baker.egg-info/SOURCES.txt'
  Preparing metadata (setup.py) ... done
Building wheels for collected packages: texture_baker
  Running command python setup.py bdist_wheel
  [<setuptools.extension.Extension('texture_baker._C') at 0x7ed7e25bfc40>]
  running bdist_wheel
  /home/priamai/.pyenv/versions/3d/lib/python3.10/site-packages/torch/utils/cpp_extension.py:495: UserWarning: Attempted to use ninja as the BuildExtension backend but we could not find ninja.. Falling back to using the slow distutils backend.
    warnings.warn(msg.format('we could not find ninja.'))
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-cpython-310
  creating build/lib.linux-x86_64-cpython-310/texture_baker
  copying ./texture_baker/__init__.py -> build/lib.linux-x86_64-cpython-310/texture_baker
  copying ./texture_baker/baker.py -> build/lib.linux-x86_64-cpython-310/texture_baker
  creating build/lib.linux-x86_64-cpython-310/texture_baker/csrc
  copying ./texture_baker/csrc/baker.h -> build/lib.linux-x86_64-cpython-310/texture_baker/csrc
  copying ./texture_baker/csrc/baker_kernel.metal -> build/lib.linux-x86_64-cpython-310/texture_baker/csrc
  running build_ext
  building 'texture_baker._C' extension
  creating build/temp.linux-x86_64-cpython-310
  creating build/temp.linux-x86_64-cpython-310/texture_baker
  creating build/temp.linux-x86_64-cpython-310/texture_baker/csrc
  x86_64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I/home/priamai/.pyenv/versions/3d/lib/python3.10/site-packages/torch/include -I/home/priamai/.pyenv/versions/3d/lib/python3.10/site-packages/torch/include/torch/csrc/api/include -I/home/priamai/.pyenv/versions/3d/lib/python3.10/site-packages/torch/include/TH -I/home/priamai/.pyenv/versions/3d/lib/python3.10/site-packages/torch/include/THC -I/home/priamai/.pyenv/versions/3d/include -I/usr/include/python3.10 -c texture_baker/csrc/baker.cpp -o build/temp.linux-x86_64-cpython-310/texture_baker/csrc/baker.o -O3 -fdiagnostics-color=always -fopenmp -march=native -DTORCH_API_INCLUDE_EXTENSION_H -DPYBIND11_COMPILER_TYPE=\"_gcc\" -DPYBIND11_STDLIB=\"_libstdcpp\" -DPYBIND11_BUILD_ABI=\"_cxxabi1011\" -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++17
  texture_baker/csrc/baker.cpp: In member function ‘void texture_baker_cpp::BVH::build(const texture_baker_cpp::tb_float2*, const texture_baker_cpp::tb_int3*, const int64_t&)’:
  texture_baker/csrc/baker.cpp:239:30: warning: comparison of integer expressions of different signedness: ‘size_t’ {aka ‘long unsigned int’} and ‘const int64_t’ {aka ‘const long int’} [-Wsign-compare]
    239 |         for (size_t i = 0; i < num_indices; ++i)
        |                            ~~^~~~~~~~~~~~~
  x86_64-linux-gnu-g++ -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -g -fwrapv -O2 build/temp.linux-x86_64-cpython-310/texture_baker/csrc/baker.o -L/home/priamai/.pyenv/versions/3d/lib/python3.10/site-packages/torch/lib -L/usr/lib/x86_64-linux-gnu -lc10 -ltorch -ltorch_cpu -ltorch_python -lc10 -ltorch -ltorch_cpu -ltorch_python -o build/lib.linux-x86_64-cpython-310/texture_baker/_C.cpython-310-x86_64-linux-gnu.so
  /home/priamai/.pyenv/versions/3d/lib/python3.10/site-packages/setuptools/_distutils/cmd.py:66: SetuptoolsDeprecationWarning: setup.py install is deprecated.
  !!

          ********************************************************************************
          Please avoid running ``setup.py`` directly.
          Instead, use pypa/build, pypa/installer or other
          standards-based tools.

          See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details.
          ********************************************************************************

  !!
    self.initialize_options()
  installing to build/bdist.linux-x86_64/wheel
  running install
  running install_lib
  creating build/bdist.linux-x86_64
  creating build/bdist.linux-x86_64/wheel
  creating build/bdist.linux-x86_64/wheel/texture_baker
  copying build/lib.linux-x86_64-cpython-310/texture_baker/__init__.py -> build/bdist.linux-x86_64/wheel/texture_baker
  copying build/lib.linux-x86_64-cpython-310/texture_baker/baker.py -> build/bdist.linux-x86_64/wheel/texture_baker
  creating build/bdist.linux-x86_64/wheel/texture_baker/csrc
  copying build/lib.linux-x86_64-cpython-310/texture_baker/csrc/baker.h -> build/bdist.linux-x86_64/wheel/texture_baker/csrc
  copying build/lib.linux-x86_64-cpython-310/texture_baker/csrc/baker_kernel.metal -> build/bdist.linux-x86_64/wheel/texture_baker/csrc
  copying build/lib.linux-x86_64-cpython-310/texture_baker/_C.cpython-310-x86_64-linux-gnu.so -> build/bdist.linux-x86_64/wheel/texture_baker
  running install_egg_info
  running egg_info
  writing texture_baker.egg-info/PKG-INFO
  writing dependency_links to texture_baker.egg-info/dependency_links.txt
  writing top-level names to texture_baker.egg-info/top_level.txt
  reading manifest file 'texture_baker.egg-info/SOURCES.txt'
  writing manifest file 'texture_baker.egg-info/SOURCES.txt'
  Copying texture_baker.egg-info to build/bdist.linux-x86_64/wheel/texture_baker-0.0.1-py3.10.egg-info
  running install_scripts
  creating build/bdist.linux-x86_64/wheel/texture_baker-0.0.1.dist-info/WHEEL
  creating '/tmp/pip-wheel-bg6qogtg/texture_baker-0.0.1-cp310-cp310-linux_x86_64.whl' and adding 'build/bdist.linux-x86_64/wheel' to it
  adding 'texture_baker/_C.cpython-310-x86_64-linux-gnu.so'
  adding 'texture_baker/__init__.py'
  adding 'texture_baker/baker.py'
  adding 'texture_baker/csrc/baker.h'
  adding 'texture_baker/csrc/baker_kernel.metal'
  adding 'texture_baker-0.0.1.dist-info/METADATA'
  adding 'texture_baker-0.0.1.dist-info/WHEEL'
  adding 'texture_baker-0.0.1.dist-info/top_level.txt'
  adding 'texture_baker-0.0.1.dist-info/RECORD'
  removing build/bdist.linux-x86_64/wheel
  Building wheel for texture_baker (setup.py) ... done
  Created wheel for texture_baker: filename=texture_baker-0.0.1-cp310-cp310-linux_x86_64.whl size=2939729 sha256=24fb2e6c5cf2e43c258edba1f296c499c48a0c6be1a4e3e5d3b200fbef2e7740
  Stored in directory: /tmp/pip-ephem-wheel-cache-wi1pzqwz/wheels/1f/ef/c3/1275bf52702b6616ca38306fd443fec7e6386e250a4513ebdf
Successfully built texture_baker
Installing collected packages: texture_baker
  Attempting uninstall: texture_baker
    Found existing installation: texture_baker 0.0.1
    Uninstalling texture_baker-0.0.1:
      Removing file or directory /home/priamai/.pyenv/versions/3d/lib/python3.10/site-packages/texture_baker-0.0.1.dist-info/
      Removing file or directory /home/priamai/.pyenv/versions/3d/lib/python3.10/site-packages/texture_baker/
      Successfully uninstalled texture_baker-0.0.1
Successfully installed texture_baker-0.0.1
jammm commented 1 week ago

@priamai interesting. I don't think it's pyenv related as CUDA SDK is generally installed outside of pyenv. Is CUDA_HOME set? How about changing this line to use_cuda=True and try again? https://github.com/Stability-AI/stable-fast-3d/blob/main/texture_baker/setup.py#L19

priamai commented 1 week ago

@jammm hello good finding, indeed CUDA_HOME is not set, what shall I do to fix it?

jammm commented 1 week ago

@priamai check if CUDA_PATH is set as well. And if not, set CUDA_HOME/CUDA_PATH to the CUDA installation on your machine. For example, in my machine with CUDA 12.3 installed, CUDA_PATH has been set to C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.3. On linux the path would be different however, usually /usr/local/cuda-12.x

deanvilgel commented 1 week ago
C:\Users\ERSATZ-CAMPUSTOWN\stable-fast-3d>C:/Users/ERSATZ-CAMPUSTOWN/anaconda3/envs/stable-fast/python.exe -m pip install -v ./texture_baker
Using pip 24.2 from C:\Users\ERSATZ-CAMPUSTOWN\anaconda3\envs\stable-fast\lib\site-packages\pip (python 3.10)
Processing c:\users\ersatz-campustown\stable-fast-3d\texture_baker
  Running command python setup.py egg_info
  [<setuptools.extension.Extension('texture_baker._C') at 0x1c298841900>]
  running egg_info
  creating C:\Users\ERSATZ-CAMPUSTOWN\AppData\Local\Temp\pip-pip-egg-info-xva911k3\texture_baker.egg-info
  writing C:\Users\ERSATZ-CAMPUSTOWN\AppData\Local\Temp\pip-pip-egg-info-xva911k3\texture_baker.egg-info\PKG-INFO
  writing dependency_links to C:\Users\ERSATZ-CAMPUSTOWN\AppData\Local\Temp\pip-pip-egg-info-xva911k3\texture_baker.egg-info\dependency_links.txt
  writing top-level names to C:\Users\ERSATZ-CAMPUSTOWN\AppData\Local\Temp\pip-pip-egg-info-xva911k3\texture_baker.egg-info\top_level.txt
  writing manifest file 'C:\Users\ERSATZ-CAMPUSTOWN\AppData\Local\Temp\pip-pip-egg-info-xva911k3\texture_baker.egg-info\SOURCES.txt'
  reading manifest file 'C:\Users\ERSATZ-CAMPUSTOWN\AppData\Local\Temp\pip-pip-egg-info-xva911k3\texture_baker.egg-info\SOURCES.txt'
  writing manifest file 'C:\Users\ERSATZ-CAMPUSTOWN\AppData\Local\Temp\pip-pip-egg-info-xva911k3\texture_baker.egg-info\SOURCES.txt'
  Preparing metadata (setup.py) ... done
Building wheels for collected packages: texture_baker
  Running command python setup.py bdist_wheel
  [<setuptools.extension.Extension('texture_baker._C') at 0x21c467c18d0>]
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build\lib.win-amd64-cpython-310
  creating build\lib.win-amd64-cpython-310\texture_baker
  copying .\texture_baker\baker.py -> build\lib.win-amd64-cpython-310\texture_baker
  copying .\texture_baker\__init__.py -> build\lib.win-amd64-cpython-310\texture_baker
  creating build\lib.win-amd64-cpython-310\texture_baker\csrc
  copying .\texture_baker\csrc\baker.h -> build\lib.win-amd64-cpython-310\texture_baker\csrc
  copying .\texture_baker\csrc\baker_kernel.metal -> build\lib.win-amd64-cpython-310\texture_baker\csrc
  running build_ext
  building 'texture_baker._C' extension
  creating C:\Users\ERSATZ-CAMPUSTOWN\stable-fast-3d\texture_baker\build\temp.win-amd64-cpython-310
  creating C:\Users\ERSATZ-CAMPUSTOWN\stable-fast-3d\texture_baker\build\temp.win-amd64-cpython-310\Release
  creating C:\Users\ERSATZ-CAMPUSTOWN\stable-fast-3d\texture_baker\build\temp.win-amd64-cpython-310\Release\texture_baker
  creating C:\Users\ERSATZ-CAMPUSTOWN\stable-fast-3d\texture_baker\build\temp.win-amd64-cpython-310\Release\texture_baker\csrc
  C:\Users\ERSATZ-CAMPUSTOWN\anaconda3\envs\stable-fast\lib\site-packages\torch\utils\cpp_extension.py:1965: UserWarning: TORCH_CUDA_ARCH_LIST is not set, all archs for visible cards are included for compilation.
  If this is not desired, please set os.environ['TORCH_CUDA_ARCH_LIST'].
    warnings.warn(
  Emitting ninja build file C:\Users\ERSATZ-CAMPUSTOWN\stable-fast-3d\texture_baker\build\temp.win-amd64-cpython-310\Release\build.ninja...
  Compiling objects...
  Allowing ninja to set a default number of workers... (overridable by setting the environment variable MAX_JOBS=N)
  1.11.0
  "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\bin\HostX64\x64\link.exe" /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:C:\Users\ERSATZ-CAMPUSTOWN\anaconda3\envs\stable-fast\lib\site-packages\torch\lib "/LIBPATH:C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.1\lib\x64" /LIBPATH:C:\Users\ERSATZ-CAMPUSTOWN\anaconda3\envs\stable-fast\libs /LIBPATH:C:\Users\ERSATZ-CAMPUSTOWN\anaconda3\envs\stable-fast /LIBPATH:C:\Users\ERSATZ-CAMPUSTOWN\anaconda3\envs\stable-fast\PCbuild\amd64 "/LIBPATH:C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\ATLMFC\lib\x64" "/LIBPATH:C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\lib\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.22621.0\ucrt\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\\lib\10.0.22621.0\\um\x64" cudart_static.lib c10_cuda.lib c10.lib torch.lib torch_cpu.lib torch_python.lib c10.lib torch.lib torch_cpu.lib torch_python.lib cudart_static.lib c10_cuda.lib torch_cuda.lib /EXPORT:PyInit__C C:\Users\ERSATZ-CAMPUSTOWN\stable-fast-3d\texture_baker\build\temp.win-amd64-cpython-310\Release\texture_baker\csrc\baker.obj C:\Users\ERSATZ-CAMPUSTOWN\stable-fast-3d\texture_baker\build\temp.win-amd64-cpython-310\Release\texture_baker\csrc\baker_kernel.obj /OUT:build\lib.win-amd64-cpython-310\texture_baker\_C.cp310-win_amd64.pyd /IMPLIB:C:\Users\ERSATZ-CAMPUSTOWN\stable-fast-3d\texture_baker\build\temp.win-amd64-cpython-310\Release\texture_baker\csrc\_C.cp310-win_amd64.lib
  LINK : fatal error LNK1181: 'C:\Users\ERSATZ-CAMPUSTOWN\stable-fast-3d\texture_baker\build\temp.win-amd64-cpython-310\Release\texture_baker\csrc\baker.obj' 입력 파일 을 열 수 없습니다.
  error: command 'C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.41.34120\\bin\\HostX64\\x64\\link.exe' failed with exit code 1181
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> See above for output.

  note: This error originates from a subprocess, and is likely not a problem with pip.
  full command: 'C:\Users\ERSATZ-CAMPUSTOWN\anaconda3\envs\stable-fast\python.exe' -u -c '
  exec(compile('"'"''"'"''"'"'
  # This is <pip-setuptools-caller> -- a caller that pip uses to run setup.py
  #
  # - It imports setuptools before invoking setup.py, to enable projects that directly
  #   import from `distutils.core` to work with newer packaging standards.
  # - It provides a clear error message when setuptools is not installed.
  # - It sets `sys.argv[0]` to the underlying `setup.py`, when invoking `setup.py` so
  #   setuptools doesn'"'"'t think the script is `-c`. This avoids the following warning:
  #     manifest_maker: standard file '"'"'-c'"'"' not found".
  # - It generates a shim setup.py, for handling setup.cfg-only projects.
  import os, sys, tokenize

  try:
      import setuptools
  except ImportError as error:
      print(
          "ERROR: Can not execute `setup.py` since setuptools is not available in "
          "the build environment.",
          file=sys.stderr,
      )
      sys.exit(1)

  __file__ = %r
  sys.argv[0] = __file__

  if os.path.exists(__file__):
      filename = __file__
      with tokenize.open(__file__) as f:
          setup_py_code = f.read()
  else:
      filename = "<auto-generated setuptools caller>"
      setup_py_code = "from setuptools import setup; setup()"

  exec(compile(setup_py_code, filename, "exec"))
  '"'"''"'"''"'"' % ('"'"'C:\\Users\\ERSATZ-CAMPUSTOWN\\stable-fast-3d\\texture_baker\\setup.py'"'"',), "<pip-setuptools-caller>", "exec"))' bdist_wheel -d 'C:\Users\ERSATZ-CAMPUSTOWN\AppData\Local\Temp\pip-wheel-6zzip5dk'
  cwd: C:\Users\ERSATZ-CAMPUSTOWN\stable-fast-3d\texture_baker\\
  Building wheel for texture_baker (setup.py) ... error
  ERROR: Failed building wheel for texture_baker
  Running setup.py clean for texture_baker
  Running command python setup.py clean
  [<setuptools.extension.Extension('texture_baker._C') at 0x1e0f7f91900>]
  running clean
  removing 'build\temp.win-amd64-cpython-310' (and everything under it)
  removing 'build\lib.win-amd64-cpython-310' (and everything under it)
  'build\bdist.win-amd64' does not exist -- can't clean it
  'build\scripts-3.10' does not exist -- can't clean it
  removing 'build'
Failed to build texture_baker
ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (texture_baker)

im back on problem and there seems to be another error happening.

i reinstalled vs code and set cuda_home and cuda_path, and ran with x64 native tools command.

any quick guess for the problem are welcomed

deanvilgel commented 1 week ago

Okay I figured it is happening because there is some indents inside path by this link (its kind of frustrating that i took so long finding out the cause).

seams like C:\Users\ERSATZ-CAMPUSTOWN\stable-fast-3d\texture_baker\build\temp.win-amd64-cpython-310\Release\texture_baker\csrc\baker.obj this has no .obj and more path to it with indent. let me know if you know the fix.

damn window suck so much

jammm commented 5 days ago

Okay I figured it is happening because there is some indents inside path by this link (its kind of frustrating that i took so long finding out the cause).

seams like C:\Users\ERSATZ-CAMPUSTOWN\stable-fast-3d\texture_baker\build\temp.win-amd64-cpython-310\Release\texture_baker\csrc\baker.obj this has no .obj and more path to it with indent. let me know if you know the fix.

damn window suck so much

maybe try deleting the build folder and share the build logs with -v again?