Skip to content

Commit

Permalink
updated linux building to target arm
Browse files Browse the repository at this point in the history
  • Loading branch information
CaptainDario committed Feb 7, 2025
1 parent 36d1f1b commit 5d26d05
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 18 deletions.
30 changes: 15 additions & 15 deletions .github/workflows/build_ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-24.04
runs-on: [ubuntu-24.04, ubuntu-24.04-arm]

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
Expand Down Expand Up @@ -54,28 +54,28 @@ jobs:
git checkout ${{ github.event.inputs.tf_version }}
# build tf lite
#- name: Build TF Lite base
# run: ./build_tf_lite_linux.sh
- name: Build TF Lite gpu delegate
run: |
sudo apt install mesa-common-dev libegl1-mesa-dev libgles2-mesa-dev mesa-utils
./build_tf_lite_gpu_delegate_linux.sh
- name: Build TF Lite base
run: ./build_tf_lite_linux.sh
#- name: Build TF Lite gpu delegate
# run: |
# sudo apt install mesa-common-dev libegl1-mesa-dev libgles2-mesa-dev mesa-utils
# ./build_tf_lite_gpu_delegate_linux.sh
#- name: Build TF Lite flex delegate
# run: ./build_tf_lite_flex_delegate_linux.sh

# TODO run test

# upload the build libs as an artifact
#- name: upload base library to artifacts
# uses: actions/upload-artifact@v4
# with:
# name: libtensorflowlite_x86.so
# path: ./tensorflow/libtensorflowlite_x86.so
- name: upload gpu library to artifacts
- name: upload base library to artifacts
uses: actions/upload-artifact@v4
with:
name: tensorflowlite_gpu_x86.so
path: ./tensorflow/tensorflowlite_gpu_x86.so
name: libtensorflowlite_x86.so
path: ./tensorflow/libtensorflowlite_x86.so
#- name: upload gpu library to artifacts
# uses: actions/upload-artifact@v4
# with:
# name: tensorflowlite_gpu_x86.so
# path: ./tensorflow/tensorflowlite_gpu_x86.so
#- name: upload flex library to artifacts
# uses: actions/upload-artifact@v4
# with:
Expand Down
16 changes: 13 additions & 3 deletions build_tf_lite_linux.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,23 @@
# clean tensorflow build directory
cd tensorflow

bazelisk clean

# build base rnutime and check it was successful
bazelisk build -c opt \
--repo_env=HERMETIC_PYTHON_VERSION=3.11 \
//tensorflow/lite/c:tensorflowlite_c

find ./bazel-out/ -type f -name "*.so"

cp $(find ./bazel-out/ -type f -name "*.so") ./libtensorflowlite_x86.so
# rename and copy the output based on the current system
if [[ "${RUNNER_ARCHITECTURE}" == "x64" ]]; then
arch="x86"
elif [[ "${RUNNER_ARCHITECTURE}" == "arm64" ]]; then
arch="arm64"
else
echo "Unsupported architecture: ${RUNNER_ARCHITECTURE}"
exit 1
fi
cp $(find ./bazel-out/ -type f -name "*.so") "./libtensorflowlite_${arch}_c.so"



0 comments on commit 5d26d05

Please sign in to comment.