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.21k stars 221 forks source link

Loading Nodes Error: Missing libcudart.so.12 from diff_gaussian_rasterization #233

Open gwyllo opened 2 months ago

gwyllo commented 2 months ago

I am trying to install ComfyUI-3D-Pack in a docker image on vast.ai (https://link.ai-dock.org/template-vast-comfyui). The docker image uses a micromamba environment for Comfy UI.

The docker image uses Python 3.10 and Cuda 11.8 on Ubuntu 22.04. So there should be pre-built wheels for ComfyUI-3D-Pack dependencies for this configuration (thank you!).

Trying to install ComfyUI-3D-Pack from the manager within this setup fails because Cuda Toolkit is not installed in this image and nvcc is not found. To address this we can run:

wget https://developer.download.nvidia.com/compute/cuda/11.8.0/local_installers/cuda_11.8.0_520.61.05_linux.run
sudo sh cuda_11.8.0_520.61.05_linux.run

export PATH="/usr/local/cuda-11.8/bin:$PATH"
export LD_LIBRARY_PATH="/usr/local/cuda-11.8/lib64:$LD_LIBRARY_PATH"
export CUDA_HOME="/usr/local/cuda-11.8/"

which nvcc

After which point ComfyUI-3D-Pack will install but nodes will not load. Inspecting the Comfy logs shows that the root cause is:

Traceback (most recent call last):
  File "/workspace/ComfyUI/nodes.py", line 1864, in load_custom_node
    module_spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/workspace/ComfyUI/custom_nodes/ComfyUI-3D-Pack/__init__.py", line 47, in <module>
    module = importlib.import_module(f".{nodes_filename}", package=__name__)
  File "/opt/micromamba/envs/comfyui/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/workspace/ComfyUI/custom_nodes/ComfyUI-3D-Pack/nodes.py", line 51, in <module>
    from GaussianSplatting.main_3DGS import GaussianSplatting3D, GaussianSplattingCameraController, GSParams
  File "/workspace/ComfyUI/custom_nodes/ComfyUI-3D-Pack/MVs_Algorithms/GaussianSplatting/main_3DGS.py", line 10, in <module>
    from .main_3DGS_renderer import GaussianSplattingRenderer
  File "/workspace/ComfyUI/custom_nodes/ComfyUI-3D-Pack/MVs_Algorithms/GaussianSplatting/main_3DGS_renderer.py", line 24, in <module>
    from diff_gaussian_rasterization import (
  File "/opt/micromamba/envs/comfyui/lib/python3.10/site-packages/diff_gaussian_rasterization/__init__.py", line 15, in <module>
    from . import _C
ImportError: libcudart.so.12: cannot open shared object file: No such file or directory

[2024-07-23 00:42] Cannot import /workspace/ComfyUI/custom_nodes/ComfyUI-3D-Pack module for custom nodes: libcudart.so.12: cannot open shared object file: No such file or directory

I have also tried cloning the repository and then installing requirements and running python install.py (though this does the same thing as the manager, as expected). I have also tried re-building the wheels for the dependencies for this specific configuration of python and cuda. In both cases, I end up with the same missing library on loading nodes.

Does anyone have any tips for how to build this library against the installed version of cuda (11.8)? Or can someone recommend a docker image with installation instructions for ComfyUI-3D-Pack?

Erwin11 commented 2 months ago

Same issues.

image

python: 3.10.8
pytorch version: 2.3.0+cu118
xformers version: 0.0.26.post1+cu118

MrForExample commented 2 months ago

@gwyllo Hi, have you checked DOCKER_INSTRUCTIONS.md

kkkstya commented 2 months ago

Same issue

gwyllo commented 2 months ago

@gwyllo Hi, have you checked DOCKER_INSTRUCTIONS.md

I hadn't, since I was hoping not to have to build one. But I did give this a go today and running this docker image on vast works right out of the box - thank you. If anyone else wants to run Comfy3D on vast.ai, I have a template set up here: https://cloud.vast.ai/?ref_id=147025&template_id=8f01a5962b279c6fdf9dd77587b19c95

GFY2000 commented 2 months ago
Snipaste_2024-08-01_15-43-10

我也遇到了同样的问题,是否有解决方案呢