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

eglInitialize() failed in a docker container #142

Open wangbicheng opened 5 months ago

wangbicheng commented 5 months ago

i am trying to launch a 3d workflow in a docker container mannualy, because of the failure of building docker images #141 i build a image comfyui:1.1 from base image nvidia/cuda:12.1.1-devel-ubuntu22.04.

sudo docker run --name comfyui-3d-1 --gpus all --network host -it -e NVIDIA_VISIBLE_DEVICES=all -e NVIDIA_DRIVER_CAPABILITIES=compute,utility,graphics comfyui:1.1

when i lauch a workflow and queue prompt, i got this error as follows.

(venv310) root@brett-ai:/ComfyUI# python main.py --listen --disable-cuda-malloc
** ComfyUI startup time: 2024-04-27 08:26:29.879466
** Platform: Linux
** Python version: 3.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.0]
** Python executable: /ComfyUI/venv310/bin/python
** Log path: /ComfyUI/comfyui.log

Prestartup times for custom nodes:
   0.0 seconds: /ComfyUI/custom_nodes/rgthree-comfy
   0.1 seconds: /ComfyUI/custom_nodes/ComfyUI-Manager

Total VRAM 45416 MB, total RAM 64289 MB
xformers version: 0.0.25.post1
Set vram state to: NORMAL_VRAM
Device: cuda:0 NVIDIA A40 : native
VAE dtype: torch.bfloat16
Using xformers cross attention
Total VRAM 45416 MB, total RAM 64289 MB
xformers version: 0.0.25.post1
Set vram state to: NORMAL_VRAM
Device: cuda:0 NVIDIA A40 : native
VAE dtype: torch.bfloat16
/ComfyUI/custom_nodes/ComfyUI-3D-Pack/lgm/core/attention.py:22: UserWarning: xFormers is available (Attention)
  warnings.warn("xFormers is available (Attention)")
(pysssss:WD14Tagger) [DEBUG] Available ORT providers: AzureExecutionProvider, CPUExecutionProvider
(pysssss:WD14Tagger) [DEBUG] Using ORT providers: CUDAExecutionProvider, CPUExecutionProvider
------------------------------------------
Comfyroll Studio v1.76 :  175 Nodes Loaded
------------------------------------------
** For changes, please see patch notes at https://github.com/Suzie1/ComfyUI_Comfyroll_CustomNodes/blob/main/Patch_Notes.md
** For help, please see the wiki at https://github.com/Suzie1/ComfyUI_Comfyroll_CustomNodes/wiki
------------------------------------------
### Loading: ComfyUI-Manager (V2.23.1)
### ComfyUI Revision: 2146 [7990ae18] | Released on '2024-04-26'

[rgthree] Loaded 37 exciting nodes.
[rgthree] Will use rgthree's optimized recursive execution.

