microsoft / onnxruntime

ONNX Runtime: cross-platform, high performance ML inferencing and training accelerator
https://onnxruntime.ai
MIT License
14.09k stars 2.84k forks source link

[Documentation] build on arm32v7 #19224

Open dzianisv opened 7 months ago

dzianisv commented 7 months ago

Describe the documentation issue

Documentation https://github.com/microsoft/onnxruntime/blob/main/dockerfiles/README.md says the following

For ARM32, please use Dockerfile.arm32v7 instead of Dockerfile.arm64.

But there is no Dockerfile.armv32v7 at https://github.com/microsoft/onnxruntime/blob/main/dockerfiles anymore. Where I can find it?

Page / URL

https://github.com/microsoft/onnxruntime/blob/main/dockerfiles/README.md

snnn commented 7 months ago

Use cross-compiling. https://onnxruntime.ai/ has the detailed instructions. You may also check https://github.com/microsoft/onnxruntime/blob/main/tools/ci_build/github/azure-pipelines/linux-ci-pipeline.yml#L180-L187 for how it works in our CI . Then after cross-compiling the *.so files, you will still need an ARM32 device(or virtual machine) to assembly the final python wheel file by running setup.py on that device(or VM).

dzianisv commented 7 months ago

Looks like

          cmake $(Build.SourcesDirectory)/cmake -Donnxruntime_ENABLE_CPUINFO=OFF -DPython_EXECUTABLE=/usr/bin/python3 -DPYTHON_EXECUTABLE=/usr/bin/python3 -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE=$(Build.SourcesDirectory)/cmake/linux_arm32_crosscompile_toolchain.cmake -G Ninja
          ninja

builds a shared library, but how I can built a final wheel using for instance docker buildx for armv7 target?

snnn commented 7 months ago

I doubt docker can serve the needs well. Last time when I ran an arm32 docker image inside a non-arm32 Ubuntu Linux, the docker instance couldn't report report CPU arch correctly. For example, the output of "uname -m" was wrong. Back to your question, our document at https://onnxruntime.ai/docs/build/inferencing.html has instructions on how to setup a sysroot for cross-compiling . You need to have that. Then add "--enable_pybind" to the build command.

github-actions[bot] commented 6 months ago

This issue has been automatically marked as stale due to inactivity and will be closed in 30 days if no further activity occurs. If further support is needed, please provide an update and/or more details.