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.16k stars 212 forks source link

Error building extension 'nvdiffrast_plugin_gl': ninja: error: build.ninja:3: lexing error #296

Open mufenglyf opened 1 week ago

mufenglyf commented 1 week ago

This problem has been bothering me all day. I have changed many versions of Comfyui, but they are all stuck here

File "D:\program_files\ComfyUIv0.22_3dpack\ComfyUI\custom_nodes\ComfyUI-3D-Pack\nodes.py", line 80, in from Unique3D.scripts.project_mesh import multiview_color_projection, get_cameras_list File "D:\program_files\ComfyUIv0.22_3dpack\ComfyUI\custom_nodes\ComfyUI-3D-Pack\Gen_3D_Modules\Unique3D\scripts\project_mesh.py", line 98, in pix2faces_renderer = Pix2FacesRenderer() ^^^^^^^^^^^^^^^^^^^ File "D:\program_files\ComfyUIv0.22_3dpack\ComfyUI\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:\program_files\ComfyUIv0.22_3dpack\python_embeded\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:\program_files\ComfyUIv0.22_3dpack\python_embeded\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:\program_files\ComfyUIv0.22_3dpack\python_embeded\Lib\site-packages\torch\utils\cpp_extension.py", line 1309, in load return _jit_compile( ^^^^^^^^^^^^^ File "D:\program_files\ComfyUIv0.22_3dpack\python_embeded\Lib\site-packages\torch\utils\cpp_extension.py", line 1719, in _jit_compile _write_ninja_file_and_build_library( File "D:\program_files\ComfyUIv0.22_3dpack\python_embeded\Lib\site-packages\torch\utils\cpp_extension.py", line 1832, in _write_ninja_file_and_build_library _run_ninja_build( File "D:\program_files\ComfyUIv0.22_3dpack\python_embeded\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

Warn!: Cannot import D:\program_files\ComfyUIv0.22_3dpack\ComfyUI\custom_nodes\ComfyUI-3D-Pack module for custom nodes: Error building extension 'nvdiffrast_plugin_gl': ninja: error: build.ninja:3: lexing error

gfxenjoyer commented 1 week ago

I had a similar issue and was able to build nvdiffrast. See this issue https://github.com/MrForExample/ComfyUI-3D-Pack/issues/220#issuecomment-2334815082. It may also help to enable long paths on your machine see this. I have the latest Visual Studio 2022 installed, and my path to cl.exe is C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\bin\Hostx64\x64.

mufenglyf commented 1 week ago

我遇到了类似的问题,并且能够构建 nvdiffrast。请参阅此问题 #220 (评论)。在您的机器上启用长路径也可能有所帮助,请参阅此内容。我安装了最新的 Visual Studio 2022,我的路径是 。cl.exe``C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\bin\Hostx64\x64

Thank you very much. I tried it this afternoon but it still didn't work. I'm not sure if it's because I installed three versions of CUDA. I will provide feedback on the test results

mufenglyf commented 1 week ago

我遇到了类似的问题,并且能够构建 nvdiffrast。请参阅此问题 #220 (评论)。在您的机器上启用长路径也可能有所帮助,请参阅此内容。我安装了最新的 Visual Studio 2022,我的路径是 。cl.exeC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\bin\Hostx64\x64 ``

Thank you very much. I tried it this afternoon but it still didn't work. I'm not sure if it's because I installed three versions of CUDA. I will provide feedback on the test results

It is indeed an issue with multiple CUDA versions. I blocked all versions except 12.1 in the environment variables, and the problem was solved. Thank you for your answer. I rolled back Studio 2022 to 17.8.6