Skip to content

Commit 9fc3d5f

Browse files
author
Konstantin Maslyuk
committed
Fix eglInitialize() failed issue
1 parent 0958d84 commit 9fc3d5f

File tree

3 files changed

+88
-9
lines changed

3 files changed

+88
-9
lines changed

Dockerfile

Lines changed: 48 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,22 @@ RUN apt-get update && \
88
curl \
99
ffmpeg \
1010
git \
11-
libgl1 libglib2.0-0 \
12-
libgl1-mesa-glx libglib2.0-0 libsm6 libxrender1 libxext6 \
11+
# TODO not sure all of this is required, remove unnnecessary
12+
libegl1 \
1313
libegl1-mesa-dev \
14+
libgl1 \
15+
libglib2.0-0 \
16+
libgl1-mesa-dev \
17+
libgl1-mesa-glx \
18+
libgles2 \
19+
libgles2-mesa-dev \
20+
libglib2.0-0 \
21+
libglvnd-dev \
22+
libglvnd0 \
23+
libglx0 \
24+
libsm6 \
25+
libxext6 \
26+
libxrender1 \
1427
ninja-build \
1528
python3.11 \
1629
python3.11-dev \
@@ -26,6 +39,19 @@ RUN adduser --uid 1001 -q user && \
2639
mkdir /app && chown user /app
2740
USER user
2841

42+
ENV PYTHONDONTWRITEBYTECODE=1
43+
ENV PYTHONUNBUFFERED=1
44+
45+
# for GLEW
46+
ENV LD_LIBRARY_PATH /usr/lib64:$LD_LIBRARY_PATH
47+
48+
# nvidia-container-runtime
49+
ENV NVIDIA_VISIBLE_DEVICES all
50+
ENV NVIDIA_DRIVER_CAPABILITIES compute,utility,graphics
51+
52+
# Default pyopengl to EGL for good headless rendering support
53+
ENV PYOPENGL_PLATFORM egl
54+
2955
RUN pip install --no-cache --index-url https://download.pytorch.org/whl/cu121 \
3056
torch==2.2.0 torchvision==0.17.0 xformers==0.0.24
3157

@@ -35,15 +61,32 @@ RUN git clone "https://github.com/comfyanonymous/ComfyUI.git" ./ && \
3561
RUN pip install --no-cache -r requirements.txt
3662

3763
WORKDIR /app/custom_nodes/ComfyUI-3D-Pack/
38-
COPY --chown=user:user ./ ./
39-
64+
COPY --chown=user:user requirements.txt requirements_post.txt ./
65+
COPY --chown=user:user simple-knn/ simple-knn/
66+
COPY --chown=user:user tgs/ tgs/
4067
RUN pip install --no-cache -r requirements.txt \
4168
# post requirements installation require gpu, setup
4269
# `nvidia-container-runtime`, for docker, see
43-
# https://stackoverflow.com/a/61737404
70+
# https://stackoverflow.com/a/61737404
4471
-r requirements_post.txt \
4572
# those seem to be missed
4673
ninja scikit-learn rembg[gpu] open_clip_torch
4774

75+
WORKDIR /app/custom_nodes/
76+
RUN git clone "https://github.com/ltdrdata/ComfyUI-Impact-Pack" && \
77+
cd ComfyUI-Impact-Pack && \
78+
git reset --hard e1570e76799049fb0038f6232fd89800ab4565eb && \
79+
pip install --no-cache -r requirements.txt
80+
RUN git clone "https://github.com/kijai/ComfyUI-KJNodes" && \
81+
cd ComfyUI-KJNodes && \
82+
git reset --hard 95ae8b067a8aa5825471189954579ffa02aa9256 && \
83+
pip install --no-cache -r requirements.txt
84+
RUN git clone "https://github.com/Kosinkadink/ComfyUI-VideoHelperSuite" && \
85+
cd ComfyUI-VideoHelperSuite && \
86+
git reset --hard f94597739f20dac331f9918a245149b6b00a60f2 && \
87+
pip install --no-cache -r requirements.txt
88+
89+
COPY --chown=user:user ./ ComfyUI-3D-Pack/
90+
4891
WORKDIR /app
4992
ENTRYPOINT [ "python", "main.py", "--listen", "0.0.0.0" ]

README.md

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -198,9 +198,41 @@ pip install -r requirements_post.txt
198198
**Plus:**<br>
199199
- For those who want to run it inside Google Colab, you can check the [install instruction from @lovisdotio](https://github.com/MrForExample/ComfyUI-3D-Pack/issues/13)
200200

201-
#### Install with docker:
202-
203-
`docker build -t test . && docker run --rm -it -p8188:8188 test`
201+
#### Install and run with docker:
202+
203+
Gpu support during Docker build time is required to install all requirenents.
204+
On Linux host you could setup `nvidia-container-runtime`. On Windows
205+
it is quite different and not checked at moment.
206+
207+
##### Linux setup:
208+
209+
1. Install nvidia-container-runtime:
210+
```bash
211+
sudo apt-get install nvidia-container-runtime
212+
```
213+
214+
1. Edit/create the /etc/docker/daemon.json with content:
215+
```json
216+
{
217+
"runtimes": {
218+
"nvidia": {
219+
"path": "/usr/bin/nvidia-container-runtime",
220+
"runtimeArgs": []
221+
}
222+
},
223+
"default-runtime": "nvidia"
224+
}
225+
```
226+
227+
1. Restart docker daemon:
228+
```bash
229+
sudo systemctl restart docker
230+
```
231+
232+
Finally build and run docker container with:
233+
```bash
234+
docker build -t comfy3d . && docker run --rm -it -p 8188:8188 --gpus all comfy3d
235+
```
204236

205237
## Run:
206238
Copy the files inside folder [__New_ComfyUI_Bats](./_New_ComfyUI_Bats/) to your ComfyUI root directory, and double click run_nvidia_gpu_miniconda.bat to start ComfyUI!

configs/system.conf

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
web{
22
clients_ip = [
33
127.0.0.1,
4-
0.0.0.0
4+
0.0.0.0,
5+
// docker have default ip for host in container of subnet 172.17.0.0/16
6+
// althrought there would be 172.18.0.0
7+
172.17.0.0,
8+
172.17.0.1,
59
]
610
}

0 commit comments

Comments
 (0)