Skip to content

Please help, I am loosing my mind RuntimeError: Ninja is required to load C++ extensions #558

@gerroon

Description

@gerroon

Hi

I have been trying to get this working for like 24 hours, I just lost it. I need help desperately. How do I pass this error? The pac seems to install fine but next run I have these issues. Ninja installed under the python env. 5090 seems to require c128 I have already lost two nights of sleep :(


[INFO] Python Version: 3.12.3
[INFO] Platform: Windows-11-10.0.26100-SP0
   > PyTorch: 2.7.0+cu128
   > CUDA:    12.8
   > GPU:     NVIDIA GeForce RTX 5090
[OK] Environment matches RTX 5090 requirements.
------------------------------------------------------------
[OK] SUCCESS: spconv
      Location: c:\ComfyUI_windows_portable_nightly_pytorch\python_embeded\Lib\site-packages\spconv\pytorch\__init__.py
[OK] SUCCESS: nvdiffrast
      Location: c:\ComfyUI_windows_portable_nightly_pytorch\python_embeded\Lib\site-packages\nvdiffrast\torch\__init__.py
[OK] SUCCESS: simple_knn
      Location: None
[OK] SUCCESS: diff_gaussian_rasterization
      Location: c:\ComfyUI_windows_portable_nightly_pytorch\python_embeded\Lib\site-packages\diff_gaussian_rasterization\__init__.py
[OK] SUCCESS: kiui
      Location: c:\ComfyUI_windows_portable_nightly_pytorch\python_embeded\Lib\site-packages\kiui\__init__.py
[OK] SUCCESS: pytorch3d
      Location: c:\ComfyUI_windows_portable_nightly_pytorch\python_embeded\Lib\site-packages\pytorch3d\__init__.py


ice: cuda:0 NVIDIA GeForce RTX 5090 : cudaMallocAsync
Using async weight offloading with 2 streams
Enabled pinned memory 29210.0
WARNING: You need pytorch with cu130 or higher to use optimized CUDA operations.
Found comfy_kitchen backend eager: {'available': True, 'disabled': False, 'unavailable_reason': None, 'capabilities': ['apply_rope', 'apply_rope1', 'dequantize_nvfp4', 'dequantize_per_tensor_fp8', 'quantize_nvfp4', 'quantize_per_tensor_fp8', 'scaled_mm_nvfp4']}
Found comfy_kitchen backend triton: {'available': True, 'disabled': True, 'unavailable_reason': None, 'capabilities': ['apply_rope', 'apply_rope1', 'dequantize_nvfp4', 'dequantize_per_tensor_fp8', 'quantize_nvfp4', 'quantize_per_tensor_fp8']}
Found comfy_kitchen backend cuda: {'available': True, 'disabled': True, 'unavailable_reason': None, 'capabilities': ['apply_rope', 'apply_rope1', 'dequantize_nvfp4', 'dequantize_per_tensor_fp8', 'quantize_nvfp4', 'quantize_per_tensor_fp8', 'scaled_mm_nvfp4']}
Using sage attention
Python version: 3.12.3 (tags/v3.12.3:f6650f9, Apr  9 2024, 14:05:25) [MSC v.1938 64 bit (AMD64)]
ComfyUI version: 0.10.0
ComfyUI frontend version: 1.36.14
[Prompt Server] web root: c:\ComfyUI_windows_portable_nightly_pytorch\python_embeded\Lib\site-packages\comfyui_frontend_package\static
c:\ComfyUI_windows_portable_nightly_pytorch\python_embeded\Lib\site-packages\kiui\nn\__init__.py:31: FutureWarning: `torch.cuda.amp.custom_fwd(args...)` is deprecated. Please use `torch.amp.custom_fwd(args..., device_type='cuda')` instead.
  @torch.cuda.amp.custom_fwd(cast_inputs=torch.float32)

c:\ComfyUI_windows_portable_nightly_pytorch\python_embeded\Lib\site-packages\kiui\nn\__init__.py:37: FutureWarning: `torch.cuda.amp.custom_bwd(args...)` is deprecated. Please use `torch.amp.custom_bwd(args..., device_type='cuda')` instead.
  @torch.cuda.amp.custom_bwd

Warn!: xFormers is available (Attention)
Warn!: c:\ComfyUI_windows_portable_nightly_pytorch\python_embeded\Lib\site-packages\slangtorch\slangtorch.py:3: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81.
  import pkg_resources

Warn!: c:\ComfyUI_windows_portable_nightly_pytorch\python_embeded\Lib\site-packages\setuptools\_distutils\_msvccompiler.py:12: UserWarning: _get_vc_env is private; find an alternative (pypa/distutils#340)
  warnings.warn(

Warn!: Traceback (most recent call last):
  File "c:\ComfyUI_windows_portable_nightly_pytorch\ComfyUI\nodes.py", line 2158, in load_custom_node
    module_spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 995, in exec_module
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "c:\ComfyUI_windows_portable_nightly_pytorch\ComfyUI\custom_nodes\ComfyUI-3D-Pack\__init__.py", line 54, in <module>
    module = importlib.import_module(f".{nodes_filename}", package=__name__)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "importlib\__init__.py", line 90, in import_module
  File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 995, in exec_module
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "c:\ComfyUI_windows_portable_nightly_pytorch\ComfyUI\custom_nodes\ComfyUI-3D-Pack\nodes.py", line 85, in <module>
    from Unique3D.scripts.project_mesh import multiview_color_projection, multiview_color_projection_texture, get_cameras_list, get_orbit_cameras_list
  File "c:\ComfyUI_windows_portable_nightly_pytorch\ComfyUI\custom_nodes\ComfyUI-3D-Pack\Gen_3D_Modules\Unique3D\scripts\project_mesh.py", line 99, in <module>
    pix2faces_renderer = Pix2FacesRenderer()
                         ^^^^^^^^^^^^^^^^^^^
  File "c:\ComfyUI_windows_portable_nightly_pytorch\ComfyUI\custom_nodes\ComfyUI-3D-Pack\Gen_3D_Modules\Unique3D\scripts\project_mesh.py", line 71, in __init__
    self._glctx = dr.RasterizeCudaContext(device=device)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "c:\ComfyUI_windows_portable_nightly_pytorch\python_embeded\Lib\site-packages\nvdiffrast\torch\ops.py", line 184, in __init__
    self.cpp_wrapper = _get_plugin().RasterizeCRStateWrapper(cuda_device_idx)
                       ^^^^^^^^^^^^^
  File "c:\ComfyUI_windows_portable_nightly_pytorch\python_embeded\Lib\site-packages\nvdiffrast\torch\ops.py", line 125, in _get_plugin
    torch.utils.cpp_extension.load(name=plugin_name, sources=source_paths, extra_cflags=common_opts+cc_opts, extra_cuda_cflags=common_opts+['-lineinfo'], extra_ldflags=ldflags, with_cuda=True, verbose=False)
  File "c:\ComfyUI_windows_portable_nightly_pytorch\python_embeded\Lib\site-packages\torch\utils\cpp_extension.py", line 1623, in load
    return _jit_compile(
           ^^^^^^^^^^^^^
  File "c:\ComfyUI_windows_portable_nightly_pytorch\python_embeded\Lib\site-packages\torch\utils\cpp_extension.py", line 2076, in _jit_compile
    _write_ninja_file_and_build_library(
  File "c:\ComfyUI_windows_portable_nightly_pytorch\python_embeded\Lib\site-packages\torch\utils\cpp_extension.py", line 2180, in _write_ninja_file_and_build_library
    verify_ninja_availability()
  File "c:\ComfyUI_windows_portable_nightly_pytorch\python_embeded\Lib\site-packages\torch\utils\cpp_extension.py", line 2241, in verify_ninja_availability
    raise RuntimeError("Ninja is required to load C++ extensions")
RuntimeError: Ninja is required to load C++ extensions

Warn!: Cannot import c:\ComfyUI_windows_portable_nightly_pytorch\ComfyUI\custom_nodes\ComfyUI-3D-Pack module for custom nodes: Ninja is required to load C++ extensions
[ComfyUI-Easy-Use] server: v1.3.4 Loaded
[ComfyUI-Easy-Use] web root: c:\ComfyUI_windows_portable_nightly_pytorch\ComfyUI\custom_nodes\comfyui-easy-use\web_version/v2 Loaded
[GeomPack] CGAL Python package found - CGAL Isotropic Remesh node available


Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions