|
| 1 | +name: Linux DRIVER |
| 2 | +on: |
| 3 | + workflow_call: |
| 4 | + inputs: |
| 5 | + os: |
| 6 | + description: 'OS that is used for building in the form of "ubuntu_20_04"' |
| 7 | + type: string |
| 8 | + required: true |
| 9 | + build-runner: |
| 10 | + description: 'Machine on which the builds will run' |
| 11 | + type: string |
| 12 | + required: true |
| 13 | + |
| 14 | +defaults: |
| 15 | + run: |
| 16 | + shell: bash |
| 17 | + |
| 18 | +permissions: read-all |
| 19 | + |
| 20 | +jobs: |
| 21 | + Dependencies: |
| 22 | + name: Dependencies |
| 23 | + runs-on: ubuntu-latest |
| 24 | + outputs: |
| 25 | + openvino_repo: ${{ steps.read_openvino_sha.outputs.ov_repo }} |
| 26 | + openvino_sha: ${{ steps.read_openvino_sha.outputs.ov_sha }} |
| 27 | + npu_repo: ${{ steps.get_npu_sha.outputs.npu_repo }} |
| 28 | + npu_sha: ${{ steps.get_npu_sha.outputs.npu_sha }} |
| 29 | + npu_tag: ${{ steps.create_npu_tag.outputs.npu_tag }} |
| 30 | + artifact-name: ${{ steps.artifacts.outputs.name }} |
| 31 | + env: |
| 32 | + NPU_COMPILER_REPO: ./npu_compiler |
| 33 | + steps: |
| 34 | + - name: Fetch OpenVINO config from NPU Compiler repo |
| 35 | + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 |
| 36 | + timeout-minutes: 15 |
| 37 | + with: |
| 38 | + sparse-checkout: | |
| 39 | + validation/openvino_config.json |
| 40 | + sparse-checkout-cone-mode: false |
| 41 | + path: ${{ env.NPU_COMPILER_REPO }} |
| 42 | + |
| 43 | + - name: Get integrated OpenVINO version |
| 44 | + id: read_openvino_sha |
| 45 | + run: | |
| 46 | + OV_ORG=$(jq -r 'to_entries[0].key' ${NPU_COMPILER_REPO}/validation/openvino_config.json) |
| 47 | + OV_SHA=$(jq -r 'to_entries[0].value' ${NPU_COMPILER_REPO}/validation/openvino_config.json) |
| 48 | + echo "OpenVINO orgranization = $OV_ORG" |
| 49 | + echo "OpenVINO commit sha = $OV_SHA" |
| 50 | + echo "ov_repo=$OV_ORG/openvino" >> $GITHUB_OUTPUT |
| 51 | + echo "ov_sha=$OV_SHA" >> $GITHUB_OUTPUT |
| 52 | +
|
| 53 | + - name: Get NPU original fork and commit sha |
| 54 | + id: get_npu_sha |
| 55 | + run: | |
| 56 | + if [[ "${{ github.event_name }}" == "pull_request" ]]; then |
| 57 | + echo "npu_repo=${{ github.event.pull_request.head.repo.full_name }}" >> $GITHUB_OUTPUT |
| 58 | + echo "npu_sha=${{ github.event.pull_request.head.sha }}" >> $GITHUB_OUTPUT |
| 59 | + else |
| 60 | + echo "npu_repo=${{ github.repository }}" >> $GITHUB_OUTPUT |
| 61 | + echo "npu_sha=${{ github.sha }}" >> $GITHUB_OUTPUT |
| 62 | + fi |
| 63 | +
|
| 64 | + - name: Create NPU Compiler tag |
| 65 | + id: create_npu_tag |
| 66 | + run: | |
| 67 | + NPU_TAG=ci_${GITHUB_SHA:0:7} |
| 68 | + echo "NPU Compiler tag to be used in NPU Driver Linux build : $NPU_TAG" |
| 69 | + echo "npu_tag=$NPU_TAG" >> $GITHUB_OUTPUT |
| 70 | +
|
| 71 | + - name: Configure artifacts |
| 72 | + id: artifacts |
| 73 | + run: | |
| 74 | + PKG_NAME=l_ov_cid_${{ inputs.os }}_npu_${{ github.sha }} |
| 75 | + echo "Package name : $PKG_NAME" |
| 76 | + echo "name=$PKG_NAME" >> $GITHUB_OUTPUT |
| 77 | +
|
| 78 | + Build: |
| 79 | + name: Build |
| 80 | + needs: Dependencies |
| 81 | + runs-on: ${{ inputs.build-runner }} |
| 82 | + timeout-minutes: 240 |
| 83 | + env: |
| 84 | + DEBIAN_FRONTEND: noninteractive |
| 85 | + NPU_DRIVER_REPO: ./npu_driver |
| 86 | + NPU_DRIVER_BUILD_DIR: ./npu_driver_build |
| 87 | + NPU_DRIVER_INSTALL_DIR: ./npu_driver_install |
| 88 | + steps: |
| 89 | + - name: Clone Linux NPU Driver |
| 90 | + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 |
| 91 | + timeout-minutes: 15 |
| 92 | + with: |
| 93 | + repository: intel/linux-npu-driver |
| 94 | + path: ${{ env.NPU_DRIVER_REPO }} |
| 95 | + submodules: true |
| 96 | + |
| 97 | + - name: System info |
| 98 | + uses: openvinotoolkit/openvino/.github/actions/system_info@master |
| 99 | + |
| 100 | + - name: Install system packages |
| 101 | + run: | |
| 102 | + sudo apt update |
| 103 | + sudo apt install -y build-essential git git-lfs cmake libudev-dev libboost-all-dev libssl-dev |
| 104 | +
|
| 105 | + - name: Configure OpenVINO and NPU Compiler versions |
| 106 | + run: | |
| 107 | + sed -i "s|^set(OPENVINO_REPOSITORY .*|set(OPENVINO_REPOSITORY https://github.com/${{ needs.Dependencies.outputs.openvino_repo }})|" ${NPU_DRIVER_REPO}/compiler/compiler_source.cmake |
| 108 | + sed -i '/GIT_REPOSITORY/{n;s|https://github.com/openvinotoolkit/npu_plugin.git|https://github.com/${{ needs.Dependencies.outputs.npu_repo }}.git|}' ${NPU_DRIVER_REPO}/compiler/compiler_source.cmake |
| 109 | + sed -i "s|^set(NPU_COMPILER_TAG .*|set(NPU_COMPILER_TAG ${{ needs.Dependencies.outputs.npu_tag }})|" ${NPU_DRIVER_REPO}/compiler/compiler_source.cmake |
| 110 | + sed -i "s|^set(NPU_COMPILER_REVISION .*|set(NPU_COMPILER_REVISION ${{ needs.Dependencies.outputs.npu_sha }})|" ${NPU_DRIVER_REPO}/compiler/compiler_source.cmake |
| 111 | + sed -i "s|^set(NPU_COMPILER_OPENVINO_REVISION .*|set(NPU_COMPILER_OPENVINO_REVISION ${{ needs.Dependencies.outputs.openvino_sha }})|" ${NPU_DRIVER_REPO}/compiler/compiler_source.cmake |
| 112 | + cat ${NPU_DRIVER_REPO}/compiler/compiler_source.cmake |
| 113 | +
|
| 114 | + - name: CMake configure - Linux NPU Driver |
| 115 | + run: | |
| 116 | + cmake \ |
| 117 | + ${{ inputs.driver-cmake-options }} \ |
| 118 | + -DENABLE_NPU_COMPILER_BUILD=ON \ |
| 119 | + -DCMAKE_INSTALL_PREFIX=$(realpath ${NPU_DRIVER_INSTALL_DIR}) \ |
| 120 | + -S ${NPU_DRIVER_REPO} \ |
| 121 | + -B ${NPU_DRIVER_BUILD_DIR} |
| 122 | +
|
| 123 | + - name: CMake build - Linux NPU Driver - deb packages |
| 124 | + run: | |
| 125 | + cmake \ |
| 126 | + --build ${NPU_DRIVER_BUILD_DIR} \ |
| 127 | + --parallel $(nproc) \ |
| 128 | + --target package |
| 129 | +
|
| 130 | + - name: Copy packages |
| 131 | + run: | |
| 132 | + mkdir -p ${NPU_DRIVER_INSTALL_DIR}/packages |
| 133 | + mv ${NPU_DRIVER_BUILD_DIR}/intel-{level-zero-npu,fw-npu,driver-compiler-npu}*.*deb ${NPU_DRIVER_INSTALL_DIR}/packages/ |
| 134 | + ls -a ${NPU_DRIVER_INSTALL_DIR} |
| 135 | + ls -a ${NPU_DRIVER_INSTALL_DIR}/packages |
0 commit comments