Open BHbean opened 4 months ago
Hi @BHbean Could you please send those suggestions as PR to https://github.com/oneapi-src/oneDNN ?
Inside these files, the flatbuffers/flatbuffers.h head file is included, which can be easily found under /usr/include path in common linux systems
I did not quite follow this problem, it was an intention that even during cross-compilation we use headers from native system (e.g. /usr/include
), see https://github.com/openvinotoolkit/openvino/blob/master/thirdparty/dependencies.cmake#L397. Why do you need to copy to <RISCV_TOOLCHAIN_ROOT>/sysroot/usr/include
if it can work with /usr/include
?
@ilya-lavrenov Thanks for your reply!
Could you please send those suggestions as PR to https://github.com/oneapi-src/oneDNN ?
Of course! I will propose a PR to https://github.com/oneapi-src/oneDNN later.
I did not quite follow this problem, it was an intention that even during cross-compilation we use headers from native system (e.g. /usr/include), see https://github.com/openvinotoolkit/openvino/blob/master/thirdparty/dependencies.cmake#L397. Why do you need to copy to
/sysroot/usr/include if it can work with /usr/include ?
I am not so sure why this was happening, probably due to the sysroot
set in the toolchain file? The command used for my build is:
$ cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=<openvino_repo>/cmake/toolchains/riscv64-gnu.toolchain.cmake ..
_Note: BTW, simply cross-compiling the thirdparty/flatbuffers/flatbuffers
lib and installing it under <RISCV_TOOLCHAIN_ROOT>/sysroot/usr/include
does not work, due to mismatch of versions._
Note: BTW, simply cross-compiling the thirdparty/flatbuffers/flatbuffers lib and installing it under
/sysroot/usr/include does not work, due to mismatch of versions.
We don't need to cross-compile flatbuffers, because it's used as build system tool:
OpenVINO Version
tag 2024.0.0
Operating System
Ubuntu 22.04 (LTS)
Hardware Architecture
RISC-V
Target Platform
No response
Build issue description
Hi there!
I have been trying to cross-compile
openvino
for RISC-V target withrv64gcv
arch recently, and I finally succeeded. However, it took me much effort due to unexpected issues on its submodules. Therefore, I want to open a new issue here to discuss the problems I met and give basic guidance for those who have the same problems.Modification Guidance
The problems mainly lie in two submodules:
oneDNN
andFlatBuffers
.oneDNN
Due to the evolution of the RVV intrinsic spec, the new compilers DO NOT support the old definitions of RVV intrinsics, presented in
src/plugins/intel_cpu/thirdparty/onednn/src/cpu/rv64/rvv_nchw_pooling.cpp
. Therefore. it is a must to add compatible headers to make old ones effective again. These headers can take OpenCV as a reference and be added to the afore-mentioned file.When the compiling process meets the
src/plugins/intel_cpu/thirdparty/onednn/src/cpu/rv64/rvv_nchw_pooling.hpp
file, it will prompt an error:error: base class has incomplete type
. This problem can be solved by introducing the header file containing the definition ofprimitive_t
class, like the following:FlatBuffers
FlatBuffers
compiler will generate some files under the build dir automatically, likebuild/src/frontends/tensorflow_lite/src/schema_generated.h
. Inside these files, theflatbuffers/flatbuffers.h
head file is included, which can be easily found under/usr/include
path in common linux systems. However, it does not exsit in the target sysroot, so we have to copy the whole/usr/include/flatbuffers
dir into our target sysroot:Following the above steps,
openvino
can be successfully build for RISC-V target using this toolchain file.Discussion
oneDNN
repo to adapt the above changes, but there are a upstream repo and a fork made byopenvinotoolkit
. Which one should I contribute to?FlatBuffers
(see this issue). It does not seem to be elegant to copy some head files. How to solve this issue?Build scrip or step-by-step to reproduce
No response
Relevant log output
No response
Issue submission checklist