Skip to content

Commit

Permalink
[OpenVINO][RISC-V] Added 2023.3 Release support and RISC-V wheel buil…
Browse files Browse the repository at this point in the history
…ding
  • Loading branch information
a-sidorova committed Feb 11, 2024
1 parent 3db5e57 commit d57eeee
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 3 deletions.
6 changes: 5 additions & 1 deletion src/build_scripts/openvino/riscv64/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ RUN dpkg --add-architecture riscv64 && \
RUN python3 -m pip install --upgrade pip && python3 -m pip install cmake

# Clone openvino
RUN git clone https://github.com/openvinotoolkit/openvino.git --branch 2023.2.0
RUN git clone https://github.com/openvinotoolkit/openvino.git --branch 2023.3.0
WORKDIR /openvino
RUN git submodule update --init \
./thirdparty/pugixml \
Expand All @@ -38,6 +38,10 @@ RUN git submodule update --init \
# Copy CMake toolchain
COPY riscv64.toolchain.cmake ./cmake/toolchains/custom_riscv64.toolchain.cmake

# Add RISC-V support to Python Wheel
COPY riscv64.wheel.diff ./riscv64.wheel.diff
RUN git apply ./riscv64.wheel.diff

## Build OpenVINO
RUN python3 -m pip install -r ./src/bindings/python/wheel/requirements-dev.txt
RUN python3 -m pip install -r ./src/bindings/python/src/compatibility/openvino/requirements-dev.txt
Expand Down
10 changes: 8 additions & 2 deletions src/build_scripts/openvino/riscv64/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
copy the installed OpenVINO libraries on host machine.

```bash
docker run -t openvino_riscv
docker run -d openvino_riscv
docker cp <container_name>:/openvino_riscv64_gnu .
```

Expand Down Expand Up @@ -44,7 +44,7 @@
1. Clone [OpenVINO][ov_repo] repository.

```bash
git clone https://github.com/openvinotoolkit/openvino.git --branch 2023.2.0 && cd openvino
git clone https://github.com/openvinotoolkit/openvino.git --branch 2023.3.0 && cd openvino
git submodule update --init \
./thirdparty/pugixml \
./thirdparty/ade \
Expand Down Expand Up @@ -82,6 +82,12 @@
cp <path>/custom_riscv64.toolchain.cmake <path>/openvino/cmake/toolchains/custom_riscv64.toolchain.cmake
```

1. Apply changes to support wheel building for RISC-V.

```bash
git apply <path>/riscv64.wheel.diff
```

1. Build OpenVINO from source.

```bash
Expand Down
13 changes: 13 additions & 0 deletions src/build_scripts/openvino/riscv64/riscv64.wheel.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/src/bindings/python/wheel/setup.py b/src/bindings/python/wheel/setup.py
index 4b05691221..53cb888ba4 100644
--- a/src/bindings/python/wheel/setup.py
+++ b/src/bindings/python/wheel/setup.py
@@ -38,6 +38,8 @@ elif machine == "arm" or machine == "armv7l":
ARCH = "arm"
elif machine == "aarch64" or machine == "arm64" or machine == "ARM64":
ARCH = "arm64"
+elif machine == "riscv64":
+ ARCH = "riscv64"

# The following variables can be defined in environment or .env file
SCRIPT_DIR = Path(__file__).resolve().parents[0]

0 comments on commit d57eeee

Please sign in to comment.