Skip to content

Conversation

@JustinLungu
Copy link

This pull request updates the Dockerfile to ensure compatibility with recent changes in the Kaolin repository.

  • Pre-installing Cython>=0.29.37, pygltflib, and ipython<8.13> to avoid build-time failures during setup.py develop
  • Switched to CUDA 12.1 and PyTorch 2.1.0+cu121 for compatibility with my RTX 4070. (following the exact setup described in Issue #27; these changes can be reverted if desired).
  • Verified that Kaolin builds successfully and FoundationPose runs correctly using run_demo.py.
  • Restructured the apt-get install section in the Dockerfile and run_container.sh script for improved readability.

Closes: #336

@Nan-Tetheria
Copy link

Hi @JustinLungu , thanks a lot for this PR, especially the updates for CUDA 12.1 and the verified build on RTX 4070. I would like to validate it on my laptop with RTX 4070.

I have one quick clarification question regarding the Docker setup:

Did you build and test this PR using the official FoundationPose Docker image (docker pull wenbowen123/foundationpose)
or the community-maintained custom image (shingarey/foundationpose_custom_cuda121:latest)?

Thanks!

@alexermolovich
Copy link

Hi @JustinLungu, thanks for this PR. It helped me get it to build on my RTX A4000. I ran into a small issue during the build, specifically with the Conda environment requiring acceptance of the Terms of Service. The error was:

13.36 To accept these channels' Terms of Service, run the following commands: 13.36 conda tos accept --override-channels --channel https://repo.anaconda.com/pkgs/main 13.36 conda tos accept --override-channels --channel https://repo.anaconda.com/pkgs/r

I modified the Dockerfile slightly, particularly the Miniconda installation part, to automatically accept these terms:

RUN cd / && wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /miniconda.sh && \ /bin/bash /miniconda.sh -b -p /opt/conda &&\ ln -s /opt/conda/etc/profile.d/conda.sh /etc/profile.d/conda.sh &&\ echo ". /opt/conda/etc/profile.d/conda.sh" >> ~/.bashrc &&\ /bin/bash -c "source ~/.bashrc" && \ /opt/conda/bin/conda tos accept --override-channels --channel https://repo.anaconda.com/pkgs/main && \ /opt/conda/bin/conda tos accept --override-channels --channel https://repo.anaconda.com/pkgs/r && \ /opt/conda/bin/conda update -n base -c defaults conda -y &&\ /opt/conda/bin/conda create -n my python=3.8

Thanks

@prrw
Copy link

prrw commented Jan 16, 2026

Hey guys,

I tried to build the image again from scratch since the current Dockerfile is outdated for new GPUs. Here is my updated Dockerfile. I have tested it by building with bash build_all.sh and by running the run_demo.py and it was successful.

FROM pytorch/pytorch:2.1.0-cuda12.1-cudnn8-devel

ENV TZ=US/Pacific
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

RUN apt-get update --fix-missing && \
    apt-get install -y libgtk2.0-dev && \
    apt-get install -y wget bzip2 ca-certificates curl git vim tmux g++ gcc build-essential cmake checkinstall gfortran libjpeg8-dev libtiff5-dev pkg-config yasm libavcodec-dev libavformat-dev libswscale-dev libdc1394-22-dev libxine2-dev libv4l-dev qt5-default libgtk2.0-dev libtbb-dev libatlas-base-dev libfaac-dev libmp3lame-dev libtheora-dev libvorbis-dev libxvidcore-dev libopencore-amrnb-dev libopencore-amrwb-dev x264 v4l-utils libprotobuf-dev protobuf-compiler libgoogle-glog-dev libgflags-dev libgphoto2-dev libhdf5-dev doxygen libflann-dev libboost-all-dev proj-data libproj-dev libyaml-cpp-dev cmake-curses-gui libzmq3-dev freeglut3-dev


RUN cd / && git clone https://github.com/pybind/pybind11 &&\
    cd pybind11 && git checkout v2.10.0 &&\
    mkdir build && cd build && cmake .. -DCMAKE_BUILD_TYPE=Release -DPYBIND11_INSTALL=ON -DPYBIND11_TEST=OFF &&\
    make -j6 && make install


RUN cd / && wget https://gitlab.com/libeigen/eigen/-/archive/3.4.0/eigen-3.4.0.tar.gz &&\
    tar xvzf ./eigen-3.4.0.tar.gz &&\
    cd eigen-3.4.0 &&\
    mkdir build &&\
    cd build &&\
    cmake .. &&\
    make install

SHELL ["/bin/bash", "--login", "-c"]

RUN pip install "git+https://github.com/facebookresearch/pytorch3d.git@stable" &&\
    pip install Cython scipy joblib scikit-learn ruamel.yaml trimesh pyyaml opencv-python==4.10.0.82 imageio open3d transformations warp-lang einops kornia pyrender

RUN cd / && git clone --recursive https://github.com/NVIDIAGameWorks/kaolin
RUN cd /kaolin && FORCE_CUDA=1 python setup.py develop

ENV TORCH_CUDA_ARCH_LIST="8.9"
ENV CUDA_HOME=/usr/local/cuda

RUN cd / && git clone https://github.com/NVlabs/nvdiffrast &&\
    cd /nvdiffrast && pip install . --no-build-isolation

ENV OPENCV_IO_ENABLE_OPENEXR=1

RUN pip install scikit-image meshcat webdataset omegaconf pypng roma seaborn opencv-contrib-python==4.10.0.82 opencv-python-headless==4.10.0.82 openpyxl wandb imgaug Ninja xlsxwriter timm albumentations xatlas rtree nodejs ipykernel==6.29.0 jupyterlab jupyter-client==7.4.9 objaverse g4f ultralytics==8.0.120 pycocotools videoio numba numpy==1.26.4 h5py


ENV SHELL=/bin/bash
RUN ln -sf /bin/bash /bin/sh

Basically I just did the changes as mentioned by Issue #27. Over and above that, I am not using conda since it is already inside my docker environment. I had to downgrade some packages like Numpy, jupyter-client, opencv, etc to make it compatible. If in future there are further issues with this Dockerfile due to updates, I am attaching the output of my pip list

Package                   Version      Editable project location
------------------------- ------------ -------------------------
addict                    2.4.0
aiohappyeyeballs          2.6.1
aiohttp                   3.13.3
aiosignal                 1.4.0
albucore                  0.0.24
albumentations            2.0.8
annotated-types           0.7.0
antlr4-python3-runtime    4.9.3
anyio                     4.12.1
argon2-cffi               25.1.0
argon2-cffi-bindings      25.1.0
arrow                     1.4.0
asttokens                 2.0.5
astunparse                1.6.3
async-lru                 2.0.5
async-timeout             5.0.1
attrs                     23.1.0
babel                     2.17.0
backcall                  0.2.0
beautifulsoup4            4.12.2
bleach                    6.3.0
blinker                   1.9.0
boltons                   23.0.0
braceexpand               0.1.7
brotli                    1.2.0
brotlipy                  0.7.0
certifi                   2023.7.22
cffi                      1.15.1
chardet                   4.0.0
charset-normalizer        2.0.4
click                     8.3.1
comm                      0.2.3
conda                     23.9.0
conda-build               3.27.0
conda-content-trust       0.2.0
conda_index               0.3.0
conda-libmamba-solver     23.7.0
conda-package-handling    2.2.0
conda_package_streaming   0.9.0
ConfigArgParse            1.7.1
contourpy                 1.3.2
cryptography              41.0.3
cycler                    0.12.1
Cython                    3.2.4
dash                      3.3.0
dataclasses-json          0.6.7
debugpy                   1.8.19
decorator                 5.1.1
defusedxml                0.7.1
Deprecated                1.3.1
dnspython                 2.4.2
einops                    0.8.1
entrypoints               0.4
et_xmlfile                2.0.0
exceptiongroup            1.0.4
executing                 0.8.3
expecttest                0.1.6
fastjsonschema            2.21.2
ffmpeg-python             0.2.0
filelock                  3.9.0
Flask                     3.1.2
fonttools                 4.61.1
fqdn                      1.5.1
freetype-py               2.5.1
frozenlist                1.8.0
fsspec                    2023.9.2
future                    1.0.0
g4f                       6.9.3
gitdb                     4.0.12
GitPython                 3.1.46
gmpy2                     2.1.2
GPUtil                    1.4.0
h11                       0.16.0
h5py                      3.15.1
hf-xet                    1.2.0
httpcore                  1.0.9
httpx                     0.28.1
huggingface_hub           1.3.2
hypothesis                6.87.2
idna                      3.4
ImageIO                   2.37.2
imgaug                    0.4.0
importlib_metadata        8.7.1
iopath                    0.1.10
ipycanvas                 0.14.3
ipyevents                 2.0.4
ipykernel                 6.29.0
ipython                   8.15.0
ipywidgets                8.1.8
isoduration               20.11.0
itsdangerous              2.2.0
jedi                      0.18.1
Jinja2                    3.1.2
joblib                    1.5.3
json5                     0.13.0
jsonpatch                 1.32
jsonpointer               2.1
jsonschema                4.26.0
jsonschema-specifications 2025.9.1
jupyter_client            7.4.9
jupyter_core              5.9.1
jupyter-events            0.12.0
jupyter-lsp               2.3.0
jupyter_server            2.17.0
jupyter_server_terminals  0.5.4
jupyterlab                4.5.2
jupyterlab_pygments       0.3.0
jupyterlab_server         2.28.0
jupyterlab_widgets        3.0.16
kaolin                    0.18.0       /kaolin
kiwisolver                1.4.9
kornia                    0.8.2
kornia_rs                 0.1.10
lark                      1.3.1
lazy_loader               0.4
libarchive-c              2.9
libmambapy                1.4.1
llvmlite                  0.46.0
loguru                    0.7.3
MarkupSafe                2.1.1
marshmallow               3.26.2
matplotlib                3.10.8
matplotlib-inline         0.1.6
meshcat                   0.3.2
mistune                   3.2.0
mkl-fft                   1.3.8
mkl-random                1.2.4
mkl-service               2.4.0
more-itertools            8.12.0
mpmath                    1.3.0
multidict                 6.7.0
mypy_extensions           1.1.0
narwhals                  2.15.0
nbclient                  0.10.4
nbconvert                 7.16.6
nbformat                  5.10.4
nest-asyncio              1.6.0
networkx                  3.1
ninja                     1.13.0
nodejs                    0.1.1
notebook_shim             0.2.4
numba                     0.63.1
numpy                     1.26.4
nvdiffrast                0.4.0
objaverse                 0.1.7
omegaconf                 2.3.0
open3d                    0.19.0
opencv-contrib-python     4.10.0.82
opencv-python             4.10.0.82
opencv-python-headless    4.10.0.82
openpyxl                  3.1.5
optional-django           0.1.0
overrides                 7.7.0
packaging                 23.1
pandas                    2.3.3
pandocfilters             1.5.1
parso                     0.8.3
pexpect                   4.8.0
pickleshare               0.7.5
pillow                    12.1.0
pip                       23.2.1
pkginfo                   1.9.6
platformdirs              4.5.1
plotly                    6.5.2
pluggy                    1.0.0
portalocker               3.2.0
prometheus_client         0.24.1
prompt-toolkit            3.0.36
propcache                 0.4.1
protobuf                  6.33.4
psutil                    5.9.0
ptyprocess                0.7.0
pure-eval                 0.2.2
pyarrow                   22.0.0
pybind11                  3.0.1
pycocotools               2.0.11
pycosat                   0.6.6
pycparser                 2.21
pycryptodome              3.23.0
pydantic                  2.12.5
pydantic_core             2.41.5
pyglet                    2.1.12
pygltflib                 1.16.5
Pygments                  2.15.1
pyngrok                   7.5.0
PyOpenGL                  3.1.0
pyOpenSSL                 23.2.0
pyparsing                 3.3.1
pypng                     0.20220715.0
pyquaternion              0.9.9
pyrender                  0.1.45
PySocks                   1.7.1
python-dateutil           2.9.0.post0
python-etcd               0.4.5
python-json-logger        4.0.0
pytorch3d                 0.7.8
pytz                      2023.3.post1
PyYAML                    6.0
pyzmq                     27.1.0
referencing               0.37.0
requests                  2.31.0
retrying                  1.4.2
rfc3339-validator         0.1.4
rfc3986-validator         0.1.1
rfc3987-syntax            1.1.0
roma                      1.5.4
rpds-py                   0.30.0
rtree                     1.4.1
ruamel.yaml               0.17.21
ruamel.yaml.clib          0.2.6
safetensors               0.7.0
scikit-image              0.25.2
scikit-learn              1.7.2
scipy                     1.15.3
seaborn                   0.13.2
Send2Trash                2.1.0
sentry-sdk                2.49.0
setuptools                68.0.0
shapely                   2.1.2
shellingham               1.5.4
simsimd                   6.5.12
six                       1.16.0
smmap                     5.0.2
sortedcontainers          2.4.0
soupsieve                 2.5
stack-data                0.2.0
stringzilla               4.6.0
sympy                     1.11.1
terminado                 0.18.1
threadpoolctl             3.6.0
tifffile                  2025.5.10
timm                      1.0.24
tinycss2                  1.4.0
tomli                     2.0.1
toolz                     0.12.0
torch                     2.1.0
torchaudio                2.1.0
torchelastic              0.2.2
torchvision               0.16.0
tornado                   6.5.4
tqdm                      4.65.0
traitlets                 5.7.1
transformations           2025.1.1
trimesh                   4.11.0
triton                    2.1.0
truststore                0.8.0
typer-slim                0.21.1
types-dataclasses         0.6.6
typing_extensions         4.15.0
typing-inspect            0.9.0
typing-inspection         0.4.2
tzdata                    2025.3
u-msgpack-python          2.8.0
ultralytics               8.0.120
uri-template              1.3.0
urllib3                   1.26.16
usd-core                  25.11
videoio                   0.3.0
wandb                     0.24.0
warp-lang                 1.11.0
wcwidth                   0.2.5
webcolors                 25.10.0
webdataset                1.0.2
webencodings              0.5.1
websocket-client          1.9.0
Werkzeug                  3.1.5
wheel                     0.41.2
widgetsnbextension        4.0.15
wrapt                     2.1.0.dev1
xatlas                    0.0.11
xlsxwriter                3.2.9
yarl                      1.22.0
zipp                      3.23.0
zstandard                 0.19.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Dockerfile] Kaolin build fails due to missing Cython and updated dependencies

4 participants