microsoft / onnxruntime

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

Build on Jetson Xavier NX does not produce c++ API include and libs #9371

Open isra60 opened 2 years ago

isra60 commented 2 years ago

Describe the bug I have a Jetson Xavier NX and I want to use the c++ API of the onnxruntime, so instead of using the standard wheel from the Jetson Model Zoo (https://elinux.org/Jetson_Zoo#ONNX_Runtime) I need to build the entire onnxruntime again with the option of build the shared libs

As reference I'm using this tutorial https://onnxruntime.ai/docs/build/eps.html#nvidia-jetson-tx1tx2nanoxavier

System information Jetpack 4.6 L4T

To Reproduce This is my command line to build onnxruntime Note the use of --build_shared_lib which I think is the proper way to obtain the include and libs for the c++ API

./build.sh --config Release --update --build --parallel --build_wheel --build_shared_lib --use_tensorrt --cuda_home /usr/local/cuda --cudnn_home /usr/lib/aarch64-linux-gnu --tensorrt_home /usr/lib/aarch64-linux-gnu

After the long building, I have a path like this onnxruntime/build/Linux/Release but in that folder I don't found any reference to the C++ API I mean something like include/onnxruntime/core/session/onnxruntime_cxx_api.h

Also, do you know if the wheel provided by NVIDIA is built with the TensorRT option??

snnn commented 2 years ago

After the build, you will need to manually copy onnxruntime_cxx_api.h and onnxruntime_c_api.h from the source dir to /usr/include or somewhere else.

isra60 commented 2 years ago

And the shared libs to link against my c++ inference code?? Or are these ones?? libonnxruntime.so
libonnxruntime.so.1.10.0

snnn commented 2 years ago

Yes. And libonnxruntime_providers_shared.so, libonnxruntimeproviders*.so if they exist.

stale[bot] commented 2 years ago

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

dwffls commented 1 year ago

Hi there, Had the same issues here, the problem was that after the build a sudo make install in the build\Linux\Release\ folder has to be run. This is not in the documentation anywhere, no clue why but hope this fixes other peoples problems.