mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-05 22:12:34 +00:00
6a5a63f051
Tensor can be row or col major, but it's also possible that the order by we need to read the tensor with more than two dimension need to be described. The reserved field in GstTensorDim is there for this purpose. If we need this we can add GST_TENSOR_DIM_ORDER_INDEXED, and follow an index defining order for each dimension. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6000> |
||
---|---|---|
.. | ||
gstml.h | ||
gstonnx.c | ||
gstonnxclient.cpp | ||
gstonnxclient.h | ||
gstonnxinference.cpp | ||
gstonnxinference.h | ||
meson.build | ||
README.md |
ONNX Build Instructions
Build
- do a recursive checkout of onnxruntime tag 1.16.3
$SRC_DIR
and$BUILD_DIR
are local source and build directories- To run with CUDA, both CUDA and cuDNN libraries must be installed.
$ cd $SRC_DIR
$ git clone --recursive https://github.com/microsoft/onnxruntime.git && cd onnxruntime && git checkout -b v1.16.3 refs/tags/v1.16.3
$ mkdir $BUILD_DIR/onnxruntime && cd $BUILD_DIR/onnxruntime
- CPU
$ cmake -Donnxruntime_BUILD_SHARED_LIB=ON -DBUILD_TESTING=OFF -Donnxruntime_BUILD_UNIT_TESTS=OFF $SRC_DIR/onnxruntime/cmake && make -j$(nproc) && sudo make install
- CUDA
cmake -Donnxruntime_BUILD_SHARED_LIB=ON -DBUILD_TESTING=OFF -Donnxruntime_BUILD_UNIT_TESTS=OFF -Donnxruntime_USE_CUDA=ON -Donnxruntime_CUDA_HOME=/usr/local/cuda -Donnxruntime_CUDNN_HOME=/usr/local/cuda -DCMAKE_CUDA_ARCHITECTURES=native -DCMAKE_CUDA_COMPILER=/usr/local/cuda/bin/nvcc $SRC_DIR/onnxruntime/cmake && make -j$(nproc) && sudo make install
- Intel oneDNN
3.0 install intel oneDNN
3.1 clone, build and install Khronos OpenCL SDK. Build dependencies for Fedora are
sudo dnf install libudev-devel libXrandr-devel mesa-libGLU-devel mesa-libGL-devel libX11-devel intel-opencl
3.2 build and install onnxruntime
:
cmake -Donnxruntime_BUILD_SHARED_LIB=ON -DBUILD_TESTING=OFF -Donnxruntime_BUILD_UNIT_TESTS=OFF -Donnxruntime_USE_DNNL=ON -Donnxruntime_DNNL_GPU_RUNTIME=ocl -Donnxruntime_DNNL_OPENCL_ROOT=$SRC_DIR/OpenCL-SDK/install $SRC_DIR/onnxruntime/cmake && make -j$(nproc) && sudo make install