microsoft / onnxruntime

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

[Build] [CANN] Failed to build CANN provider with training and Python bindings #20697

Open shakhat opened 5 months ago

shakhat commented 5 months ago

Describe the issue

The build fails when the library is built with CANN provider, training and Python bindings.

Urgency

No response

Target platform

aarch64+npu

Build script

./build.sh --parallel 40 --use_cann --enable_training --enable_pybind --build_wheel

Error / output

In file included from /home/ilya/work/onnxruntime/orttraining/orttraining/core/framework/torch/torch_proxy.h:10,                                                                     
                 from /home/ilya/work/onnxruntime/orttraining/orttraining/training_ops/cpu/torch/torch_custom_function_kernel_base.h:16,                                             
                 from /home/ilya/work/onnxruntime/onnxruntime/core/providers/shared_library/provider_bridge_provider.cc:57:                                                          
/home/ilya/work/onnxruntime/orttraining/orttraining/core/framework/torch/python_common.h:16:10: fatal error: Python.h: No such file or directory
   16 | #include <Python.h>
      |          ^~~~~~~~~~
compilation terminated.
make[2]: *** [CMakeFiles/onnxruntime_providers_cann.dir/build.make:426: CMakeFiles/onnxruntime_providers_cann.dir/home/ilya/work/onnxruntime/onnxruntime/core/providers/shared_library/provider_bridge_provider.cc.o] Error 1

Visual Studio Version

No response

GCC / Compiler Version

No response

github-actions[bot] commented 4 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.

adrianlizarraga commented 1 month ago

I encountered the same issue when building onnxruntime on Ubuntu. The solution was to install the python development package.