onnxruntime/tools/ci_build/github/linux/build_tensorrt_ci.sh
Yifan Li a3bb3f1487
[TensorRT EP] New CIs to test TRT+minimal CUDA build (#23028)
### Description
<!-- Describe your changes. -->
New CI:
[Linux_TRT_Minimal_CUDA_Test_CI](https://dev.azure.com/onnxruntime/onnxruntime/_build?definitionId=230&_a=summary)
and [Win_TRT_Minimal_CUDA_Test_CI
](https://dev.azure.com/onnxruntime/onnxruntime/_build?definitionId=231)
Setting config for new CI to monitor if there's no issue to build
ORT-TRTEP with minimal CUDA
* yaml content is following Linux TRT CI yaml, with different build
arg/cache name
* build arg is following [[TensorRT EP] Enable a minimal CUDA EP
compilation without
kernels](https://github.com/microsoft/onnxruntime/pull/19052#issuecomment-1888066851)



### Motivation and Context
<!-- - Why is this change required? What problem does it solve?
- If it fixes an open issue, please link to the issue here. -->
Monitor if user is able to build ORT-TRTEP-minimalCUDA without any
blocker
(which takes ~30min to build)
2024-12-19 10:30:39 -08:00

59 lines
1.8 KiB
Bash
Executable file

#!/bin/bash
set -ex
#Every cuda container has this $CUDA_VERSION env var set.
SHORT_CUDA_VERSION=$(echo $CUDA_VERSION | sed 's/\([[:digit:]]\+\.[[:digit:]]\+\)\.[[:digit:]]\+/\1/')
#TODO: add --update --build
BUILD_ARGS=('--config' 'Release'
'--skip_submodule_sync'
'--build_shared_lib'
'--parallel' '--use_binskim_compliant_compile_flags'
'--build_wheel'
'--enable_onnx_tests'
'--use_cuda'
"--cuda_version=$SHORT_CUDA_VERSION"
"--cuda_home=/usr/local/cuda-$SHORT_CUDA_VERSION"
"--cudnn_home=/usr/local/cuda-$SHORT_CUDA_VERSION"
"--use_tensorrt" "--tensorrt_home" "/usr"
"--enable_pybind"
"--build_java"
"--cmake_extra_defines"
"CMAKE_CUDA_ARCHITECTURES=75"
"onnxruntime_BUILD_UNIT_TESTS=ON"
"onnxruntime_ENABLE_CUDA_EP_INTERNAL_TESTS=ON")
# Parse external args
for arg in "$@"; do
case $arg in
--cuda_minimal=ON)
# Replace onnxruntime_BUILD_UNIT_TESTS=ON with OFF
BUILD_ARGS=("${BUILD_ARGS[@]/onnxruntime_BUILD_UNIT_TESTS=ON/onnxruntime_BUILD_UNIT_TESTS=OFF}")
BUILD_ARGS+=("--enable_cuda_minimal_build")
BUILD_ARGS+=("--skip_tests")
;;
esac
done
if [ -x "$(command -v ninja)" ]; then
BUILD_ARGS+=('--cmake_generator' 'Ninja')
fi
if [ -d /build ]; then
BUILD_ARGS+=('--build_dir' '/build')
else
BUILD_ARGS+=('--build_dir' 'build')
fi
if [ -x "$(command -v ccache)" ]; then
ccache -s;
BUILD_ARGS+=("--use_cache")
fi
if [ -f /opt/python/cp312-cp312/bin/python3 ]; then
/opt/python/cp312-cp312/bin/python3 tools/ci_build/build.py "${BUILD_ARGS[@]}"
else
python3 tools/ci_build/build.py "${BUILD_ARGS[@]}"
fi
if [ -x "$(command -v ccache)" ]; then
ccache -sv
ccache -z
fi