You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current Dockerfile uses an image with outdated CUDA library cudagl:11.3.0-devel which does not support RTX 4090. To fix this, the docker image and torch version in the Dockerfile can be updated. Following changes worked for me.
Update docker image and torch version in docker/dockerfile:
FROM nvidia/cuda:12.1.0-devel-ubuntu20.04
...
RUN conda init bash &&\
echo "conda activate my" >> ~/.bashrc &&\
conda activate my &&\
pip install torchvision==0.16.0+cu121 torchaudio==2.1.0 torch==2.1.0+cu121 --index-url https://download.pytorch.org/whl/cu121 &&\
...
Additionally, update the compiler flags in bundlesdf/mycuda/setup.py from c++14 to c++17:
@shingarey could you share the docker environment for 4090? For some reason, I failed to build docker from dockerfile. It would be great to download the environment by docker pull
(base) mona@ada:/data/FoundationPose/docker$ bash run_container.sh
fp
access control disabled, clients can connect from any host
==========
== CUDA ==
==========
CUDA Version 12.1.0
Container image Copyright (c) 2016-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
This container image and its contents are governed by the NVIDIA Deep Learning Container License.
By pulling and using the container, you accept the terms and conditions of this license:
https://developer.nvidia.com/ngc/nvidia-deep-learning-container-license
A copy of this license is made available in this container at /NGC-DL-CONTAINER-LICENSE for your convenience.
*************************
** DEPRECATION NOTICE! **
*************************
THIS IMAGE IS DEPRECATED and is scheduled for DELETION.
https://gitlab.com/nvidia/container-images/cuda/blob/master/doc/support-policy.md
/opt/nvidia/nvidia_entrypoint.sh: line 67: exec: --: invalid option
exec: usage: exec [-cl] [-a name] [command [arguments ...]] [redirection ...]
(base) mona@ada:/data/FoundationPose/docker$ bash run_container.sh
foundationpose
access control disabled, clients can connect from any host
==========
== CUDA ==
==========
CUDA Version 12.1.0
Container image Copyright (c) 2016-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
This container image and its contents are governed by the NVIDIA Deep Learning Container License.
By pulling and using the container, you accept the terms and conditions of this license:
https://developer.nvidia.com/ngc/nvidia-deep-learning-container-license
A copy of this license is made available in this container at /NGC-DL-CONTAINER-LICENSE for your convenience.
*************************
** DEPRECATION NOTICE! **
*************************
THIS IMAGE IS DEPRECATED and is scheduled for DELETION.
https://gitlab.com/nvidia/container-images/cuda/blob/master/doc/support-policy.md
/opt/nvidia/nvidia_entrypoint.sh: line 67: exec: --: invalid option
exec: usage: exec [-cl] [-a name] [command [arguments ...]] [redirection ...]
(base) mona@ada:/data/FoundationPose/docker$ cat run_container.sh
docker rm -f foundationpose
CATGRASP_DIR=$(pwd)/../
xhost + && docker run --gpus all --env NVIDIA_DISABLE_REQUIRE=1 -it --network=host --name foundationpose docker.io/shingarey/foundationpose_custom_cuda121:latest --cap-add=SYS_PTRACE --security-opt seccomp=unconfined -v /data:/data -v /mnt:/mnt -v /tmp/.X11-unix:/tmp/.X11-unix -v /tmp:/tmp --ipc=host -e DISPLAY=${DISPLAY} -e GIT_INDEX_FILE foundationpose:latest bash
__PATH_TO_FOUNDATIONPOSE_ON_HOST_PC__ - is the path to the directory on your host system __PATH_ON_CONTAINER__ - where to mount inside the container, e.g. /home/your_name
foundationpose:latest might need to be adapted if you use different image.
What are the reasons for not making a PR and making this update available in the main branch? Why keep it at 11.3? Also, cudagl and cuda images are at different docker repos. CudaGL adds support for OpenGL, but doesn't have images past cuda 11.4. Do we need OpenGL support?
Thank you very much for your discussion. In the end, I resolved the issue using the following commanddocker rm -f foundationpose DIR=$(pwd)/..// xhost + && docker run --gpus all --env NVIDIA_DISABLE_REQUIRE=1 -it --network=host --name foundationpose --cap-add=SYS_PTRACE --security-opt seccomp=unconfined -v $DIR:$DIR -v /mnt:/mnt -v /tmp/.X11-unix:/tmp/.X11-unix -v /tmp:/tmp --ipc=host -e DISPLAY=${DISPLAY} -e GIT_INDEX_FILE shingarey/foundationpose_custom_cuda121:latest bash -c "cd $DIR && bash"
Reacted by LTaitLeo, xiaolijz, Liang Qin and Jan Ole von Hartz
Thank you!
I also met the problem that simply modifying the docker file and rebuilding didn't work, but after pull your image(and solved the "mycpp" issue, which is solved by using other methods provided in the issues), it finally works.
@shingarey would it be possible for you to share the Dockerfile you used to create the image since I would like to work on that updating it to Ubuntu 22 and adding ROS dependencies? It is my first time working with Docker and I am a bit lost on how to create the image and Dockerfile from scratch
However, when I enter the container, the Foundation folder is empty,
(foundationpose) β FoundationPose git:(main) β sudo bash docker/run_container.sh
Error response from daemon: No such container: foundationpose
access control disabled, clients can connect from any host
==========
== CUDA ==
==========
CUDA Version 12.1.0
Container image Copyright (c) 2016-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
This container image and its contents are governed by the NVIDIA Deep Learning Container License.
By pulling and using the container, you accept the terms and conditions of this license:
https://developer.nvidia.com/ngc/nvidia-deep-learning-container-license
A copy of this license is made available in this container at /NGC-DL-CONTAINER-LICENSE for your convenience.
*************************
** DEPRECATION NOTICE! **
*************************
THIS IMAGE IS DEPRECATED and is scheduled for DELETION.
https://gitlab.com/nvidia/container-images/cuda/blob/master/doc/support-policy.md
(my) root@baoyuli-uiuc:/# ls
NGC-DL-CONTAINER-LICENSE bin boot dev eigen-3.4.0 eigen-3.4.0.tar.gz etc home kaolin lib lib32 lib64 libx32 media miniconda.sh mnt nvdiffrast opt proc pybind11 root run sbin srv sys tmp usr var
(my) root@baoyuli-uiuc:/# cd home
(my) root@baoyuli-uiuc:/home# ls
baoyu dmitriy
(my) root@baoyuli-uiuc:/home# cd baoyu
(my) root@baoyuli-uiuc:/home/baoyu# ls
projects
(my) root@baoyuli-uiuc:/home/baoyu# cd projects
(my) root@baoyuli-uiuc:/home/baoyu/projects# ls
hand_dynamics
(my) root@baoyuli-uiuc:/home/baoyu/projects# cd hand_dynamics
(my) root@baoyuli-uiuc:/home/baoyu/projects/hand_dynamics# cd src
(my) root@baoyuli-uiuc:/home/baoyu/projects/hand_dynamics/src# cd data_process
(my) root@baoyuli-uiuc:/home/baoyu/projects/hand_dynamics/src/data_process# cd FoundationPose/
(my) root@baoyuli-uiuc:/home/baoyu/projects/hand_dynamics/src/data_process/FoundationPose# bash build_all.sh
bash: build_all.sh: No such file or directory
(my) root@baoyuli-uiuc:/home/baoyu/projects/hand_dynamics/src/data_process/FoundationPose# ls
(my) root@baoyuli-uiuc:/home/baoyu/projects/hand_dynamics/src/data_process/FoundationPose# cd ..
(my) root@baoyuli-uiuc:/home/baoyu/projects/hand_dynamics/src/data_process# ls
FoundationPose
(my) root@baoyuli-uiuc:/home/baoyu/projects/hand_dynamics/src/data_process# cd FoundationPose/
(my) root@baoyuli-uiuc:/home/baoyu/projects/hand_dynamics/src/data_process/FoundationPose# ls
(my) root@baoyuli-uiuc:/home/baoyu/projects/hand_dynamics/src/data_process/FoundationPose#
I am not quite familiar with Docker and not sure what mistakes I had made. Do you have any suggestions on it?
Besides, I also wonder have you tried to set up the conda environment instead of docker in RTX 4090?
For RTX5090 and in WSL using docker, it works by combining pull request #369 with this. I have encountered the error: Segmentation fault (core dumped) from line mycpp.cluster_poses() (see #293).
I uploaded the docker image: foundationpose-cuda12.8
For RTX5090 and in WSL using docker, it works by combining pull request #369 with this. I have encountered the error: Segmentation fault (core dumped) from line mycpp.cluster_poses() (see #293). I uploaded the docker image: foundationpose-cuda12.8
I was facing the same issue but after running the docker container, I ran the build_all.sh file, it resolved this error.
Γ python setup.py egg_info did not run successfully.
β exit code: 1
β°β> [19 lines of output]
/kaolin/setup.py:12: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
from pkg_resources import parse_version
Traceback (most recent call last):
File "", line 2, in
exec(compile('''
~~~~^^^^^^^^^^^^
# This is -- a caller that pip uses to run setup.py
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...<32 lines>...
exec(compile(setup_py_code, filename, "exec"))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
''' % ('/kaolin/setup.py',), "", "exec"))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 35, in
File "/kaolin/setup.py", line 30, in
raise ImportError(
...<2 lines>...
)
ImportError: Kaolin requires PyTorch >= 1.6.0, <= 2.8.0. Please install it before proceeding.
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
Γ Encountered error while generating package metadata.
β°β> See above for output.
note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
My machine has a single 4090 graphics card, and I'm using CUDA 11.8 as the environment. I'm installing it using conda. You might encounter some issues with the installation packages, but don't worry, just let the cursor automatically create the environment. You only need to grant execute permissions to the cursor. Then, everything will be fine. Here's my prompt:
I've already created the conda environment: /home/fiveages/anaconda3/envs/foundationpose/bin/python
Activity
wenbowen123 commentedon Apr 4, 2024
Perfect, thanks for sharing this!
longwoo commentedon Apr 8, 2024
@shingarey could you share the docker environment for 4090? For some reason, I failed to build docker from dockerfile. It would be great to download the environment by
docker pullshingarey commentedon Apr 9, 2024
@longwoo try this one:
foundationpose custom docker image with cuda121
monajalal commentedon Apr 9, 2024
@shingarey I pulled your docker but could you please share how you incorporate it into
run_container.sh?shingarey commentedon Apr 9, 2024
__PATH_TO_FOUNDATIONPOSE_ON_HOST_PC__- is the path to the directory on your host system__PATH_ON_CONTAINER__- where to mount inside the container, e.g. /home/your_namefoundationpose:latestmight need to be adapted if you use different image.Jarvan-hhh commentedon Apr 11, 2024
PATH_TO_FOUNDATIONPOSE_ON_HOST_PC Is this path referring to the path of FoundationPose-main? I don't quite understand, thank you.
monajalal commentedon Apr 11, 2024
@shingarey
can you show all the steps including the docker pull?
do you use same command as below?
docker pull shingarey/foundationpose_custom_cuda121:latest
shingarey commentedon Apr 12, 2024
Yes, it refers to the path to the FoundationPose directory on your host PC.
I use it as described in the initial post.
Jarvan-hhh commentedon Apr 15, 2024
Thank you for your reply, it is very helpful to me.
StevePotter commentedon May 2, 2024
What are the reasons for not making a PR and making this update available in the main branch? Why keep it at 11.3? Also, cudagl and cuda images are at different docker repos. CudaGL adds support for OpenGL, but doesn't have images past cuda 11.4. Do we need OpenGL support?
Cheney-36 commentedon Jul 21, 2024
Thank you very much for your discussion. In the end, I resolved the issue using the following command
docker rm -f foundationpose DIR=$(pwd)/..// xhost + && docker run --gpus all --env NVIDIA_DISABLE_REQUIRE=1 -it --network=host --name foundationpose --cap-add=SYS_PTRACE --security-opt seccomp=unconfined -v $DIR:$DIR -v /mnt:/mnt -v /tmp/.X11-unix:/tmp/.X11-unix -v /tmp:/tmp --ipc=host -e DISPLAY=${DISPLAY} -e GIT_INDEX_FILE shingarey/foundationpose_custom_cuda121:latest bash -c "cd $DIR && bash"zhaowangji commentedon Oct 6, 2024
Thank you!
I also met the problem that simply modifying the docker file and rebuilding didn't work, but after pull your image(and solved the "mycpp" issue, which is solved by using other methods provided in the issues), it finally works.
DavidePeron19 commentedon Oct 22, 2024
@shingarey would it be possible for you to share the Dockerfile you used to create the image since I would like to work on that updating it to Ubuntu 22 and adding ROS dependencies? It is my first time working with Docker and I am a bit lost on how to create the image and Dockerfile from scratch
Boey-li commentedon Feb 18, 2025
@shingarey Thank you so much for your sharing! I have tried to use your method and run the
run_contrainer.sh:However, when I enter the container, the Foundation folder is empty,
I am not quite familiar with Docker and not sure what mistakes I had made. Do you have any suggestions on it?
Besides, I also wonder have you tried to set up the conda environment instead of docker in RTX 4090?
wenbowen123 commentedon Feb 18, 2025
@Boey-li see this for 4090 setup https://github.com/NVlabs/FoundationPose?tab=readme-ov-file#troubleshooting
For the docker issue, have you tried removing sudo from
sudo bash docker/run_container.sh?yanglicb commentedon Aug 21, 2025
For RTX5090 and in WSL using docker, it works by combining pull request #369 with this. I have encountered the error: Segmentation fault (core dumped) from line mycpp.cluster_poses() (see #293).
I uploaded the docker image: foundationpose-cuda12.8
wenbowen123 commentedon Aug 21, 2025
@yanglicb, the
cluster_posesis very simple. you can rewrite this into python (ask chatgpt) if that helps to debug.AliHaroonT commentedon Dec 31, 2025
I was facing the same issue but after running the docker container, I ran the build_all.sh file, it resolved this error.
fjremnav commentedon Jan 5, 2026
@yanglicb
I have rtx 5070ti , cuda 13.0 and ubuntu 24.04. When I ran your container and do build_all.sh inside the docker, I encountered the following issue:
cd /kaolin && rm -rf build egg && pip install -e .
Obtaining file:///kaolin
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error
Γ python setup.py egg_info did not run successfully.
β exit code: 1
β°β> [19 lines of output]
/kaolin/setup.py:12: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
from pkg_resources import parse_version
Traceback (most recent call last):
File "", line 2, in
exec(compile('''
~~~~^^^^^^^^^^^^
# This is -- a caller that pip uses to run setup.py
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...<32 lines>...
exec(compile(setup_py_code, filename, "exec"))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
''' % ('/kaolin/setup.py',), "", "exec"))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 35, in
File "/kaolin/setup.py", line 30, in
raise ImportError(
...<2 lines>...
)
ImportError: Kaolin requires PyTorch >= 1.6.0, <= 2.8.0. Please install it before proceeding.
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
Γ Encountered error while generating package metadata.
β°β> See above for output.
note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
GuoXiaolong2018 commentedon Apr 16, 2026
My machine has a single 4090 graphics card, and I'm using CUDA 11.8 as the environment. I'm installing it using conda. You might encounter some issues with the installation packages, but don't worry, just let the cursor automatically create the environment. You only need to grant execute permissions to the cursor. Then, everything will be fine. Here's my prompt:
I've already created the conda environment: /home/fiveages/anaconda3/envs/foundationpose/bin/python
and you need to temporarily import CUDA 11.8.
Please help me with the following:
// Install Eigen3 3.4.0 under conda environment
conda install conda-forge::eigen=3.4.0
export CMAKE_PREFIX_PATH="$CMAKE_PREFIX_PATH:/eigen/path/under/conda"
// install dependencies
python -m pip install -r requirements.txt
// Install NVDiffRast
python -m pip install --quiet --no-cache-dir git+https://github.com/NVlabs/nvdiffrast.git
// Kaolin (Optional, needed if running model-free setup)
python -m pip install --quiet --no-cache-dir kaolin==0.15.0 -f https://nvidia-kaolin.s3.us-east-2.amazonaws.com/torch-2.0.0_cu118.html
// PyTorch3D
python -m pip install --quiet --no-index --no-cache-dir pytorch3d -f https://dl.fbaipublicfiles.com/pytorch3d/packaging/wheels/py39_cu118_pyt200/download.html
// Build extensions
CMAKE_PREFIX_PATH=$CONDA_PREFIX/lib/python3.9/site-packages/pybind11/share/cmake/pybind11 bash build_all_conda.sh
Please set up the Foundation Pose runtime environment.