### [START] ComfyUI AlekPet Nodes ###
Node -> ExtrasNode [Loading]
Node -> DeepTranslatorNode [Loading]
[ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/model-list.json
[ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/alter-list.json
[ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/custom-node-list.json
[ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/extension-node-map.json
Node -> PainterNode [Loading]
Node -> ArgosTranslateNode [Loading]
Node -> GoogleTranslateNode [Loading]
Node -> PoseNode [Loading]
### [END] ComfyUI AlekPet Nodes ###

Import times for custom nodes:
   0.0 seconds: /ComfyUI/custom_nodes/websocket_image_save.py
   0.0 seconds: /ComfyUI/custom_nodes/ComfyUI-WD14-Tagger
   0.0 seconds: /ComfyUI/custom_nodes/ComfyUI-Custom-Scripts
   0.0 seconds: /ComfyUI/custom_nodes/masquerade-nodes-comfyui
   0.0 seconds: /ComfyUI/custom_nodes/ComfyUI_Comfyroll_CustomNodes
   0.0 seconds: /ComfyUI/custom_nodes/rgthree-comfy
   0.0 seconds: /ComfyUI/custom_nodes/ComfyUI-Manager
   0.1 seconds: /ComfyUI/custom_nodes/ComfyUI-VideoHelperSuite
   0.2 seconds: /ComfyUI/custom_nodes/comfyui_segment_anything
   0.4 seconds: /ComfyUI/custom_nodes/ComfyUI-KJNodes
   1.2 seconds: /ComfyUI/custom_nodes/ComfyUI-3D-Pack
   5.8 seconds: /ComfyUI/custom_nodes/ComfyUI_Custom_Nodes_AlekPet

Starting server

To see the GUI go to: http://0.0.0.0:8188
FETCH DATA from: /ComfyUI/custom_nodes/ComfyUI-Manager/extension-node-map.json
got prompt
[rgthree] Using rgthree's optimized recursive execution.
[rgthree] First run patching recursive_output_delete_if_changed and recursive_will_execute.
[rgthree] Note: If execution seems broken due to forward ComfyUI changes, you can disable the optimization from rgthree settings in ComfyUI.
[Deep Translator] Service: "GoogleTranslator"
[Deep Translator] Proxy disabled or input field is empty!
[Deep Translator] Authorization input field is empty!
Deep Translator] Service detect language disabled! Services support: DeeplTranslator, QcriTranslator, LingueeTranslator, PonsTranslator, PapagoTranslator, BaiduTranslator, MyMemoryTranslator.
The selected service has its own way of detecting the language.
Property "detect_lang_api_key" in Authorization data is empty or incorrect!
<All keys matched successfully>
/ComfyUI/venv310/lib/python3.10/site-packages/torch/functional.py:507: UserWarning: torch.meshgrid: in an upcoming release, it will be required to pass the indexing argument. (Triggered internally at ../aten/src/ATen/native/TensorShape.cpp:3549.)
  return _VF.meshgrid(tensors, **kwargs)  # type: ignore[attr-defined]
final text_encoder_type: bert-base-uncased
/ComfyUI/venv310/lib/python3.10/site-packages/transformers/modeling_utils.py:1051: FutureWarning: The `device` argument is deprecated and will be removed in v5 of Transformers.
  warnings.warn(
/ComfyUI/venv310/lib/python3.10/site-packages/torch/utils/checkpoint.py:460: UserWarning: torch.utils.checkpoint: please pass in use_reentrant=True or use_reentrant=False explicitly. The default value of use_reentrant will be updated to be False in the future. To maintain current behavior, pass use_reentrant=True. It is recommended that you use use_reentrant=False. Refer to docs for more details on the differences between the two variants.
  warnings.warn(
/ComfyUI/venv310/lib/python3.10/site-packages/torch/utils/checkpoint.py:90: UserWarning: None of the inputs have requires_grad=True. Gradients will be None
  warnings.warn(
model_type V_PREDICTION_EDM
Using xformers attention in VAE
Using xformers attention in VAE
Requested to load CLIPVisionModelProjection
Loading 1 new model
Requested to load AutoencoderKL
Loading 1 new model
Requested to load SV3D_u
Loading 1 new model
100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 50/50 [01:06<00:00,  1.33s/it]
<All keys matched successfully>
final text_encoder_type: bert-base-uncased
[Comfy3D] [Load_Large_Multiview_Gaussian_Model] loaded model ckpt from /ComfyUI/custom_nodes/ComfyUI-3D-Pack/checkpoints/lgm/model_fp16.safetensors
Number of points at loading :  40169
[F glutil.cpp:338] eglInitialize() failed
Aborted (core dumped)

it seems that there is something wrong with RenderGL. thanks a lot for help.

wangbicheng commented 5 months ago

https://github.com/NVlabs/nvdiffrast/blob/main/docker/Dockerfile this seems can help. create /usr/share/glvnd/egl_vendor.d/10_nvidia.json as follows.

{
    "file_format_version" : "1.0.0",
    "ICD" : {
        "library_path" : "libEGL_nvidia.so.0"
    }
}
BennyKok commented 2 months ago

@wangbicheng I am having the same problem, did adding the 10_nvidia.json worked for you?