Skip to content

OpenVINO™ is an open source toolkit for optimizing and deploying AI inference

[CI] [GHA] Set build parallelism from runner CPU limits on self-hosted runners (#38094)

Andrey Babushkina5b6e1a02a6a
diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml
index a9303fc394b..a9d14acf340 100644
--- a/.github/workflows/android.yml
+++ b/.github/workflows/android.yml
@@ -138,6 +138,9 @@ jobs:
ARTIFACTS_SHARE: "/mount/build-artifacts"
MANIFEST_PATH: '${{ github.workspace }}/openvino/manifest.yml'
PRODUCT_TYPE: public_android_${{ matrix.arch }}_release
+ # Hard-coded manually; nproc and NUMBER_OF_PROCESSORS do not respect Kubernetes pod CPU limits.
+ # Nested cmake --build (e.g. intel_gpu onednn_gpu ExternalProject) does not inherit --parallel from the top-level build.
+ CMAKE_BUILD_PARALLEL_LEVEL: '15'
steps:
- name: Append the environment variable - load SCCACHE_AZURE_CONNECTION_STRING from file
shell: bash
@@ -183,6 +186,7 @@ jobs:
- name: System info
uses: ./openvino/.github/actions/system_info
+ #
#
# Build
#
@@ -218,7 +222,7 @@ jobs:
-B ${TBB_BUILD}
- name: Build OneTBB project
- run: cmake --build ${TBB_BUILD} --parallel $(nproc) -- --quiet
+ run: cmake --build ${TBB_BUILD} --parallel ${CMAKE_BUILD_PARALLEL_LEVEL} -- --quiet
- name: Install OneTBB project
run: cmake --install ${TBB_BUILD}
@@ -256,7 +260,7 @@ jobs:
-B ${BUILD_DIR}
- name: CMake - build OpenVINO
- run: cmake --build ${BUILD_DIR} --parallel $(nproc) -- --quiet
+ run: cmake --build ${BUILD_DIR} --parallel ${CMAKE_BUILD_PARALLEL_LEVEL} -- --quiet
- name: Show ccache stats
run: ${SCCACHE_PATH} --show-stats
diff --git a/.github/workflows/clang_tidy.yml b/.github/workflows/clang_tidy.yml
index 83d08b001d5..97c5f695519 100644
--- a/.github/workflows/clang_tidy.yml
+++ b/.github/workflows/clang_tidy.yml
@@ -123,6 +123,7 @@ jobs:
uses: ./.github/workflows/job_clang_tidy.yml
with:
runner: aks-linux-16-cores-32gb
+ cmake-build-parallel-level: '15'
image: ${{ fromJSON(needs.docker.outputs.images).ov_build.ubuntu_24_04_x64 }}
cmake-generator: 'Ninja Multi-Config'
sccache-prefix: ubuntu24_x86_64_Release_itt_faster_build_clang_tidy
@@ -136,6 +137,7 @@ jobs:
uses: ./.github/workflows/job_clang_tidy.yml
with:
runner: aks-linux-16-cores-32gb-arm
+ cmake-build-parallel-level: '15'
image: ${{ fromJSON(needs.docker_arm.outputs.images).ov_build.ubuntu_22_04_arm64 }}
cmake-generator: 'Unix Makefiles'
sccache-prefix: ubuntu24_x86_64_Release_itt_faster_build_clang_tidy_aarch64
@@ -151,6 +153,7 @@ jobs:
uses: ./.github/workflows/job_clang_tidy.yml
with:
runner: aks-linux-16-cores-32gb
+ cmake-build-parallel-level: '15'
image: ${{ fromJSON(needs.docker.outputs.images).ov_build.ubuntu_22_04_riscv }}
cmake-generator: 'Unix Makefiles'
sccache-prefix: ubuntu24_x86_64_Release_itt_faster_build_clang_tidy_riscv64
@@ -167,6 +170,7 @@ jobs:
uses: ./.github/workflows/job_clang_tidy.yml
with:
runner: aks-linux-16-cores-32gb
+ cmake-build-parallel-level: '15'
image: ${{ fromJSON(needs.docker.outputs.images).ov_build.ubuntu_24_04_x64 }}
cmake-generator: 'Ninja Multi-Config'
sccache-prefix: ubuntu24_x86_64_Release_itt_faster_build_clang_tidy_gpu
diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml
index 32ed96ff261..375d4ac5ed8 100644
--- a/.github/workflows/coverage.yml
+++ b/.github/workflows/coverage.yml
@@ -75,6 +75,7 @@ jobs:
uses: ./.github/workflows/job_build_linux.yml
with:
runner: 'aks-linux-16-cores-32gb'
+ cmake-build-parallel-level: '15'
image: ${{ fromJSON(needs.Docker.outputs.images).ov_build.ubuntu_22_04_x64 }}
affected-components: '{"JS_API":true}'
event-name: ${{ github.event_name }}
diff --git a/.github/workflows/coverity.yml b/.github/workflows/coverity.yml
index 86d7fe799ea..0a8dbca6d35 100644
--- a/.github/workflows/coverity.yml
+++ b/.github/workflows/coverity.yml
@@ -107,6 +107,9 @@ jobs:
OPENVINO_CONTRIB_REPO: /__w/openvino/openvino/openvino_contrib
BUILD_DIR: /__w/openvino/openvino/openvino_build
COVERITY_TOOL_DIR: /__w/openvino/openvino/coverity_tool
+ # Hard-coded manually; nproc and NUMBER_OF_PROCESSORS do not respect Kubernetes pod CPU limits.
+ # Nested cmake --build (e.g. intel_gpu onednn_gpu ExternalProject) does not inherit --parallel from the top-level build.
+ CMAKE_BUILD_PARALLEL_LEVEL: '15'
steps:
- name: Clone OpenVINO
@@ -144,7 +147,6 @@ jobs:
set-pip-install-path: 'true'
self-hosted-runner: 'true'
- #
# Build
#
@@ -167,7 +169,7 @@ jobs:
popd
- name: Cmake build - OpenVINO with Coverity
- run: ${COVERITY_TOOL_DIR}/cov-analysis*/bin/cov-build --dir ${BUILD_DIR}/cov-int cmake --build ${BUILD_DIR} --parallel $(nproc) --config ${{ env.CMAKE_BUILD_TYPE }} -- --quiet
+ run: ${COVERITY_TOOL_DIR}/cov-analysis*/bin/cov-build --dir ${BUILD_DIR}/cov-int cmake --build ${BUILD_DIR} --parallel ${CMAKE_BUILD_PARALLEL_LEVEL} --config ${{ env.CMAKE_BUILD_TYPE }} -- --quiet
- name: Pack Artefacts
run: tar -cvf - cov-int | pigz > openvino.tgz
diff --git a/.github/workflows/dev_cpu_linux_snippets_libxsmm.yml b/.github/workflows/dev_cpu_linux_snippets_libxsmm.yml
index 496a7444438..9d1bccf8598 100644
--- a/.github/workflows/dev_cpu_linux_snippets_libxsmm.yml
+++ b/.github/workflows/dev_cpu_linux_snippets_libxsmm.yml
@@ -114,6 +114,9 @@ jobs:
INSTALL_TEST_DIR: /__w/openvino/openvino/tests_install
BUILD_DIR: /__w/openvino/openvino/openvino_build
SCCACHE_AZURE_KEY_PREFIX: ubuntu20_x86_64_Release
+ # Hard-coded manually; nproc and NUMBER_OF_PROCESSORS do not respect Kubernetes pod CPU limits.
+ # Nested cmake --build (e.g. intel_gpu onednn_gpu ExternalProject) does not inherit --parallel from the top-level build.
+ CMAKE_BUILD_PARALLEL_LEVEL: '15'
if: "!needs.smart_ci.outputs.skip_workflow"
steps:
@@ -161,7 +164,7 @@ jobs:
run: ${SCCACHE_PATH} --zero-stats
- name: Cmake build - OpenVINO
- run: cmake --build ${BUILD_DIR} --parallel $(nproc) --config ${{ env.CMAKE_BUILD_TYPE }} -- --quiet
+ run: cmake --build ${BUILD_DIR} --parallel ${CMAKE_BUILD_PARALLEL_LEVEL} --config ${{ env.CMAKE_BUILD_TYPE }} -- --quiet
- name: Show sccache stats
run: ${SCCACHE_PATH} --show-stats
diff --git a/.github/workflows/dev_gpu_linux_level_zero.yml b/.github/workflows/dev_gpu_linux_level_zero.yml
index 6b83b1ae792..2a8234e972c 100644
--- a/.github/workflows/dev_gpu_linux_level_zero.yml
+++ b/.github/workflows/dev_gpu_linux_level_zero.yml
@@ -94,6 +94,7 @@ jobs:
uses: ./.github/workflows/job_build_linux.yml
with:
runner: 'aks-linux-16-cores-32gb'
+ cmake-build-parallel-level: '15'
image: ${{ fromJSON(needs.docker.outputs.images).ov_build.ubuntu_24_04_x64 }}
affected-components: ${{ needs.smart_ci.outputs.affected_components }}
event-name: ${{ github.event_name }}
diff --git a/.github/workflows/job_build_linux.yml b/.github/workflows/job_build_linux.yml
index d560c50a17c..2040af32dfc 100644
--- a/.github/workflows/job_build_linux.yml
+++ b/.github/workflows/job_build_linux.yml
@@ -95,6 +95,10 @@ on:
type: boolean
required: false
default: false
+ cmake-build-parallel-level:
+ description: 'Number of threads for parallel build (hard-coded; nproc and NUMBER_OF_PROCESSORS do not respect container CPU limits)'
+ type: string
+ required: true
permissions: read-all
@@ -142,6 +146,9 @@ jobs:
COVERAGE_NOTES_DIR: ${{ github.workspace }}/coverage_build_notes
PIP_INDEX_URL: ${{ contains(inputs.runner, 'aks') && 'http://pip-proxy.pip-proxy.svc.cluster.local/simple/' || '' }}
PIP_TRUSTED_HOST: ${{ contains(inputs.runner, 'aks') && 'pip-proxy.pip-proxy.svc.cluster.local' || '' }}
+ # Hard-coded at workflow call site; nproc and NUMBER_OF_PROCESSORS do not respect Kubernetes pod CPU limits.
+ # Nested cmake --build (e.g. intel_gpu onednn_gpu ExternalProject) does not inherit --parallel from the top-level build.
+ CMAKE_BUILD_PARALLEL_LEVEL: ${{ inputs.cmake-build-parallel-level }}
steps:
- name: Append the environment variable - load SCCACHE_AZURE_CONNECTION_STRING from file
shell: bash
@@ -240,7 +247,7 @@ jobs:
#
- name: CMake configure - OpenVINO
- run: eval cmake ${{ env.CMAKE_OPTIONS }} -S ${{ env.OPENVINO_REPO }} -B ${{ env. BUILD_DIR }}
+ run: eval cmake ${{ env.CMAKE_OPTIONS }} -S ${{ env.OPENVINO_REPO }} -B ${{ env.BUILD_DIR }}
env:
CMAKE_OPTIONS: ${{ inputs.cmake-options }} -DENABLE_SAMPLES=${{ inputs.build-samples && 'ON' || 'OFF' }}
@@ -248,7 +255,7 @@ jobs:
run: ${SCCACHE_PATH} --zero-stats
- name: Cmake build - OpenVINO
- run: cmake --build ${BUILD_DIR} --parallel $(nproc) --config ${{ env.CMAKE_BUILD_TYPE }} -- --quiet
+ run: cmake --build ${BUILD_DIR} --parallel ${CMAKE_BUILD_PARALLEL_LEVEL} --config ${{ env.CMAKE_BUILD_TYPE }} -- --quiet
- name: Show sccache stats
run: ${SCCACHE_PATH} --show-stats
@@ -281,7 +288,7 @@ jobs:
python3 ${OPENVINO_REPO}/src/frontends/gguf/tests/gen_arch_fixtures.py \
--fetch \
--out-dir ${INSTALL_TEST_DIR}/tests/test_data/arch_fixtures \
- -j $(nproc)
+ -j ${CMAKE_BUILD_PARALLEL_LEVEL}
- name: Install Python wheels for the main Python
if: ${{ ! inputs.build-additional-python-packages }}
@@ -312,7 +319,7 @@ jobs:
fi
cmake ${CMAKE_OPTIONS} -S ${OPENVINO_REPO}/src/bindings/python -B ${PY_BUILD_DIR}
- cmake --build ${PY_BUILD_DIR} --parallel $(nproc) -- --quiet
+ cmake --build ${PY_BUILD_DIR} --parallel ${CMAKE_BUILD_PARALLEL_LEVEL} -- --quiet
cmake --install ${PY_BUILD_DIR} --config ${{ env.CMAKE_BUILD_TYPE }} --prefix ${INSTALL_DIR} --component pyopenvino_python$py_version
cmake --install ${PY_BUILD_DIR} --config ${{ env.CMAKE_BUILD_TYPE }} --prefix ${INSTALL_WHEELS_DIR} --component python_wheels
done
@@ -362,7 +369,7 @@ jobs:
-DPython3_EXECUTABLE=$python_exec \
-DCPACK_GENERATOR=DEB \
${BUILD_DIR}
- cmake --build ${BUILD_DIR} --parallel $(nproc) --config ${{ env.CMAKE_BUILD_TYPE }} --target package -- --quiet
+ cmake --build ${BUILD_DIR} --parallel ${CMAKE_BUILD_PARALLEL_LEVEL} --config ${{ env.CMAKE_BUILD_TYPE }} --target package -- --quiet
- name: Cmake & Build - OpenVINO Contrib
if: ${{ inputs.build-contrib }}
@@ -373,7 +380,7 @@ jobs:
-DENABLE_WHEEL=OFF \
-S ${OPENVINO_REPO} \
-B ${BUILD_DIR}
- cmake --build ${BUILD_DIR} --parallel $(nproc) --config ${{ env.CMAKE_BUILD_TYPE }} -- --quiet
+ cmake --build ${BUILD_DIR} --parallel ${CMAKE_BUILD_PARALLEL_LEVEL} --config ${{ env.CMAKE_BUILD_TYPE }} -- --quiet
- name: CMake configure, build and install - OpenVINO JS API
if: ${{ fromJSON(inputs.affected-components).JS_API && inputs.build-js }}
@@ -382,7 +389,7 @@ jobs:
-DCPACK_GENERATOR=NPM \
-DENABLE_SYSTEM_TBB=OFF \
-DENABLE_WHEEL=OFF
- cmake --build ${BUILD_DIR} --parallel $(nproc) -- --quiet
+ cmake --build ${BUILD_DIR} --parallel ${CMAKE_BUILD_PARALLEL_LEVEL} -- --quiet
cmake --install ${BUILD_DIR} --prefix ${INSTALL_DIR_JS}
- name: Pack openvino_js_package
@@ -419,7 +426,7 @@ jobs:
-DENABLE_TESTS=OFF \
-DENABLE_SAMPLES=ON \
${BUILD_DIR}
- cmake --build ${BUILD_DIR} --parallel $(nproc) --target package -- --quiet
+ cmake --build ${BUILD_DIR} --parallel ${CMAKE_BUILD_PARALLEL_LEVEL} --target package -- --quiet
#
# Upload build artifacts and logs
diff --git a/.github/workflows/job_build_windows.yml b/.github/workflows/job_build_windows.yml
index 8c7c6111deb..b1a2db69b11 100644
--- a/.github/workflows/job_build_windows.yml
+++ b/.github/workflows/job_build_windows.yml
@@ -36,6 +36,10 @@ on:
type: boolean
required: false
default: false
+ cmake-build-parallel-level:
+ description: 'Number of threads for parallel build (hard-coded; nproc and NUMBER_OF_PROCESSORS do not respect container CPU limits)'
+ type: string
+ required: true
permissions: read-all
@@ -70,6 +74,9 @@ jobs:
ARTIFACTS_SHARE: "C:\\mount\\build-artifacts"
MANIFEST_PATH: "${{ github.workspace }}\\manifest.yml"
PRODUCT_TYPE: "public_windows_${{ inputs.build-variant }}_${{ inputs.build-type }}"
+ # Hard-coded at workflow call site; nproc and NUMBER_OF_PROCESSORS do not respect Kubernetes pod CPU limits.
+ # Nested cmake --build (e.g. intel_gpu onednn_gpu ExternalProject) does not inherit --parallel from the top-level build.
+ CMAKE_BUILD_PARALLEL_LEVEL: ${{ inputs.cmake-build-parallel-level }}
steps:
- name: Clone OpenVINO
uses: ababushk/checkout@dd591a6a2ac25618db4eda86e7e0d938f88cf01b # cherry_pick_retries
@@ -189,7 +196,7 @@ jobs:
run: '& ccache --zero-stats'
- name: Cmake build - OpenVINO
- run: cmake --build ${{ env.BUILD_DIR }} --config ${{ env.CMAKE_BUILD_TYPE }} --parallel $ENV:NUMBER_OF_PROCESSORS -- --quiet
+ run: cmake --build ${{ env.BUILD_DIR }} --config ${{ env.CMAKE_BUILD_TYPE }} --parallel $env:CMAKE_BUILD_PARALLEL_LEVEL -- --quiet
- name: Show ccache stats
if: ${{ inputs.build-type != 'Debug' }}
@@ -268,7 +275,7 @@ jobs:
cmake -DPython3_EXECUTABLE="$pythonExecutablePath" -DENABLE_GIL_PYTHON_API=ON -DENABLE_PYTHON=ON -DENABLE_WHEEL=ON -DOpenVINODeveloperPackage_DIR=${{ env.BUILD_DIR }} -S ${{ env.OPENVINO_REPO }}/src/bindings/python -B "$pyBuildDir"
}
- cmake --build "$pyBuildDir" --parallel $ENV:NUMBER_OF_PROCESSORS --target ie_wheel --config ${{ env.CMAKE_BUILD_TYPE }} -- --quiet &&
+ cmake --build "$pyBuildDir" --parallel $env:CMAKE_BUILD_PARALLEL_LEVEL --target ie_wheel --config ${{ env.CMAKE_BUILD_TYPE }} -- --quiet &&
cmake --install "$pyBuildDir" --config ${{ env.CMAKE_BUILD_TYPE }} --prefix ${{ env.INSTALL_WHEELS_DIR }} --component python_wheels &&
cmake --install "$pyBuildDir" --config ${{ env.CMAKE_BUILD_TYPE }} --prefix ${{ env.INSTALL_DIR }} --component pyopenvino_python$pyVersion
if ($LASTEXITCODE -ne 0) {
@@ -306,7 +313,7 @@ jobs:
cmake -DPython3_EXECUTABLE="$pythonExecutablePath" -DENABLE_GIL_PYTHON_API=OFF -DENABLE_PYTHON=ON -DENABLE_WHEEL=ON -DOpenVINODeveloperPackage_DIR=${{ env.BUILD_DIR }} -S ${{ env.OPENVINO_REPO }}/src/bindings/python -B "$pyBuildDir"
- cmake --build "$pyBuildDir" --parallel $ENV:NUMBER_OF_PROCESSORS --target ie_wheel --config ${{ env.CMAKE_BUILD_TYPE }} -- --quiet &&
+ cmake --build "$pyBuildDir" --parallel $env:CMAKE_BUILD_PARALLEL_LEVEL --target ie_wheel --config ${{ env.CMAKE_BUILD_TYPE }} -- --quiet &&
cmake --install "$pyBuildDir" --config ${{ env.CMAKE_BUILD_TYPE }} --prefix ${{ env.INSTALL_WHEELS_DIR }} --component python_wheels &&
cmake --install "$pyBuildDir" --config ${{ env.CMAKE_BUILD_TYPE }} --prefix ${{ env.INSTALL_DIR }} --component pyopenvino_python$pyVersion
if ($LASTEXITCODE -ne 0) {
@@ -366,7 +373,7 @@ jobs:
-DCPACK_GENERATOR=NPM `
-DENABLE_SYSTEM_TBB=OFF `
-DENABLE_WHEEL=OFF
- cmake --build ${{ env.BUILD_DIR }} --parallel $ENV:NUMBER_OF_PROCESSORS -- --quiet
+ cmake --build ${{ env.BUILD_DIR }} --parallel $env:CMAKE_BUILD_PARALLEL_LEVEL -- --quiet
cmake --install ${{ env.BUILD_DIR }} --config ${{ env.CMAKE_BUILD_TYPE }} --prefix ${{ env.INSTALL_DIR_JS }}
- name: Pack JS Artifacts
@@ -400,7 +407,7 @@ jobs:
cmake -DCUSTOM_OPERATIONS="calculate_grid;complex_mul;fft;grid_sample;sparse_conv;sparse_conv_transpose" -S ${{ env.OPENVINO_REPO }} -B ${{ env.BUILD_DIR }} `
-DOPENVINO_EXTRA_MODULES="${{ env.OPENVINO_CONTRIB_REPO }}/modules/custom_operations;${{ env.OPENVINO_CONTRIB_REPO }}/modules/java_api" `
-DENABLE_WHEEL=OFF
- cmake --build ${{ env.BUILD_DIR }} --parallel $ENV:NUMBER_OF_PROCESSORS -- --quiet
+ cmake --build ${{ env.BUILD_DIR }} --parallel $env:CMAKE_BUILD_PARALLEL_LEVEL -- --quiet
#
# Upload build artifacts and logs
diff --git a/.github/workflows/job_clang_tidy.yml b/.github/workflows/job_clang_tidy.yml
index b79107eadfb..436d20fcf95 100644
--- a/.github/workflows/job_clang_tidy.yml
+++ b/.github/workflows/job_clang_tidy.yml
@@ -43,6 +43,10 @@ on:
type: boolean
required: false
default: true
+ cmake-build-parallel-level:
+ description: 'Number of threads for parallel build (hard-coded; nproc and NUMBER_OF_PROCESSORS do not respect container CPU limits)'
+ type: string
+ required: true
permissions: read-all
@@ -75,6 +79,9 @@ jobs:
OPENVINO_REPO: /__w/openvino/openvino/openvino
BUILD_DIR: /__w/openvino/openvino/openvino_build
SCCACHE_AZURE_KEY_PREFIX: ${{ inputs.sccache-prefix }}
+ # Hard-coded at workflow call site; nproc and NUMBER_OF_PROCESSORS do not respect Kubernetes pod CPU limits.
+ # Nested cmake --build (e.g. intel_gpu onednn_gpu ExternalProject) does not inherit --parallel from the top-level build.
+ CMAKE_BUILD_PARALLEL_LEVEL: ${{ inputs.cmake-build-parallel-level }}
steps:
- name: Append the environment variable - load SCCACHE_AZURE_CONNECTION_STRING from file
@@ -119,7 +126,7 @@ jobs:
run: |
cmake \
--build "${BUILD_DIR}" \
- --parallel "$(($(nproc) - 1))" \
+ --parallel "${CMAKE_BUILD_PARALLEL_LEVEL}" \
--config "${CMAKE_BUILD_TYPE}" \
--target "${BUILD_TARGET}" \
-- ${BUILD_EXTRA_ARGS}
diff --git a/.github/workflows/job_gguf_llamacpp_validation.yml b/.github/workflows/job_gguf_llamacpp_validation.yml
index 888a0f0acff..d1685e981e6 100644
--- a/.github/workflows/job_gguf_llamacpp_validation.yml
+++ b/.github/workflows/job_gguf_llamacpp_validation.yml
@@ -16,6 +16,10 @@ on:
type: string
required: false
default: null
+ cmake-build-parallel-level:
+ description: 'Number of threads for parallel build (hard-coded; nproc and NUMBER_OF_PROCESSORS do not respect container CPU limits)'
+ type: string
+ required: true
permissions: read-all
@@ -41,6 +45,10 @@ jobs:
defaults:
run:
shell: bash
+ env:
+ # Hard-coded at workflow call site; nproc and NUMBER_OF_PROCESSORS do not respect Kubernetes pod CPU limits.
+ # Nested cmake --build (e.g. intel_gpu onednn_gpu ExternalProject) does not inherit --parallel from the top-level build.
+ CMAKE_BUILD_PARALLEL_LEVEL: ${{ inputs.cmake-build-parallel-level }}
steps:
- name: Download OpenVINO package
uses: akashchi/download-artifact@d59a9c15fec3fdb7c9adf09464124d00f9c11415 # main
@@ -79,7 +87,7 @@ jobs:
-DGGML_OPENVINO=ON
- name: Build llama.cpp
- run: cmake --build llama.cpp/build --parallel "$(nproc)"
+ run: cmake --build llama.cpp/build --parallel ${CMAKE_BUILD_PARALLEL_LEVEL}
- name: Show sccache stats
run: sccache --show-stats
diff --git a/.github/workflows/job_onnx_runtime.yml b/.github/workflows/job_onnx_runtime.yml
index a01b6d3d904..2bfed9f5116 100644
--- a/.github/workflows/job_onnx_runtime.yml
+++ b/.github/workflows/job_onnx_runtime.yml
@@ -16,6 +16,10 @@ on:
description: 'Key prefix for the cache folder on the Azure'
type: string
required: true
+ cmake-build-parallel-level:
+ description: 'Number of threads for parallel build (hard-coded; nproc and NUMBER_OF_PROCESSORS do not respect container CPU limits)'
+ type: string
+ required: true
permissions: read-all
@@ -50,6 +54,9 @@ jobs:
ONNX_RUNTIME_REPO: ${{ github.workspace }}/onnxruntime
ONNX_RUNTIME_BUILD_DIR: ${{ github.workspace }}/onnxruntime/build
ONNX_RUNTIME_UTILS: ${{ github.workspace }}/src/frontends/onnx/tests/ci_utils/onnxruntime
+ # Hard-coded at workflow call site; nproc and NUMBER_OF_PROCESSORS do not respect Kubernetes pod CPU limits.
+ # Nested cmake --build (e.g. intel_gpu onednn_gpu ExternalProject) does not inherit --parallel from the top-level build.
+ CMAKE_BUILD_PARALLEL_LEVEL: ${{ inputs.cmake-build-parallel-level }}
steps:
- name: Append the environment variable - load SCCACHE_AZURE_CONNECTION_STRING from file
@@ -110,7 +117,7 @@ jobs:
--config RelWithDebInfo \
--use_openvino CPU \
--build_shared_lib \
- --parallel $(nproc) \
+ --parallel ${CMAKE_BUILD_PARALLEL_LEVEL} \
--skip_tests \
--compile_no_warning_as_error \
--allow_running_as_root \
diff --git a/.github/workflows/linux_arm64.yml b/.github/workflows/linux_arm64.yml
index 0f35846032b..72ff61e19cd 100644
--- a/.github/workflows/linux_arm64.yml
+++ b/.github/workflows/linux_arm64.yml
@@ -99,6 +99,7 @@ jobs:
uses: ./.github/workflows/job_build_linux.yml
with:
runner: 'aks-linux-16-cores-32gb-arm'
+ cmake-build-parallel-level: '15'
image: ${{ fromJSON(needs.docker.outputs.images).ov_build.ubuntu_22_04_arm64 }}
affected-components: ${{ needs.smart_ci.outputs.affected_components }}
event-name: ${{ github.event_name }}
@@ -164,6 +165,7 @@ jobs:
uses: ./.github/workflows/job_onnx_runtime.yml
with:
runner: 'aks-linux-16-cores-32gb-arm'
+ cmake-build-parallel-level: '15'
image: ${{ fromJSON(needs.docker.outputs.images).ov_build.ubuntu_22_04_arm64 }}
sccache-azure-key-prefix: 'ubuntu22_aarch64_onnxruntime'
diff --git a/.github/workflows/linux_conditional_compilation.yml b/.github/workflows/linux_conditional_compilation.yml
index 901bd0ad711..80604be466b 100644
--- a/.github/workflows/linux_conditional_compilation.yml
+++ b/.github/workflows/linux_conditional_compilation.yml
@@ -127,6 +127,9 @@ jobs:
SELECTIVE_BUILD_STAT_DIR: /__w/openvino/openvino/selective_build_stat
MODELS_PATH: /__w/openvino/openvino/testdata
SCCACHE_AZURE_KEY_PREFIX: ubuntu22_x86_64_itt_clang_Release_faster_build
+ # Hard-coded manually; nproc and NUMBER_OF_PROCESSORS do not respect Kubernetes pod CPU limits.
+ # Nested cmake --build (e.g. intel_gpu onednn_gpu ExternalProject) does not inherit --parallel from the top-level build.
+ CMAKE_BUILD_PARALLEL_LEVEL: '15'
steps:
- name: Append the environment variable - load SCCACHE_AZURE_CONNECTION_STRING from file
@@ -187,8 +190,8 @@ jobs:
- name: Cmake build - CC COLLECT
run: |
- cmake --build ${BUILD_DIR} --parallel $(nproc) --config ${{ env.CMAKE_BUILD_TYPE }} -- --quiet
- cmake --build ${BUILD_DIR} --parallel $(nproc) --config ${{ env.CMAKE_BUILD_TYPE }} --target sea_itt_lib -- --quiet
+ cmake --build ${BUILD_DIR} --parallel ${CMAKE_BUILD_PARALLEL_LEVEL} --config ${{ env.CMAKE_BUILD_TYPE }} -- --quiet
+ cmake --build ${BUILD_DIR} --parallel ${CMAKE_BUILD_PARALLEL_LEVEL} --config ${{ env.CMAKE_BUILD_TYPE }} --target sea_itt_lib -- --quiet
- name: Show sccache stats
run: ${SCCACHE_PATH} --show-stats
@@ -200,7 +203,7 @@ jobs:
- name: Build C++ samples - OpenVINO build tree
run: |
cmake -G "${{ env.CMAKE_GENERATOR }}" -DOpenVINO_DIR=${BUILD_DIR} -S ${INSTALL_DIR}/samples/cpp -B ${BUILD_DIR}/cpp_samples
- cmake --build ${BUILD_DIR}/cpp_samples --parallel $(nproc) --config ${{ env.CMAKE_BUILD_TYPE }} --target hello_query_device -- --quiet
+ cmake --build ${BUILD_DIR}/cpp_samples --parallel ${CMAKE_BUILD_PARALLEL_LEVEL} --config ${{ env.CMAKE_BUILD_TYPE }} --target hello_query_device -- --quiet
- name: Build C samples - OpenVINO install tree
run: ${INSTALL_DIR}/samples/c/build_samples.sh -i ${INSTALL_DIR} -b ${BUILD_DIR}/c_samples
@@ -283,6 +286,9 @@ jobs:
SELECTIVE_BUILD_STAT_DIR: /__w/openvino/openvino/selective_build_stat
MODELS_PATH: /__w/openvino/openvino/testdata
SCCACHE_AZURE_KEY_PREFIX: ubuntu22_x86_64_cc_Release
+ # Hard-coded manually; nproc and NUMBER_OF_PROCESSORS do not respect Kubernetes pod CPU limits.
+ # Nested cmake --build (e.g. intel_gpu onednn_gpu ExternalProject) does not inherit --parallel from the top-level build.
+ CMAKE_BUILD_PARALLEL_LEVEL: '7'
steps:
- name: Append the environment variable - load SCCACHE_AZURE_CONNECTION_STRING from file
@@ -347,7 +353,7 @@ jobs:
-B ${BUILD_DIR}
- name: Cmake build - CC ON
- run: cmake --build ${BUILD_DIR} --parallel 8 --target benchmark_app -- --quiet
+ run: cmake --build ${BUILD_DIR} --parallel ${CMAKE_BUILD_PARALLEL_LEVEL} --target benchmark_app -- --quiet
- name: Show ccache stats
run: ${SCCACHE_PATH} --show-stats
diff --git a/.github/workflows/linux_riscv.yml b/.github/workflows/linux_riscv.yml
index 6c2abdbdd7d..1be60af5f91 100644
--- a/.github/workflows/linux_riscv.yml
+++ b/.github/workflows/linux_riscv.yml
@@ -142,6 +142,9 @@ jobs:
CCACHE_DIR: ${{ github.workspace }}/ccache
CCACHE_TEMPDIR: ${{ github.workspace }}/ccache_temp
CCACHE_MAXSIZE: 2G
+ # Hard-coded manually; nproc and NUMBER_OF_PROCESSORS do not respect Kubernetes pod CPU limits.
+ # Nested cmake --build (e.g. intel_gpu onednn_gpu ExternalProject) does not inherit --parallel from the top-level build.
+ CMAKE_BUILD_PARALLEL_LEVEL: '15'
steps:
- name: Clone OpenVINO
@@ -197,7 +200,7 @@ jobs:
-B ${BUILD_DIR}
- name: Cmake - Build
- run: cmake --build ${BUILD_DIR} --parallel $(nproc) -- --quiet
+ run: cmake --build ${BUILD_DIR} --parallel ${CMAKE_BUILD_PARALLEL_LEVEL} -- --quiet
- name: Show ccache stats and cleanup
run: |
diff --git a/.github/workflows/linux_riscv_conan.yml b/.github/workflows/linux_riscv_conan.yml
index 7fbd802de62..9823b681d12 100644
--- a/.github/workflows/linux_riscv_conan.yml
+++ b/.github/workflows/linux_riscv_conan.yml
@@ -119,6 +119,9 @@ jobs:
CCACHE_MAXSIZE: 2G
PIP_INDEX_URL: "http://pip-proxy.pip-proxy.svc.cluster.local/simple/"
PIP_TRUSTED_HOST: "pip-proxy.pip-proxy.svc.cluster.local"
+ # Hard-coded manually; nproc and NUMBER_OF_PROCESSORS do not respect Kubernetes pod CPU limits.
+ # Nested cmake --build (e.g. intel_gpu onednn_gpu ExternalProject) does not inherit --parallel from the top-level build.
+ CMAKE_BUILD_PARALLEL_LEVEL: '15'
steps:
- name: Clone OpenVINO
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
@@ -132,7 +135,7 @@ jobs:
- name: System info
uses: ./openvino/.github/actions/system_info
-
+
- name: Setup ccache
id: ccache_restore
uses: ./openvino/.github/actions/cache
@@ -241,13 +244,13 @@ jobs:
source ${OPENVINO_BUILD_DIR}/dependencies/deactivate_conanbuild.sh
- name: Cmake - Build
- run: cmake --build ${OPENVINO_BUILD_DIR} --parallel $(nproc) -- --quiet
+ run: cmake --build ${OPENVINO_BUILD_DIR} --parallel ${CMAKE_BUILD_PARALLEL_LEVEL} -- --quiet
- name: Show ccache stats
run: ccache --show-stats
- name: Cmake - Install
- run: cmake --build ${OPENVINO_BUILD_DIR} --parallel $(nproc) --target install -- --quiet
+ run: cmake --build ${OPENVINO_BUILD_DIR} --parallel ${CMAKE_BUILD_PARALLEL_LEVEL} --target install -- --quiet
- name: Build OpenVINO C++ samples
run: |
diff --git a/.github/workflows/linux_sanitizers.yml b/.github/workflows/linux_sanitizers.yml
index 0eadda413e7..6a69ee900c2 100644
--- a/.github/workflows/linux_sanitizers.yml
+++ b/.github/workflows/linux_sanitizers.yml
@@ -128,6 +128,9 @@ jobs:
OPENVINO_CONTRIB_REPO: /__w/openvino/openvino/openvino_contrib
PIP_INDEX_URL: "http://pip-proxy.pip-proxy.svc.cluster.local/simple/"
PIP_TRUSTED_HOST: "pip-proxy.pip-proxy.svc.cluster.local"
+ # Hard-coded manually; nproc and NUMBER_OF_PROCESSORS do not respect Kubernetes pod CPU limits.
+ # Nested cmake --build (e.g. intel_gpu onednn_gpu ExternalProject) does not inherit --parallel from the top-level build.
+ CMAKE_BUILD_PARALLEL_LEVEL: '15'
steps:
- name: Append the environment variable - load SCCACHE_AZURE_CONNECTION_STRING from file
@@ -158,7 +161,6 @@ jobs:
- name: System info
uses: ./openvino/.github/actions/system_info
- - name: Install python dependencies
run: |
# For Python API: build and wheel packaging
python3 -m pip install -r ${OPENVINO_REPO}/src/bindings/python/wheel/requirements-dev.txt
@@ -206,7 +208,7 @@ jobs:
- name: Cmake build - OpenVINO
run: |
- cmake --build ${BUILD_DIR} --parallel $(nproc) --config ${{ env.CMAKE_BUILD_TYPE }} -- --quiet
+ cmake --build ${BUILD_DIR} --parallel ${CMAKE_BUILD_PARALLEL_LEVEL} --config ${{ env.CMAKE_BUILD_TYPE }} -- --quiet
- name: Upload compile_commands
uses: ababushk/upload-artifact@ebc7d74ace101c08868aed05dba2aaf274b9a2c7 # main
@@ -230,7 +232,7 @@ jobs:
python3 ${OPENVINO_REPO}/src/frontends/gguf/tests/gen_arch_fixtures.py \
--fetch \
--out-dir ${INSTALL_TEST_DIR}/tests/test_data/arch_fixtures \
- -j $(nproc)
+ -j ${CMAKE_BUILD_PARALLEL_LEVEL}
- name: Remove unused files to free space
run: rm -rf ${BUILD_DIR}/*
diff --git a/.github/workflows/manylinux_2_28.yml b/.github/workflows/manylinux_2_28.yml
index bca0965587d..83919f401a8 100644
--- a/.github/workflows/manylinux_2_28.yml
+++ b/.github/workflows/manylinux_2_28.yml
@@ -128,6 +128,9 @@ jobs:
NODE_VERSION: 22
PIP_INDEX_URL: "http://pip-proxy.pip-proxy.svc.cluster.local/simple/"
PIP_TRUSTED_HOST: "pip-proxy.pip-proxy.svc.cluster.local"
+ # Hard-coded manually; nproc and NUMBER_OF_PROCESSORS do not respect Kubernetes pod CPU limits.
+ # Nested cmake --build (e.g. intel_gpu onednn_gpu ExternalProject) does not inherit --parallel from the top-level build.
+ CMAKE_BUILD_PARALLEL_LEVEL: '15'
steps:
- name: Append the environment variable - load SCCACHE_AZURE_CONNECTION_STRING from file
@@ -178,7 +181,7 @@ jobs:
-DENABLE_WHEEL=ON \
-S ${{ env.OPENVINO_REPO }} \
-B ${{ env.BUILD_DIR }}
- /usr/bin/cmake --build ${{ env.BUILD_DIR }} --parallel $(nproc) --config ${{ env.CMAKE_BUILD_TYPE }} -- --quiet
+ /usr/bin/cmake --build ${{ env.BUILD_DIR }} --parallel ${CMAKE_BUILD_PARALLEL_LEVEL} --config ${{ env.CMAKE_BUILD_TYPE }} -- --quiet
/usr/bin/cmake --install ${{ env.BUILD_DIR }} --config ${{ env.CMAKE_BUILD_TYPE }} --prefix ${{ env.INSTALL_DIR }}
/usr/bin/cmake --install ${{ env.BUILD_DIR }} --config ${{ env.CMAKE_BUILD_TYPE }} --prefix ${{ env.INSTALL_TEST_DIR }} --component tests
env:
@@ -206,7 +209,7 @@ jobs:
/usr/bin/cmake -DPython3_EXECUTABLE=${python_path} -DOpenVINODeveloperPackage_DIR=${{ env.BUILD_DIR }} -DENABLE_PYTHON=ON -DENABLE_WHEEL=ON -S ${{ env.OPENVINO_REPO }}/src/bindings/python -B ${py_build_dir}
fi
- /usr/bin/cmake --build ${py_build_dir} --parallel $(nproc) --config ${{ env.CMAKE_BUILD_TYPE }} -- --quiet
+ /usr/bin/cmake --build ${py_build_dir} --parallel ${CMAKE_BUILD_PARALLEL_LEVEL} --config ${{ env.CMAKE_BUILD_TYPE }} -- --quiet
/usr/bin/cmake --install ${py_build_dir} --config ${{ env.CMAKE_BUILD_TYPE }} --prefix ${{ env.INSTALL_WHEELS_DIR }} --component python_wheels
/usr/bin/cmake --install ${py_build_dir} --config ${{ env.CMAKE_BUILD_TYPE }} --prefix ${{ env.INSTALL_DIR }} --component pyopenvino_python${PY_VER}
@@ -218,7 +221,7 @@ jobs:
-DCPACK_GENERATOR=NPM \
-DENABLE_SYSTEM_TBB=OFF \
-DENABLE_WHEEL=OFF
- /usr/bin/cmake --build ${{ env.BUILD_DIR }} --parallel $(nproc) -- --quiet
+ /usr/bin/cmake --build ${{ env.BUILD_DIR }} --parallel ${CMAKE_BUILD_PARALLEL_LEVEL} -- --quiet
/usr/bin/cmake --install ${{ env.BUILD_DIR }} --prefix ${{ env.OPENVINO_REPO }}/src/bindings/js/node/bin
- name: Pack Artifacts
diff --git a/.github/workflows/ubuntu_22.yml b/.github/workflows/ubuntu_22.yml
index 9dca62f0957..71de2e28215 100644
--- a/.github/workflows/ubuntu_22.yml
+++ b/.github/workflows/ubuntu_22.yml
@@ -121,6 +121,7 @@ jobs:
uses: ./.github/workflows/job_build_linux.yml
with:
runner: 'aks-linux-16-cores-32gb'
+ cmake-build-parallel-level: '15'
image: ${{ fromJSON(needs.docker.outputs.images).ov_build.ubuntu_22_04_x64 }}
affected-components: ${{ needs.smart_ci.outputs.affected_components }}
event-name: ${{ github.event_name }}
@@ -319,6 +320,7 @@ jobs:
uses: ./.github/workflows/job_onnx_runtime.yml
with:
runner: 'aks-linux-16-cores-32gb'
+ cmake-build-parallel-level: '15'
image: ${{ fromJSON(needs.docker.outputs.images).ov_build.ubuntu_22_04_x64 }}
sccache-azure-key-prefix: 'ubuntu22_x86_64_onnxruntime'
@@ -522,6 +524,7 @@ jobs:
uses: ./.github/workflows/job_gguf_llamacpp_validation.yml
with:
runner: 'aks-linux-16-cores-32gb'
+ cmake-build-parallel-level: '15'
image: ${{ fromJSON(needs.docker.outputs.images).ov_build.ubuntu_22_04_x64 }}
NVIDIA_Plugin:
@@ -555,6 +558,9 @@ jobs:
NVIDIA_BUILD_DIR: /__w/openvino/openvino/nvidia_plugin_build
DEBIAN_FRONTEND: 'noninteractive'
SCCACHE_AZURE_KEY_PREFIX: ubuntu22_x86_64_Release
+ # Hard-coded manually; nproc and NUMBER_OF_PROCESSORS do not respect Kubernetes pod CPU limits.
+ # Nested cmake --build (e.g. intel_gpu onednn_gpu ExternalProject) does not inherit --parallel from the top-level build.
+ CMAKE_BUILD_PARALLEL_LEVEL: '15'
if: fromJSON(needs.smart_ci.outputs.affected_components).NVIDIA
steps:
@@ -605,7 +611,7 @@ jobs:
-DCMAKE_COMPILE_WARNING_AS_ERROR=OFF \
-S ${OPENVINO_CONTRIB_REPO}/modules/nvidia_plugin \
-B ${NVIDIA_BUILD_DIR}
- cmake --build ${NVIDIA_BUILD_DIR} --parallel $(nproc) --config ${{ env.CMAKE_BUILD_TYPE }} -- --quiet ov_nvidia_func_tests ov_nvidia_unit_tests
+ cmake --build ${NVIDIA_BUILD_DIR} --parallel ${CMAKE_BUILD_PARALLEL_LEVEL} --config ${{ env.CMAKE_BUILD_TYPE }} -- --quiet ov_nvidia_func_tests ov_nvidia_unit_tests
- name: Show ccache stats
run: ${SCCACHE_PATH} --show-stats
diff --git a/.github/workflows/ubuntu_22_arm64_cross_compilation.yml b/.github/workflows/ubuntu_22_arm64_cross_compilation.yml
index cb339e85fe1..2ae60c10f07 100644
--- a/.github/workflows/ubuntu_22_arm64_cross_compilation.yml
+++ b/.github/workflows/ubuntu_22_arm64_cross_compilation.yml
@@ -130,6 +130,7 @@ jobs:
uses: ./.github/workflows/job_build_linux.yml
with:
runner: 'aks-linux-16-cores-32gb'
+ cmake-build-parallel-level: '15'
image: ${{ fromJSON(needs.docker.outputs.images).ov_build.ubuntu_22_04_arm64_cross_compilation }}
affected-components: ${{ needs.smart_ci.outputs.affected_components }}
event-name: ${{ github.event_name }}
diff --git a/.github/workflows/ubuntu_22_dpcpp.yml b/.github/workflows/ubuntu_22_dpcpp.yml
index 9ff3180c457..28f33767d1b 100644
--- a/.github/workflows/ubuntu_22_dpcpp.yml
+++ b/.github/workflows/ubuntu_22_dpcpp.yml
@@ -85,6 +85,7 @@ jobs:
uses: ./.github/workflows/job_build_linux.yml
with:
runner: 'aks-linux-16-cores-32gb'
+ cmake-build-parallel-level: '15'
image: ${{ fromJSON(needs.docker.outputs.images).ov_build.ubuntu_22_04_x64_dpcpp }}
affected-components: ${{ needs.smart_ci.outputs.affected_components }}
event-name: ${{ github.event_name }}
diff --git a/.github/workflows/ubuntu_24.yml b/.github/workflows/ubuntu_24.yml
index 568b749c1bc..e9591d1b5a3 100644
--- a/.github/workflows/ubuntu_24.yml
+++ b/.github/workflows/ubuntu_24.yml
@@ -100,6 +100,7 @@ jobs:
uses: ./.github/workflows/job_build_linux.yml
with:
runner: 'aks-linux-16-cores-32gb'
+ cmake-build-parallel-level: '15'
image: ${{ fromJSON(needs.docker.outputs.images).ov_build.ubuntu_24_04_x64 }}
affected-components: ${{ needs.smart_ci.outputs.affected_components }}
event-name: ${{ github.event_name }}
diff --git a/.github/workflows/ubuntu_26.yml b/.github/workflows/ubuntu_26.yml
index 926188a3f32..465c6a787ed 100644
--- a/.github/workflows/ubuntu_26.yml
+++ b/.github/workflows/ubuntu_26.yml
@@ -91,6 +91,7 @@ jobs:
uses: ./.github/workflows/job_build_linux.yml
with:
runner: 'aks-linux-16-cores-32gb'
+ cmake-build-parallel-level: '15'
image: ${{ fromJSON(needs.docker.outputs.images).ov_build.ubuntu_26_04_x64 }}
affected-components: ${{ needs.smart_ci.outputs.affected_components }}
event-name: ${{ github.event_name }}
diff --git a/.github/workflows/webassembly.yml b/.github/workflows/webassembly.yml
index 40893aa01a6..9bf767ddc56 100644
--- a/.github/workflows/webassembly.yml
+++ b/.github/workflows/webassembly.yml
@@ -110,6 +110,9 @@ jobs:
OPENVINO_REPO: /__w/openvino/openvino/openvino
OPENVINO_BUILD_DIR: /__w/openvino/openvino/openvino_build
SCCACHE_AZURE_KEY_PREFIX: webassembly_Release
+ # Hard-coded manually; nproc and NUMBER_OF_PROCESSORS do not respect Kubernetes pod CPU limits.
+ # Nested cmake --build (e.g. intel_gpu onednn_gpu ExternalProject) does not inherit --parallel from the top-level build.
+ CMAKE_BUILD_PARALLEL_LEVEL: '15'
steps:
- name: Append the environment variable - load SCCACHE_AZURE_CONNECTION_STRING from file
shell: bash
@@ -141,7 +144,7 @@ jobs:
-B ${OPENVINO_BUILD_DIR}
- name: cmake --build - build
- run: cmake --build ${OPENVINO_BUILD_DIR} --target hello_query_device --parallel $(nproc)
+ run: cmake --build ${OPENVINO_BUILD_DIR} --target hello_query_device --parallel ${CMAKE_BUILD_PARALLEL_LEVEL}
- name: Show ccache stats
run: ${SCCACHE_PATH} --show-stats
diff --git a/.github/workflows/windows_conditional_compilation.yml b/.github/workflows/windows_conditional_compilation.yml
index fb7128ce0de..a0ce7d13042 100644
--- a/.github/workflows/windows_conditional_compilation.yml
+++ b/.github/workflows/windows_conditional_compilation.yml
@@ -84,6 +84,9 @@ jobs:
BUILD_DIR: "${{ github.workspace }}\\openvino_build"
MODELS_PATH: "${{ github.workspace }}\\testdata"
SELECTIVE_BUILD_STAT_DIR: "${{ github.workspace }}\\selective_build_stat"
+ # Hard-coded manually; nproc and NUMBER_OF_PROCESSORS do not respect Kubernetes pod CPU limits.
+ # Nested cmake --build (e.g. intel_gpu onednn_gpu ExternalProject) does not inherit --parallel from the top-level build.
+ CMAKE_BUILD_PARALLEL_LEVEL: '31'
# TODO: specify version of compiler here
if: ${{ !needs.smart_ci.outputs.skip_workflow && github.event_name != 'merge_group' }}
@@ -176,8 +179,8 @@ jobs:
- name: Cmake build - CC COLLECT
run: |
- cmake --build ${{ env.BUILD_DIR }} --parallel $ENV:NUMBER_OF_PROCESSORS --config ${{ env.CMAKE_BUILD_TYPE }} -- --quiet && `
- cmake --build ${{ env.BUILD_DIR }} --parallel $ENV:NUMBER_OF_PROCESSORS --config ${{ env.CMAKE_BUILD_TYPE }} --target sea_itt_lib -- --quiet
+ cmake --build ${{ env.BUILD_DIR }} --parallel $env:CMAKE_BUILD_PARALLEL_LEVEL --config ${{ env.CMAKE_BUILD_TYPE }} -- --quiet && `
+ cmake --build ${{ env.BUILD_DIR }} --parallel $env:CMAKE_BUILD_PARALLEL_LEVEL --config ${{ env.CMAKE_BUILD_TYPE }} --target sea_itt_lib -- --quiet
- name: Show ccache stats
run: '& ccache --show-stats'
@@ -190,7 +193,7 @@ jobs:
- name: Build C++ samples - OpenVINO build tree
run: |
cmake -G "${{ env.CMAKE_GENERATOR }}" -DOpenVINO_DIR=${{ env.BUILD_DIR }} -S ${{ env.INSTALL_DIR }}/samples/cpp -B ${{ env.BUILD_DIR }}/cpp_samples
- cmake --build ${{ env.BUILD_DIR }}/cpp_samples --parallel $ENV:NUMBER_OF_PROCESSORS --config ${{ env.CMAKE_BUILD_TYPE }} --target hello_query_device -- --quiet
+ cmake --build ${{ env.BUILD_DIR }}/cpp_samples --parallel $env:CMAKE_BUILD_PARALLEL_LEVEL --config ${{ env.CMAKE_BUILD_TYPE }} --target hello_query_device -- --quiet
- name: Perform code tracing via ITT collector
shell: cmd
@@ -245,7 +248,7 @@ jobs:
# install PDB files to OpenVINO main installation folder to ensure that they are used instead of PDB files from build folder
cmake --install ${{ env.BUILD_DIR }} --config ${{ env.CMAKE_BUILD_TYPE }} --prefix ${{ env.INSTALL_DIR }} --component pdb
# then, we need to clean build tree to remove PDB files
- cmake --build ${{ env.BUILD_DIR }} --parallel $ENV:NUMBER_OF_PROCESSORS --config ${{ env.CMAKE_BUILD_TYPE }} --target clean -- /verbosity:minimal
+ cmake --build ${{ env.BUILD_DIR }} --parallel $env:CMAKE_BUILD_PARALLEL_LEVEL --config ${{ env.CMAKE_BUILD_TYPE }} --target clean -- /verbosity:minimal
& ${{ env.INSTALL_DIR }}/samples/c/build_samples.ps1 -i ${{ env.INSTALL_DIR }} -b ${{ env.BUILD_DIR }}/c_samples
env:
CXXFLAGS: "/Zi"
@@ -304,6 +307,9 @@ jobs:
BUILD_DIR: "${{ github.workspace }}\\openvino_build"
MODELS_PATH: "${{ github.workspace }}\\testdata"
SELECTIVE_BUILD_STAT_DIR: "${{ github.workspace }}\\selective_build_stat"
+ # Hard-coded manually; nproc and NUMBER_OF_PROCESSORS do not respect Kubernetes pod CPU limits.
+ # Nested cmake --build (e.g. intel_gpu onednn_gpu ExternalProject) does not inherit --parallel from the top-level build.
+ CMAKE_BUILD_PARALLEL_LEVEL: '15'
if: "!needs.smart_ci.outputs.skip_workflow"
steps:
@@ -362,7 +368,7 @@ jobs:
# Number of threads is hardcoded due to OutOfMemory issues. Unless we switch CMake's generator to Ninja, we can't
# set number of jobs separately for compilation and linking. The issue most likely occurs during linking.
- name: Cmake build - CC ON
- run: cmake --build ${{ env.BUILD_DIR }} --parallel 8 --config ${{ env.CMAKE_BUILD_TYPE }} --target benchmark_app -- /verbosity:minimal
+ run: cmake --build ${{ env.BUILD_DIR }} --parallel $env:CMAKE_BUILD_PARALLEL_LEVEL --config ${{ env.CMAKE_BUILD_TYPE }} --target benchmark_app -- /verbosity:minimal
- name: List bin files
shell: cmd
diff --git a/.github/workflows/windows_level_zero_build.yml b/.github/workflows/windows_level_zero_build.yml
index 34ac7f443f2..2fe5fa206a5 100644
--- a/.github/workflows/windows_level_zero_build.yml
+++ b/.github/workflows/windows_level_zero_build.yml
@@ -66,6 +66,7 @@ jobs:
uses: ./.github/workflows/job_build_windows.yml
with:
runner: 'aks-win-16-cores-32gb-build'
+ cmake-build-parallel-level: '15'
affected-components: ${{ needs.smart_ci.outputs.affected_components }}
build-type: 'Release'
build-variant: 'vs2022_levelzero'
diff --git a/.github/workflows/windows_vs2022_debug.yml b/.github/workflows/windows_vs2022_debug.yml
index 4e4450392b9..d6149068b82 100644
--- a/.github/workflows/windows_vs2022_debug.yml
+++ b/.github/workflows/windows_vs2022_debug.yml
@@ -66,6 +66,7 @@ jobs:
uses: ./.github/workflows/job_build_windows.yml
with:
runner: 'aks-win-32-cores-64gb-build'
+ cmake-build-parallel-level: '31'
affected-components: ${{ needs.smart_ci.outputs.affected_components }}
build-type: 'Debug'
target-branch: ${{ needs.smart_ci.outputs.target_branch }}
diff --git a/.github/workflows/windows_vs2022_release.yml b/.github/workflows/windows_vs2022_release.yml
index 1f738d7567d..f3b1a8bb1e6 100644
--- a/.github/workflows/windows_vs2022_release.yml
+++ b/.github/workflows/windows_vs2022_release.yml
@@ -67,6 +67,7 @@ jobs:
uses: ./.github/workflows/job_build_windows.yml
with:
runner: 'aks-win-16-cores-32gb-build'
+ cmake-build-parallel-level: '15'
affected-components: ${{ needs.smart_ci.outputs.affected_components }}
build-type: 'Release'
target-branch: ${{ needs.smart_ci.outputs.target_branch }}
diff --git a/.github/workflows/windows_vs2026_release.yml b/.github/workflows/windows_vs2026_release.yml
index 451e582d34f..ff339b6ca0c 100644
--- a/.github/workflows/windows_vs2026_release.yml
+++ b/.github/workflows/windows_vs2026_release.yml
@@ -68,6 +68,7 @@ jobs:
uses: ./.github/workflows/job_build_windows.yml
with:
runner: 'aks-win-16-cores-32gb-vs2026-build'
+ cmake-build-parallel-level: '15'
affected-components: ${{ needs.smart_ci.outputs.affected_components }}
build-type: 'Release'
target-branch: ${{ needs.smart_ci.outputs.target_branch }}