From ffcbe0b51f36f3548431cafdb496ba3204a74232 Mon Sep 17 00:00:00 2001 From: Francesco Petrini Date: Wed, 11 Sep 2024 16:28:37 -0700 Subject: [PATCH] RHEL SBSA Build (#99) * RHEL SBSA Build --- CMakeLists.txt | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7a70a85..bc1c10d 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) + +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 # @@ -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) +find_library(NVINFER_PLUGIN_LIBRARY NAMES nvinfer_plugin nvinfer_plugin_10) target_link_libraries( triton-tensorrt-backend PRIVATE