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

ImportError: DLL load failed while importing _C #151

Open Scharwunzel opened 4 months ago

Scharwunzel commented 4 months ago

Hi, when I start ConfyUI I get the following error in the (German) CMD: Traceback (most recent call last): File "C:\ComfyUI\ComfyUI\nodes.py", line 1879, 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 "C:\ComfyUI\ComfyUI\custom_nodes\ComfyUI-3D-Pack__init.py", line 28, in module = importlib.import_module(f".{nodes_filename}", package=name) File "importlib\init.py", line 126, in import_module 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 "C:\ComfyUI\ComfyUI\custom_nodes\ComfyUI-3D-Pack\nodes.py", line 33, in from .algorithms.main_3DGS import GaussianSplatting, GaussianSplattingCameraController, GSParams File "C:\ComfyUI\ComfyUI\custom_nodes\ComfyUI-3D-Pack\algorithms\main_3DGS.py", line 12, in from .main_3DGS_renderer import GaussianSplattingRenderer File "C:\ComfyUI\ComfyUI\custom_nodes\ComfyUI-3D-Pack\algorithms\main_3DGS_renderer.py", line 24, in from diff_gaussian_rasterization import ( File "C:\ComfyUI\python_embeded\lib\site-packages\diff_gaussian_rasterization\init__.py", line 15, in from . import _C ImportError: DLL load failed while importing _C: Das angegebene Modul wurde nicht gefunden.

I already found out from the threat https://github.com/MrForExample/ComfyUI-3D-Pack/issues/77 that the error for others was due to the fact that they didn't install Visual Studio with C++, but I had this before installing Confyui and can't find a missing build either. Can someone maybe help me with what else could be the problem or where else I could look? Thank you in advance for any help!

YanWenKun commented 4 months ago

In my tests I found several DLL load failed while importing _C cases and it was simply fixed by downgrading PyTorch to 2.2.

I guess core packages like PyTorch3D are not yet ready for PyTorch 2.3.

zcfire2017 commented 4 months ago

@Scharwunzel
image Check if your cuda version is 12.1. Torch3d currently only supports at most Ao 12.1. Open cmd and enter "nvcc -- version". If there is cuda information, it means the driver has been installed. Check if the version is 12.1. If not, you need to reinstall cuda. After reinstalling, you need to run the installation command of ComfyUI-3D-Pack again

Scharwunzel commented 4 months ago

hi, sorry for the late reply and thank you für your help.

I have now tried both tips, unfortunately without success.

I have set PyTorch to "Version: 2.2.2+cu121"

The cuda version is also available at "Cuda compilation tools, release 12.1, V12.1.66 Build cuda_12.1.r12.1/compiler.32415258_0"

Both is showing while versions check in the cmd under \ComfyUI\python_embeded.

At start of Comfy there are following versions: "Current version of llama_cpp: 0.2.26+cu118 Current version of timm: 0.9.12 [ReActor] - STATUS - Running v0.5.0-b3 in ComfyUI Torch version: 2.3.0+cu118"

Do I have to do anything special for this to be taken over?

ColaCheese commented 4 months ago

Same problem here

YanWenKun commented 4 months ago

@Scharwunzel Try force-reinstall:

python.exe -s -m pip install --force-reinstall xformers==0.0.25.post1 torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121 --extra-index-url https://pypi.org/simple

(By xformers==0.0.25.post1 we imply using PyTorch 2.2.2)

Scharwunzel commented 4 months ago

@YanWenKun I get this Message with this command:

Screenshot 2024-05-24 002840
zpengcom commented 4 months ago

image

image

zpengcom commented 4 months ago

image

image

@Scharwunzel Try force-reinstall:

python.exe -s -m pip install --force-reinstall xformers==0.0.25.post1 torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121 --extra-index-url https://pypi.org/simple

(By xformers==0.0.25.post1 we imply using PyTorch 2.2.2)

It works for me. .🥰

YanWenKun commented 4 months ago

@Scharwunzel This error message was about other dependencies, you can ignore it, or:

python.exe -s -m pip install --force-reinstall pillow==9.5.0 numpy==1.25.2 cryptography
midnightrebels commented 3 months ago

Desktop Screenshot 2024 06 10 - 00 47 05 01

I am able to import 3D pack successfully however there's a few stuff that I don't understand. When force reinstalling xformers==0.0.25.post1, some lines shows "not on path". Is that why I'm seeing this future warning?

YanWenKun commented 3 months ago

@midnightrebels The warning in the screenshot is telling "some of the code is going to be outdated", and you can safely ignore it.