onnxruntime/tools/ci_build/github/azure-pipelines/android-arm64-v8a-QNN-crosscompile-ci-pipeline.yml
Changming Sun 328a13c06d
Enable VCPKG in more pipelines (#23590)
### Description
Enable VCPKG in more pipelines
2025-02-06 10:10:31 -08:00

109 lines
3.2 KiB
YAML

##### start trigger Don't edit it manually, Please do edit set-trigger-rules.py ####
### please do rerun set-trigger-rules.py ###
trigger:
branches:
include:
- main
- rel-*
paths:
exclude:
- docs/**
- README.md
- CONTRIBUTING.md
- BUILD.md
- 'js/web'
- 'onnxruntime/core/providers/js'
pr:
branches:
include:
- main
- rel-*
paths:
exclude:
- docs/**
- README.md
- CONTRIBUTING.md
- BUILD.md
- 'js/web'
- 'onnxruntime/core/providers/js'
#### end trigger ####
parameters:
- name: QnnSdk
displayName: QNN SDK version
type: string
default: 2.31.0.250130
jobs:
- job: Build_QNN_EP
pool: onnxruntime-Ubuntu2204-AMD-CPU
timeoutInMinutes: 30
workspace:
clean: all
steps:
- task: UsePythonVersion@0
displayName: Use Python $(pythonVersion)
inputs:
versionSpec: $(pythonVersion)
- script: |
env | grep ANDROID
displayName: View Android ENVs
- script: sudo apt-get update -y && sudo apt-get install -y coreutils ninja-build
displayName: Install coreutils and ninja
- script: sudo chmod go+rw /dev/kvm
displayName: Update permissions to KVM
- template: templates/jobs/download_linux_qnn_sdk.yml
parameters:
QnnSDKVersion: ${{ parameters.QnnSdk }}
- script: |
set -e -x
python3 tools/ci_build/build.py \
--config Release \
--android \
--build_dir build_qnn \
--android_sdk_path $ANDROID_HOME \
--android_ndk_path $ANDROID_NDK_HOME \
--android_abi=x86_64 \
--android_api=31 \
--parallel --use_vcpkg \
--build_shared_lib \
--use_qnn static_lib \
--qnn_home $(QnnSDKRootDir) \
--cmake_generator=Ninja \
--skip_tests
displayName: Build QNN EP
- script: |
mkdir -p build_qnn/Release/testdata/QNN/node_tests
cp -r cmake/external/onnx/onnx/backend/test/data/node/test_basic_conv_with_padding build_qnn/Release/testdata/QNN/node_tests
displayName: Initialize test directories
# This is commented out for now. The emulator runs correctly, onnx_test_runner is executable, and the test passes
# with the CPU EP but returns 139 when attempting to use the QNN EP. Maybe some QNN EP parameters need to be provided?
#
# - template: templates/use-android-emulator.yml
# parameters:
# create: true
# start: true
# - task: CmdLine@2
# inputs:
# script: |
# set -e -x
# ${ANDROID_SDK_ROOT}/platform-tools/adb push onnx_test_runner /data/local/tmp/
# ${ANDROID_SDK_ROOT}/platform-tools/adb push testdata/QNN/node_tests/test_basic_conv_with_padding /data/local/tmp/
# ${ANDROID_SDK_ROOT}/platform-tools/adb shell "chmod +x /data/local/tmp/onnx_test_runner"
# ${ANDROID_SDK_ROOT}/platform-tools/adb shell "/data/local/tmp/onnx_test_runner -v /data/local/tmp/test_basic_conv_with_padding"
# ${ANDROID_SDK_ROOT}/platform-tools/adb shell "/data/local/tmp/onnx_test_runner -v -e qnn /data/local/tmp/test_basic_conv_with_padding"
# workingDirectory: build_qnn/Release
# displayName: Run test_basic_conv_with_padding on emulator
# - template: templates/use-android-emulator.yml
# parameters:
# stop: true