MrForExample / ComfyUI-3D-Pack

An extensive node suite that enables ComfyUI to process 3D inputs (Mesh & UV Texture, etc) using cutting edge algorithms (3DGS, NeRF, etc.)
MIT License
2.14k stars 210 forks source link

IMPORT FAILED / running pinokio/portable comfy ui on windows11 rtx3070 pytorch version: 2.3.0+cu121 #245

Open eotamis opened 1 month ago

eotamis commented 1 month ago

### ANY GUIDANCE ON RESOLVING BELOW INSTALLATION GLITCH IS APPRECIATED , THANKS.

Prestartup times for custom nodes: 0.0 seconds: D:\pinokio\api\comfyui.git\app\custom_nodes\rgthree-comfy 69.2 seconds: D:\pinokio\api\comfyui.git\app\custom_nodes\ComfyUI-Manager

Total VRAM 8192 MB, total RAM 65219 MB pytorch version: 2.3.0+cu121 Set vram state to: NORMAL_VRAM Device: cuda:0 NVIDIA GeForce RTX 3070 Ti Laptop GPU : cudaMallocAsync Using pytorch cross attention [Prompt Server] web root: D:\pinokio\api\comfyui.git\app\web Warn!: xFormers is available (Attention) Warn!: D:\pinokio\api\comfyui.git\app\env\lib\site-packages\torch\utils\cpp_extension.py:1967: 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(

Warn!: Traceback (most recent call last): File "D:\pinokio\api\comfyui.git\app\env\lib\site-packages\torch\utils\cpp_extension.py", line 2107, in _run_ninja_build subprocess.run( File "D:\pinokio\bin\miniconda\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 "D:\pinokio\api\comfyui.git\app\nodes.py", line 1931, in load_custom_node module_spec.loader.exec_module(module) File "", line 883, in exec_module File "", line 241, in _call_with_frames_removed File "D:\pinokio\api\comfyui.git\app\custom_nodes\ComfyUI-3D-Pack__init.py", line 47, in module = importlib.import_module(f".{nodes_filename}", package=name) File "D:\pinokio\bin\miniconda\lib\importlib\init.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1050, in _gcd_import File "", line 1027, in _find_and_load File "", line 1006, in _find_and_load_unlocked File "", line 688, in _load_unlocked File "", line 883, in exec_module File "", line 241, in _call_with_frames_removed File "D:\pinokio\api\comfyui.git\app\custom_nodes\ComfyUI-3D-Pack\nodes.py", line 78, in from Unique3D.scripts.project_mesh import multiview_color_projection, get_cameras_list File "D:\pinokio\api\comfyui.git\app\custom_nodes\ComfyUI-3D-Pack\Gen_3D_Modules\Unique3D\scripts\project_mesh.py", line 98, in pix2faces_renderer = Pix2FacesRenderer() File "D:\pinokio\api\comfyui.git\app\custom_nodes\ComfyUI-3D-Pack\Gen_3D_Modules\Unique3D\scripts\project_mesh.py", line 70, in init self._glctx = dr.RasterizeGLContext(output_db=False, device=device) File "D:\pinokio\api\comfyui.git\app\env\lib\site-packages\nvdiffrast\torch\ops.py", line 221, in init__ self.cpp_wrapper = _get_plugin(gl=True).RasterizeGLStateWrapper(output_db, mode == 'automatic', cuda_device_idx) File "D:\pinokio\api\comfyui.git\app\env\lib\site-packages\nvdiffrast\torch\ops.py", line 118, in _get_plugin torch.utils.cpp_extension.load(name=plugin_name, sources=source_paths, extra_cflags=opts, extra_cuda_cflags=opts+['-lineinfo'], extra_ldflags=ldflags, with_cuda=True, verbose=False) File "D:\pinokio\api\comfyui.git\app\env\lib\site-packages\torch\utils\cpp_extension.py", line 1309, in load return _jit_compile( File "D:\pinokio\api\comfyui.git\app\env\lib\site-packages\torch\utils\cpp_extension.py", line 1719, in _jit_compile _write_ninja_file_and_build_library( File "D:\pinokio\api\comfyui.git\app\env\lib\site-packages\torch\utils\cpp_extension.py", line 1832, in _write_ninja_file_and_build_library _run_ninja_build( File "D:\pinokio\api\comfyui.git\app\env\lib\site-packages\torch\utils\cpp_extension.py", line 2123, in _run_ninja_build raise RuntimeError(message) from e RuntimeError: Error building extension 'nvdiffrast_plugin_gl': ninja: error: build.ninja:3: lexing error nvcc = D:\pinokio\bin\miniconda\bin\nvcc.exe ^ near here

Warn!: Cannot import D:\pinokio\api\comfyui.git\app\custom_nodes\ComfyUI-3D-Pack module for custom nodes: Error building extension 'nvdiffrast_plugin_gl': ninja: error: build.ninja:3: lexing error nvcc = D:\pinokio\bin\miniconda\bin\nvcc.exe ^ near here

Duodecimus commented 1 month ago

Ninja has some trouble building the nvdiffrast pyd files on windows. Open cmd, navigate to a folder in a place like C:\Users\Owner\AppData\Local\torch_extensions\torch_extensions\Cache\py311_cu121\nvdiffrast_plugin_gl check that the folder contains build.ninja run ninja build.ninja

This will fail, but it will tell you how it failed, so you can fix it. For me it was a bunch of pathing errors, and I had to add a number of visual studio paths to the build.ninja file's import list

NeoAnthropocene commented 1 month ago

Ninja has some trouble building the nvdiffrast pyd files on windows. Open cmd, navigate to a folder in a place like C:\Users\Owner\AppData\Local\torch_extensions\torch_extensions\Cache\py311_cu121\nvdiffrast_plugin_gl check that the folder contains build.ninja run ninja build.ninja

This will fail, but it will tell you how it failed, so you can fix it. For me it was a bunch of pathing errors, and I had to add a number of visual studio paths to the build.ninja file's import list

For my case it responds this: ninja: error: unknown target 'build.ninja'

Do you have any idea what should I do from here? Can you please give example to solve the path issue here?

eotamis commented 1 month ago

Ninja has some trouble building the nvdiffrast pyd files on windows. Open cmd, navigate to a folder in a place like C:\Users\Owner\AppData\Local\torch_extensions\torch_extensions\Cache\py311_cu121\nvdiffrast_plugin_gl check that the folder contains build.ninja run ninja build.ninja

This will fail, but it will tell you how it failed, so you can fix it. For me it was a bunch of pathing errors, and I had to add a number of visual studio paths to the build.ninja file's import list

I have tried to reinstall the 3d pack,

Ninja has some trouble building the nvdiffrast pyd files on windows. Open cmd, navigate to a folder in a place like C:\Users\Owner\AppData\Local\torch_extensions\torch_extensions\Cache\py311_cu121\nvdiffrast_plugin_gl check that the folder contains build.ninja run ninja build.ninja

This will fail, but it will tell you how it failed, so you can fix it. For me it was a bunch of pathing errors, and I had to add a number of visual studio paths to the build.ninja file's import list

on ninja 1.11 I am getting a lexing error for my ninja.build on line 3 "ninja: error: build.ninja:3: lexing error nvcc = D:\pinokio\bin\miniconda\bin\nvcc.exe"

**_and below is the latest my ninja.build file for reference. Any idea on possible syntax error which I can't seem to pinpoint? btw my miniconda nvcc.exe is hard linked as follows D:\pinokio\bin\miniconda\pkgs\cuda-nvcc-12.1.66-0\bin\nvcc.exe D:\pinokio\bin\miniconda\bin\nvcc.exe

do you think there is a cuda version conflict and if so how can I resolve it?_**

ninja_required_version = 1.3 cxx = cl nvcc = D:\pinokio\bin\miniconda\bin\nvcc.exe C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7\bin\nvcc.exe C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.5\bin\nvcc

cflags = -DTORCH_EXTENSION_NAME=nvdiffrast_plugin_gl -DTORCH_API_INCLUDE_EXTENSION_H -ID:\pinokio\api\comfyui.git\app\env\lib\site-packages\torch\include -ID:\pinokio\api\comfyui.git\app\env\lib\site-packages\torch\include\torch\csrc\api\include -ID:\pinokio\api\comfyui.git\app\env\lib\site-packages\torch\include\TH -ID:\pinokio\api\comfyui.git\app\env\lib\site-packages\torch\include\THC "-ID:\pinokio\bin\miniconda\bin\nvcc.exe C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7\bin\nvcc.exe C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.5\include" -ID:\pinokio\bin\miniconda\Include -D_GLIBCXX_USE_CXX11_ABI=0 /MD /wd4819 /wd4251 /wd4244 /wd4267 /wd4275 /wd4018 /wd4190 /wd4624 /wd4067 /wd4068 /EHsc /std:c++17 -DNVDR_TORCH post_cflags = cuda_cflags = -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 -DTORCH_EXTENSION_NAME=nvdiffrast_plugin_gl -DTORCH_API_INCLUDE_EXTENSION_H -ID:\pinokio\api\comfyui.git\app\env\lib\site-packages\torch\include -ID:\pinokio\api\comfyui.git\app\env\lib\site-packages\torch\include\torch\csrc\api\include -ID:\pinokio\api\comfyui.git\app\env\lib\site-packages\torch\include\TH -ID:\pinokio\api\comfyui.git\app\env\lib\site-packages\torch\include\THC "-ID:\pinokio\bin\miniconda\bin\nvcc.exe C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7\bin\nvcc.exe C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.5\include" -ID:\pinokio\bin\miniconda\Include -D_GLIBCXX_USE_CXX11_ABI=0 -DCUDA_NO_HALF_OPERATORS -DCUDA_NO_HALF_CONVERSIONS -DCUDA_NO_BFLOAT16_CONVERSIONS -DCUDA_NO_HALF2_OPERATORS --expt-relaxed-constexpr -gencode=arch=compute_86,code=compute_86 -gencode=arch=compute_86,code=sm_86 -std=c++17 -DNVDR_TORCH -lineinfo cuda_post_cflags = cuda_dlink_post_cflags = ldflags = /DLL /LIBPATH:D:\pinokio\api\comfyui.git\app\env\lib\site-packages\nvdiffrast\torch..\lib /DEFAULTLIB:gdi32 /DEFAULTLIB:opengl32 /DEFAULTLIB:user32 /DEFAULTLIB:setgpu c10.lib c10_cuda.lib torch_cpu.lib torch_cuda.lib -INCLUDE:?warp_size@cuda@at@@YAHXZ torch.lib /LIBPATH:D:\pinokio\api\comfyui.git\app\env\lib\site-packages\torch\lib torch_python.lib /LIBPATH:D:\pinokio\bin\miniconda\libs "/LIBPATH:D:\pinokio\bin\miniconda\bin\nvcc.exe C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7\bin\nvcc.exe C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.5\lib\x64" cudart.lib

rule compile command = cl /showIncludes $cflags -c $in /Fo$out $post_cflags deps = msvc

rule cuda_compile depfile = $out.d deps = gcc command = $nvcc --generate-dependencies-with-compile --dependency-output $out.d $cuda_cflags -c $in -o $out $cuda_post_cflags

rule link command = "C$:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\bin\Hostx64\x64/link.exe" $in /nologo $ldflags /out:$out

build common.o: compile D$:\pinokio\api\comfyui.git\app\env\lib\site-packages\nvdiffrast\common\common.cpp build glutil.o: compile D$:\pinokio\api\comfyui.git\app\env\lib\site-packages\nvdiffrast\common\glutil.cpp build rasterize_gl.o: compile D$:\pinokio\api\comfyui.git\app\env\lib\site-packages\nvdiffrast\common\rasterize_gl.cpp build torch_bindings_gl.o: compile D$:\pinokio\api\comfyui.git\app\env\lib\site-packages\nvdiffrast\torch\torch_bindings_gl.cpp build torch_rasterize_gl.o: compile D$:\pinokio\api\comfyui.git\app\env\lib\site-packages\nvdiffrast\torch\torch_rasterize_gl.cpp

build nvdiffrast_plugin_gl.pyd: link common.o glutil.o rasterize_gl.o torch_bindings_gl.o torch_rasterize_gl.o

default nvdiffrast_plugin_gl.pyd

WiseCodeArtist commented 1 week ago

Same here,Any progress?