-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Build] [RISC-V]: issues on cross-compiling for RISC-V target #23784
Comments
Hi @BHbean
I did not quite follow this problem, it was an intention that even during cross-compilation we use headers from native system (e.g. |
@ilya-lavrenov Thanks for your reply!
Of course! I will propose a PR to https://github.com/oneapi-src/oneDNN later.
I am not so sure why this was happening, probably due to the $ cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=<openvino_repo>/cmake/toolchains/riscv64-gnu.toolchain.cmake .. Note: BTW, simply cross-compiling the |
We don't need to cross-compile flatbuffers, because it's used as build system tool:
|
Closing this, I hope previous responses were sufficient to help you proceed. Feel free to reopen and ask additional questions related to this topic. |
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
The text was updated successfully, but these errors were encountered: