Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ stages:
-p ${{ parameters.docker_python_exe_path }}
-v ${{ parameters.cuda_version }}
-a "${{ parameters.cmake_cuda_archs }}"
-h "${{ parameters.arch }}"
workingDirectory: $(Build.SourcesDirectory)
displayName: 'Build CUDA Plugin (Python ${{ parameters.python_version }}, ${{ parameters.arch }}, CUDA ${{ parameters.cuda_version }})'
env:
Expand Down
11 changes: 8 additions & 3 deletions tools/ci_build/github/linux/build_cuda_plugin_package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,25 @@ DOCKER_IMAGE="onnxruntimecuda128pluginbuild"
PYTHON_EXE="/opt/python/cp312-cp312/bin/python3.12"
CUDA_VERSION="12.8"
CMAKE_CUDA_ARCHS="86"
arch="x64"

while getopts "i:c:p:v:a:" parameter_Option
while getopts "i:c:p:v:a:h:" parameter_Option
do case "${parameter_Option}"
in
i) DOCKER_IMAGE=${OPTARG};;
c) BUILD_CONFIG=${OPTARG};;
p) PYTHON_EXE=${OPTARG};;
v) CUDA_VERSION=${OPTARG};;
a) CMAKE_CUDA_ARCHS=${OPTARG};;
*) echo "Usage: $0 -i <docker_image> [-c <build_config>] [-p <python_exe_path>] [-v <cuda_version>] [-a <cuda_archs>]"
h) arch=${OPTARG};;
*) echo "Usage: $0 -i <docker_image> [-c <build_config>] [-p <python_exe_path>] [-v <cuda_version>] [-a <cuda_archs>] [-h <arch>]"
exit 1;;
esac
done

# Update parallel to the minimum of the number of processors and 8 for aarch64 to avoid OOM errors during build.
PARALLEL=$([ "$arch" = "aarch64" ] && echo "$(( $(nproc) < 8 ? $(nproc) : 8 ))")
Comment thread
tianleiwu marked this conversation as resolved.
Outdated

PYTHON_BIN_DIR=$(dirname "${PYTHON_EXE}")

# Derive SHORT_CUDA_VERSION (e.g., 12.8 from 12.8, 13.0 from 13.0)
Expand Down Expand Up @@ -54,7 +59,7 @@ docker run --rm \
--build_dir /build \
--config ${BUILD_CONFIG} \
--skip_submodule_sync \
--parallel \
--parallel ${PARALLEL} \
--nvcc_threads 1 \
--flash_nvcc_threads 1 \
--use_binskim_compliant_compile_flags \
Expand Down
Loading