SAPIEN icon indicating copy to clipboard operation
SAPIEN copied to clipboard

Compile Sapien 3 from source

Open kenchen3000 opened this issue 11 months ago • 3 comments

Hi, May I ask which branch do you recommend for using Sapien? It seems maniskills install a Sapien2. But I would like to build from source. There is compile error when i use ./docker_build_wheels.sh. Then from other post I notice that Sapien2 is not being actively supported and you are working on Sapien3.

There are 2 branch : dev, and 3.0.0dev. When I tried to build dev branch, after fixing all the dependency packages, it ends up reporting symbol not defined:

sapien-vulkan-2/include/svulkan2/renderer/rt_renderer.h:52:41: error: ‘mDenoiser’ was not declared in this scope

So it looks like there is some missing code with the dev branch.

My question is that how can i build from sapien 3 source?

Thanks!

kenchen3000 avatar Mar 11 '25 15:03 kenchen3000

SAPIEN 3 in the dev branch is currently being actively worked on. A stable version release is coming soon, and it will be moved to the main branch. All changes to the dev branch are automatically built with GitHub actions, and you can always grab the latest wheels from the GitHub actions page. They are also available as the nightly release. (There is a recent Windows cuda issue introduced by visual studio that is preventing us from building the windows version, hopefully it will be resolved soon by GitHub) While the build scripts should just work, if they do not, you can take a look at how GitHub actions build the wheels. Or if you do not need to modify code, simply get the latest wheels from the nightly release.

fbxiang avatar Mar 11 '25 16:03 fbxiang

Thanks! I take a latest and have a new error:

 /SAPIEN/src/physx/physx_engine.cpp: In member function ‘physx::PxCudaContextManager* sapien::physx::PhysxEngine::getCudaContextManager(int)’:
 /SAPIEN/src/physx/physx_engine.cpp:112:19: error: ‘cudaSetDevice’ was not declared in this scope
    112 |   checkCudaErrors(cudaSetDevice(cudaId));
        |                   ^~~~~~~~~~~~~
  /SAPIEN/src/physx/physx_engine.cpp:112:3: error: ‘checkCudaErrors’ was not declared in this scope
    112 |   checkCudaErrors(cudaSetDevice(cudaId));
        |   ^~~~~~~~~~~~~~~
  /SAPIEN/src/physx/physx_engine.cpp:116:19: error: ‘cudaFree’ was not declared in this scope
    116 |   checkCudaErrors(cudaFree(0));
        |                   ^~~~~~~~
  /SAPIEN/src/physx/physx_engine.cpp:118:25: error: ‘CudaLib’ has not been declared
    118 |   checkCudaDriverErrors(CudaLib::Get().cuCtxGetCurrent(&context));
        |                         ^~~~~~~
 /SAPIEN/src/physx/physx_engine.cpp:118:3: error: ‘checkCudaDriverErrors’ was not declared in this scope
    118 |   checkCudaDriverErrors(CudaLib::Get().cuCtxGetCurrent(&context));
        |   ^~~~~~~~~~~~~~~~~~~~~

kenchen3000 avatar Mar 11 '25 16:03 kenchen3000

The error messages seem a bit strange since in our docker, the directory for building SAPIEN should be /workspace/SAPIEN instead of /SAPIEN. Can you check whether you are using the correct docker image and version? There was a pybind11 update yesterday that breaks our build scripts and I am working on a fix now. If things go well, you can get a latest wheel from actions. Currently, Github uses this setup to build SAPIEN. So I really recommend just replicating this setup.

fbxiang avatar Mar 11 '25 17:03 fbxiang