Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
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
18 changes: 17 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2020-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# Copyright (c) 2020-2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
Expand Down Expand Up @@ -137,6 +137,15 @@ if(TRITON_ONNXRUNTIME_LIB_PATHS STREQUAL "")
set(TRITON_ONNXRUNTIME_DOCKER_BUILD ON)
endif()

set(RHEL_BUILD OFF)
if(LINUX)
file(STRINGS "/etc/os-release" DISTRO_ID_LIKE REGEX "ID_LIKE")
if(${DISTRO_ID_LIKE} MATCHES "rhel|centos")
set(RHEL_BUILD ON)
endif(${DISTRO_ID_LIKE} MATCHES "rhel|centos")
endif(LINUX)
set(TRITON_CORE_HEADERS_ONLY OFF)

message(STATUS "Using Onnxruntime docker: ${TRITON_ONNXRUNTIME_DOCKER_BUILD}")

if(NOT TRITON_ONNXRUNTIME_DOCKER_BUILD)
Expand Down Expand Up @@ -324,6 +333,13 @@ endif() # TRITON_ENABLE_ONNXRUNTIME_OPENVINO
#
if(TRITON_ONNXRUNTIME_DOCKER_BUILD)
set(_GEN_FLAGS "")
if(${RHEL_BUILD} AND "${TRITON_BUILD_TENSORRT_HOME}" STREQUAL "")
if(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "aarch64")
set(TRITON_BUILD_TENSORRT_HOME "/usr/local/cuda/targets/sbsa-linux/")
else()
set(TRITON_BUILD_TENSORRT_HOME "/usr/local/cuda/targets/x86_64-linux/")
endif(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "aarch64")
endif(${RHEL_BUILD} AND "${TRITON_BUILD_TENSORRT_HOME}" STREQUAL "")
if(NOT ${TRITON_BUILD_TARGET_PLATFORM} STREQUAL "")
set(_GEN_FLAGS ${_GEN_FLAGS} "--target-platform=${TRITON_BUILD_TARGET_PLATFORM}")
endif() # TRITON_BUILD_TARGET_PLATFORM
Expand Down
7 changes: 3 additions & 4 deletions tools/gen_ort_dockerfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def dockerfile_for_linux(output_file):
df += """
# The manylinux container defaults to Python 3.7, but some feature installation
# requires a higher version.
ARG PYVER=3.10
ARG PYVER=3.12
ENV PYTHONPATH=/opt/python/v
RUN ln -sf /opt/python/cp${PYVER/./}* ${PYTHONPATH}

Expand Down Expand Up @@ -602,9 +602,8 @@ def preprocess_gpu_flags():
"--target-platform",
required=False,
default=None,
help='Target for build, can be "linux", "windows" or "igpu". If not specified, build targets the current platform.',
help='Target for build, can be "linux", "windows", "rhel", or "igpu". If not specified, build targets the current platform.',
)

parser.add_argument(
"--cuda-version", type=str, required=False, help="Version for CUDA."
)
Expand Down Expand Up @@ -661,4 +660,4 @@ def preprocess_gpu_flags():
FLAGS.ort_openvino = None
dockerfile_for_windows(FLAGS.output)
else:
dockerfile_for_linux(FLAGS.output)
dockerfile_for_linux(FLAGS.output)
Loading