Skip to content

Commit 2fe1f30

Browse files
committed
Enable ORT TRT extension
1 parent 56ce169 commit 2fe1f30

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

CMakeLists.txt

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2020-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
1+
# Copyright (c) 2020-2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
22
#
33
# Redistribution and use in source and binary forms, with or without
44
# modification, are permitted provided that the following conditions
@@ -137,6 +137,15 @@ if(TRITON_ONNXRUNTIME_LIB_PATHS STREQUAL "")
137137
set(TRITON_ONNXRUNTIME_DOCKER_BUILD ON)
138138
endif()
139139

140+
set(RHEL_BUILD OFF)
141+
if(LINUX)
142+
file(STRINGS "/etc/os-release" DISTRO_ID_LIKE REGEX "ID_LIKE")
143+
if(${DISTRO_ID_LIKE} MATCHES "rhel|centos")
144+
set(RHEL_BUILD ON)
145+
endif(${DISTRO_ID_LIKE} MATCHES "rhel|centos")
146+
endif(LINUX)
147+
set(TRITON_CORE_HEADERS_ONLY OFF)
148+
140149
message(STATUS "Using Onnxruntime docker: ${TRITON_ONNXRUNTIME_DOCKER_BUILD}")
141150

142151
if(NOT TRITON_ONNXRUNTIME_DOCKER_BUILD)
@@ -324,6 +333,9 @@ endif() # TRITON_ENABLE_ONNXRUNTIME_OPENVINO
324333
#
325334
if(TRITON_ONNXRUNTIME_DOCKER_BUILD)
326335
set(_GEN_FLAGS "")
336+
if(${RHEL_BUILD} AND "${TRITON_BUILD_TENSORRT_HOME}" STREQUAL "")
337+
set(TRITON_BUILD_TENSORRT_HOME "/usr/local/cuda/targets/${CMAKE_SYSTEM_PROCESSOR}-linux/")
338+
endif(${RHEL_BUILD} AND "${TRITON_BUILD_TENSORRT_HOME}" STREQUAL "")
327339
if(NOT ${TRITON_BUILD_TARGET_PLATFORM} STREQUAL "")
328340
set(_GEN_FLAGS ${_GEN_FLAGS} "--target-platform=${TRITON_BUILD_TARGET_PLATFORM}")
329341
endif() # TRITON_BUILD_TARGET_PLATFORM

tools/gen_ort_dockerfile.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def dockerfile_for_linux(output_file):
105105
df += """
106106
# The manylinux container defaults to Python 3.7, but some feature installation
107107
# requires a higher version.
108-
ARG PYVER=3.10
108+
ARG PYVER=3.12
109109
ENV PYTHONPATH=/opt/python/v
110110
RUN ln -sf /opt/python/cp${PYVER/./}* ${PYTHONPATH}
111111
@@ -602,9 +602,8 @@ def preprocess_gpu_flags():
602602
"--target-platform",
603603
required=False,
604604
default=None,
605-
help='Target for build, can be "linux", "windows" or "igpu". If not specified, build targets the current platform.',
605+
help='Target for build, can be "linux", "windows", "rhel", or "igpu". If not specified, build targets the current platform.',
606606
)
607-
608607
parser.add_argument(
609608
"--cuda-version", type=str, required=False, help="Version for CUDA."
610609
)
@@ -661,4 +660,4 @@ def preprocess_gpu_flags():
661660
FLAGS.ort_openvino = None
662661
dockerfile_for_windows(FLAGS.output)
663662
else:
664-
dockerfile_for_linux(FLAGS.output)
663+
dockerfile_for_linux(FLAGS.output)

0 commit comments

Comments
 (0)