From 75c25f7611e15b500723953725bcae6a08b69d92 Mon Sep 17 00:00:00 2001 From: fpetrini15 Date: Fri, 30 Aug 2024 11:07:22 -0700 Subject: [PATCH 1/3] RHEL SBSA Build --- CMakeLists.txt | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7a70a85..4ee6210 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -52,6 +52,18 @@ endif() set(TRITON_TENSORRT_BACKEND_LIBNAME triton_tensorrt) set(TRITON_TENSORRT_BACKEND_INSTALLDIR ${CMAKE_INSTALL_PREFIX}/backends/tensorrt) +set(RHEL_NVINFER_PATH "") +if(LINUX) + file(STRINGS "/etc/os-release" DISTRO_ID_LIKE REGEX "ID_LIKE") + if(${DISTRO_ID_LIKE} MATCHES "rhel|centos") + if(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "aarch64") + set(RHEL_NVINFER_PATH "/usr/local/cuda/targets/sbsa-linux/lib") + else() + set(RHEL_NVINFER_PATH "/usr/local/cuda/targets/x86_64-linux/lib") + endif() + endif(${DISTRO_ID_LIKE} MATCHES "rhel|centos") +endif(LINUX) + # # Dependencies # @@ -247,8 +259,8 @@ ENDFOREACH(p) # NOTE: TRT 10 for Windows added the version suffix to the library names. See the release notes: # https://docs.nvidia.com/deeplearning/tensorrt/release-notes/index.html#tensorrt-10 -find_library(NVINFER_LIBRARY NAMES nvinfer nvinfer_10 PATHS "/usr/local/cuda/targets/x86_64-linux/lib") -find_library(NVINFER_PLUGIN_LIBRARY NAMES nvinfer_plugin nvinfer_plugin_10 PATHS "/usr/local/cuda/targets/x86_64-linux/lib") +find_library(NVINFER_LIBRARY NAMES nvinfer nvinfer_10 PATHS ${RHEL_NVINFER_PATH}) +find_library(NVINFER_PLUGIN_LIBRARY NAMES nvinfer_plugin nvinfer_plugin_10 PATHS ${RHEL_NVINFER_PATH}) target_link_libraries( triton-tensorrt-backend PRIVATE From 4609a9e792fd019dde5013daadd59d0046e756a7 Mon Sep 17 00:00:00 2001 From: fpetrini15 Date: Wed, 4 Sep 2024 12:01:04 -0700 Subject: [PATCH 2/3] Use CMAKE_PREFIX_PATH --- CMakeLists.txt | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4ee6210..00147e6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -52,17 +52,7 @@ endif() set(TRITON_TENSORRT_BACKEND_LIBNAME triton_tensorrt) set(TRITON_TENSORRT_BACKEND_INSTALLDIR ${CMAKE_INSTALL_PREFIX}/backends/tensorrt) -set(RHEL_NVINFER_PATH "") -if(LINUX) - file(STRINGS "/etc/os-release" DISTRO_ID_LIKE REGEX "ID_LIKE") - if(${DISTRO_ID_LIKE} MATCHES "rhel|centos") - if(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "aarch64") - set(RHEL_NVINFER_PATH "/usr/local/cuda/targets/sbsa-linux/lib") - else() - set(RHEL_NVINFER_PATH "/usr/local/cuda/targets/x86_64-linux/lib") - endif() - endif(${DISTRO_ID_LIKE} MATCHES "rhel|centos") -endif(LINUX) +set(CMAKE_PREFIX_PATH "/usr/local/cuda/targets/sbsa-linux/lib;/usr/local/cuda/targets/x86_64-linux/lib") # # Dependencies @@ -259,8 +249,8 @@ ENDFOREACH(p) # NOTE: TRT 10 for Windows added the version suffix to the library names. See the release notes: # https://docs.nvidia.com/deeplearning/tensorrt/release-notes/index.html#tensorrt-10 -find_library(NVINFER_LIBRARY NAMES nvinfer nvinfer_10 PATHS ${RHEL_NVINFER_PATH}) -find_library(NVINFER_PLUGIN_LIBRARY NAMES nvinfer_plugin nvinfer_plugin_10 PATHS ${RHEL_NVINFER_PATH}) +find_library(NVINFER_LIBRARY NAMES nvinfer nvinfer_10) +find_library(NVINFER_PLUGIN_LIBRARY NAMES nvinfer_plugin nvinfer_plugin_10) target_link_libraries( triton-tensorrt-backend PRIVATE From c8cc448209c66c0028a4c183a0bde4e393434d82 Mon Sep 17 00:00:00 2001 From: fpetrini15 Date: Thu, 5 Sep 2024 16:44:47 -0700 Subject: [PATCH 3/3] Review comments --- CMakeLists.txt | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 00147e6..bc1c10d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -52,7 +52,17 @@ endif() set(TRITON_TENSORRT_BACKEND_LIBNAME triton_tensorrt) set(TRITON_TENSORRT_BACKEND_INSTALLDIR ${CMAKE_INSTALL_PREFIX}/backends/tensorrt) -set(CMAKE_PREFIX_PATH "/usr/local/cuda/targets/sbsa-linux/lib;/usr/local/cuda/targets/x86_64-linux/lib") + +if(LINUX) + file(STRINGS "/etc/os-release" DISTRO_ID_LIKE REGEX "ID_LIKE") + if(${DISTRO_ID_LIKE} MATCHES "rhel|centos") + if(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "aarch64") + set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} "/usr/local/cuda/targets/sbsa-linux/lib") + else() + set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} "/usr/local/cuda/targets/x86_64-linux/lib") + endif() + endif(${DISTRO_ID_LIKE} MATCHES "rhel|centos") +endif(LINUX) # # Dependencies