yay :3 by the way! i don't have any CUDA-capable devices, so i found that when i built the package with all the CUDA stuff in, it wouldn't work for me. i put the patch files for the changes i made to get it working up on github in case they are useful or anybody else wants them: https://github.com/yamichan420/AUR-python-onnxruntime-no-CUDA
Search Criteria
Package Details: python-onnxruntime 1.13.1-1
Git Clone URL: | https://aur.archlinux.org/python-onnxruntime.git (read-only, click to copy) |
---|---|
Package Base: | python-onnxruntime |
Description: | Cross-platform, high performance scoring engine for ML models |
Upstream URL: | https://github.com/microsoft/onnxruntime |
Licenses: | MIT |
Submitter: | None |
Maintainer: | None |
Last Packager: | yan12125 |
Votes: | 4 |
Popularity: | 0.37 |
First Submitted: | 2019-07-12 11:06 (UTC) |
Last Updated: | 2022-10-28 16:20 (UTC) |
Dependencies (40)
- libprotobuf-lite.so (protobuf-git, protobuf)
- nsync
- onnxruntime (onnxruntime-lib-git, onnxruntime-git)
- openmpi (openmpi-git, openmpi-gcc10)
- python-coloredlogs
- python-flatbuffers (python-flatbuffers-git)
- python-numpy (python-numpy-git, python-numpy1.22, python-numpy-openblas, python-numpy-mkl-bin, python-numpy-mkl, python-numpy-flame)
- python-packaging
- python-protobuf (python-protobuf-git)
- python-sympy (python-sympy-git)
- re2 (re2-git)
- boost (boost-git, boost174) (make)
- chrono-date (make)
- cmake (cmake-git) (make)
- cuda (cuda-11.0, cuda11.1) (make)
- cudnn (make)
- eigen (eigen-git) (make)
- flatbuffers (flatbuffers-git) (make)
- gcc11 (make)
- git (git-vfs, git-git, git-run-command-patch-git) (make)
- Show 20 more dependencies...
Required by (8)
- python-invisible-watermark
- python-mmaction2 (optional)
- python-mmpose (optional)
- python-onnx2pytorch (check)
- python-onnxoptimizer (check)
- python-tensorrt (optional)
- python-tf2onnx (check)
- vapoursynth-plugin-vsdpir-git (optional)
Sources (10)
- build-fixes.patch
- git+https://github.com/dcleblanc/SafeInt.git
- git+https://github.com/dmlc/dlpack.git
- git+https://github.com/jarro2783/cxxopts.git
- git+https://github.com/microsoft/onnxruntime#tag=v1.13.1
- git+https://github.com/onnx/onnx.git
- git+https://github.com/tensorflow/tensorboard.git
- install-orttraining-files.diff
- pytorch_cpuinfo
- system-dnnl.diff
yamichan commented on 2022-03-30 05:56 (UTC)
yan12125 commented on 2022-03-29 10:41 (UTC)
No problem and glad to see you've done it! I updated the pinned comment to include some numbers - hopefully useful for other users.
yamichan commented on 2022-03-29 07:56 (UTC)
yan12125: thank you for your response! in the process of figuring out how to get the logs, i ended up resolving the issue by chance. 4 GB of memory just wasn't enough! but i made a swap file and then it compiled. i'm very sorry for the false alarm >w<
yan12125 commented on 2022-03-29 04:28 (UTC) (edited on 2022-03-29 10:42 (UTC) by yan12125)
yamichan: could you paste a complete build log? calling a __host__ function from a __host__ __device__ function is not allowed
is harmless (I also got them), and makepkg.conf looks normal.
yamichan commented on 2022-03-29 02:02 (UTC) (edited on 2022-03-29 02:09 (UTC) by yamichan)
this pkgbuild is failing to build for me like this
[54%] Building CUDA object CMakeFiles/onnxruntime_providers_cuda.dir/home/.../python-onnxruntime/src/onnxruntime/onnxruntime/core/providers/cuda/math/topk_impl.cu.o
/home/.../python-onnxruntime/src/onnxruntime/onnxruntime/gsl/gsl-lite.hpp(1959): warning #20014-D: calling a __host__ function from a __host__ __device__ function is not allowed
/home/.../python-onnxruntime/src/onnxruntime/onnxruntime/gsl/gsl-lite.hpp(1959): warning #20014-D: calling a __host__ function from a __host__ __device__ function is not allowed
/home/.../python-onnxruntime/src/onnxruntime/onnxruntime/gsl/gsl-lite.hpp(1959): warning #20014-D: calling a __host__ function from a __host__ __device__ function is not allowed
make[2]: === [CMakeFiles/onnxruntime_providers_cuda.dir/build.make:1392: CMakeFiles/onnxruntime_providers_cuda.dir/home/.../python-onnxruntime/src/onnxruntime/onnxruntime/core/providers/cuda/math/topk_impl.cu.o] Error 255
make[1]: === [CMakeFiles/Makefile2:1614: CMakeFiles/onnxruntime_providers_cuda.dir/all] Error 2
make: === [Makefile:146: all] Error 2
==> ERROR: A failure occurred in build()
Aborting...
i tried looking at topk_impl.cu but i wouldn't even know where to begin figuring this out you can see my makepkg.conf at https://chuuni.moe/makepkg.conf but it should all be defaults any help would be appreciated. thank you! (eta: specifically in reference to python-onnxruntime; sorry if i posted on the wrong one)
yan12125 commented on 2022-03-23 13:41 (UTC)
my attemp do erros like error:
redefinition of 'class onnx::FunctionBuilder'
Thanks for the patch, but sounds like you've got an issue similar to https://github.com/microsoft/onnxruntime/issues/10877 ? Syncing git submodules again as described there may be useful.
any patch for use "system" onnx installation like you do with dnnl patch in this package?
I have once considered this, but upstream developers seem not going to support building onnx as a shared library (https://github.com/onnx/onnx/issues/3030), and linking to a static system library brings little benefit in my opinion.
sl1pkn07 commented on 2022-03-23 01:13 (UTC)
Hi. any patch for use "system" onnx installation like you do with dnnl patch in this package?
my attemp do erros like error: redefinition of 'class onnx::FunctionBuilder'
and error: no matching function for call to 'onnx::FunctionBuilder::Const(const char [2], double, int&)'
diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt
index acbde7f56a..98b827ee44 100644
--- a/cmake/CMakeLists.txt
+++ b/cmake/CMakeLists.txt
@@ -933,7 +937,11 @@ include(eigen)
#onnxruntime_EXTERNAL_LIBRARIES could contain onnx, onnx_proto,libprotobuf, cuda/cudnn,
# dnnl/mklml, onnxruntime_codegen_tvm, tvm and pthread
# pthread is always at the last
+if (NOT onnxruntime_PREFER_SYSTEM_LIB)
set(onnxruntime_EXTERNAL_LIBRARIES onnx onnx_proto ${PROTOBUF_LIB} re2::re2)
+else()
+set(onnxruntime_EXTERNAL_LIBRARIES onnx onnx_proto re2::re2)
+endif()
set(onnxruntime_LINK_DIRS )
@@ -1383,17 +1391,24 @@ else()
endif()
if (NOT onnxruntime_MINIMAL_BUILD)
+if (NOT onnxruntime_PREFER_SYSTEM_LIB)
add_subdirectory(external/onnx EXCLUDE_FROM_ALL)
+else()
+find_package(ONNX)
+target_link_libraries(onnx INTERFACE onnx)
+target_link_libraries(onnx_proto INTERFACE onnx_proto)
+endif()
else()
include(onnx_minimal)
endif()
-
+if (NOT onnxruntime_PREFER_SYSTEM_LIB)
target_compile_definitions(onnx PUBLIC $<TARGET_PROPERTY:onnx_proto,INTERFACE_COMPILE_DEFINITIONS> PRIVATE "__ONNX_DISABLE_STATIC_REGISTRATION")
if (NOT onnxruntime_USE_FULL_PROTOBUF)
target_compile_definitions(onnx PUBLIC "__ONNX_NO_DOC_STRINGS")
endif()
set_target_properties(onnx PROPERTIES FOLDER "External/ONNX")
set_target_properties(onnx_proto PROPERTIES FOLDER "External/ONNX")
+endif()
# fix a warning in onnx code we can't do anything about
greetings
yan12125 commented on 2022-03-13 03:45 (UTC)
I cannot reproduce the Eigen error. Do you use some compiler other than gcc (ex: clang)? If not, you may want to open an issue at https://github.com/microsoft/onnxruntime and clearly mention that this script uses eigen 3.4.0 from Arch instead of the included submodule. An alternative way is opening a ticket at https://bugs.archlinux.org/ and requesting a backport for eigen.
bidskii commented on 2022-03-13 01:28 (UTC)
I find that this package fails to build with errors like this unless eigen is patched with this commit
python-onnxruntime/src/onnxruntime/onnxruntime/contrib_ops/cpu/inverse.cc:61:42: required from here
/usr/include/eigen3/Eigen/src/Core/PartialReduxEvaluator.h:57:82: error: invalid initialization of reference of type ‘const Eigen::half&’ from expression of type ‘int’
57 | PacketType packetwise_redux_empty_value(const Func& ) { return pset1<PacketType>(0); }
behonest commented on 2022-03-05 10:34 (UTC)
@yan12125 Thanks! It works now
Pinned Comments
yan12125 commented on 2021-01-26 08:35 (UTC) (edited on 2023-01-31 01:49 (UTC) by yan12125)
To build this package from sources, make sure you have enough free memory and disk space. On my machine (8-core Intel i7-4770), building this packages takes ~20GB disk space, ~2.3GB memory space and 40 minute build time. On a more powerful server (40-core Intel Xeon 4114), building takes ~18 minutes.
If you don't need CUDA, modify PKGBUILD and replace
_ENABLE_CUDA=1
with_ENABLE_CUDA=0
. Build time will be much shorter.