Skip to content

Commit bc4a7cb

Browse files
authored
build: Support RHEL ORT TensorRT Execution Provider (#285)
* Enable ORT TRT extension for RHEL
1 parent 56ce169 commit bc4a7cb

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

tools/gen_ort_dockerfile.py

Lines changed: 10 additions & 5 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
@@ -572,7 +572,13 @@ def preprocess_gpu_flags():
572572
print("error: linux build requires --cudnn-home and --cuda-home")
573573

574574
if FLAGS.tensorrt_home is None:
575-
FLAGS.tensorrt_home = "/usr/src/tensorrt"
575+
if target_platform() == "rhel":
576+
if platform.machine().lower() == "aarch64":
577+
FLAGS.tensorrt_home = "/usr/local/cuda/targets/sbsa-linux/"
578+
else:
579+
FLAGS.tensorrt_home = "/usr/local/cuda/targets/x86_64-linux/"
580+
else:
581+
FLAGS.tensorrt_home = "/usr/src/tensorrt"
576582

577583

578584
if __name__ == "__main__":
@@ -602,9 +608,8 @@ def preprocess_gpu_flags():
602608
"--target-platform",
603609
required=False,
604610
default=None,
605-
help='Target for build, can be "linux", "windows" or "igpu". If not specified, build targets the current platform.',
611+
help='Target for build, can be "linux", "windows", "rhel", or "igpu". If not specified, build targets the current platform.',
606612
)
607-
608613
parser.add_argument(
609614
"--cuda-version", type=str, required=False, help="Version for CUDA."
610615
)
@@ -661,4 +666,4 @@ def preprocess_gpu_flags():
661666
FLAGS.ort_openvino = None
662667
dockerfile_for_windows(FLAGS.output)
663668
else:
664-
dockerfile_for_linux(FLAGS.output)
669+
dockerfile_for_linux(FLAGS.output)

0 commit comments

Comments
 (0)