FoundationPose icon indicating copy to clipboard operation
FoundationPose copied to clipboard

Solutions to the error Error while running CMAKE_PREFIX_PATH=$CONDA_PREFIX/lib/python3.9/site-packages/pybind11/share/cmake/pybind11 bash build_all_conda.sh

Open xuyangjinhui opened this issue 2 months ago • 1 comments

Hi! If you have trouble while running the command above, here are the solution which may help you:

First, if you come cross the error like "ModuleNotFoundError: No module named 'torch'", maybe because you use a too new version of setuptools. Run the command:

pip uninstall setuptools && pip install setuptools==69.5.1

This is a method given by https://github.com/NVlabs/FoundationPose/issues/365#issuecomment-3160607549 . Then the ModuleNotFoundError disappears.

However, I come across another problem while compiling. The output of error message is very long. The following steps may be useful:

First, because of the change of cuda API, you need to modify the file common.cu. You need to replace all the method.type() with .scalar_type(). For example, in the line 120, you need to replace AT_DISPATCH_FLOATING_TYPES(z_in_out.type(), "sample_rays_uniform_occupied_voxels_kernel, ([&]" with AT_DISPATCH_FLOATING_TYPES(z_in_out.scalar_type(), "sample_rays_uniform_occupied_voxels_kernel", ([&]. The useage of .type() appears three times in this file. This method given by https://github.com/NVlabs/FoundationPose/issues/348#issuecomment-2934046121 .

After that, if you have trouble with the overload of the function atomicAdd(double *, double), you need to add -arch=sm_60 to the nvcc_flags in the file setup.py in line 18. After modify, this line is:

nvcc_flags = ['-Xcompiler', '-O3', '-std=c++17', '-U__CUDA_NO_HALF_OPERATORS__', '-U__CUDA_NO_HALF_CONVERSIONS__', '-U__CUDA_NO_HALF2_OPERATORS__', '-arch=sm_60']

This method given by https://stackoverflow.com/questions/37566987/cuda-atomicadd-for-doubles-definition-error .

If you still have trouble, try to read other issues and combine there solutions. Hope you can success!

xuyangjinhui avatar Oct 18 '25 13:10 xuyangjinhui

Tks you so much, it works for me

AlanLuu2811-playground avatar Oct 23 '25 16:10 AlanLuu2811-playground

It works , Thanks a lot

mathanprasannakumar avatar Nov 23 '25 10:11 mathanprasannakumar