From 2eb7f15388590cc71a64195cba37ac8298356fb5 Mon Sep 17 00:00:00 2001 From: Kevin Pedro Date: Fri, 14 May 2021 15:22:11 -0500 Subject: [PATCH 1/3] Triton: enable GPU support --- triton-inference-server-toolfile.spec | 1 + triton-inference-server.spec | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/triton-inference-server-toolfile.spec b/triton-inference-server-toolfile.spec index e16a701c6be..c34828cac35 100644 --- a/triton-inference-server-toolfile.spec +++ b/triton-inference-server-toolfile.spec @@ -19,6 +19,7 @@ cat << \EOF_TOOLFILE >%i/etc/scram.d/triton-inference-server.xml + EOF_TOOLFILE diff --git a/triton-inference-server.spec b/triton-inference-server.spec index cbb13dcb714..97a65c17a69 100644 --- a/triton-inference-server.spec +++ b/triton-inference-server.spec @@ -4,7 +4,7 @@ Source: git+https://github.com/%{github_user}/server.git?obj=%{branch}/v%{realversion}&export=%{n}-%{realversion}&output=/%{n}-%{realversion}.tgz BuildRequires: cmake -Requires: openssl opencv protobuf grpc curl python py2-wheel py2-setuptools py2-grpcio-tools python3 +Requires: openssl opencv protobuf grpc curl python py2-wheel py2-setuptools py2-grpcio-tools python3 cuda %prep @@ -35,7 +35,7 @@ cmake ../%{n}-%{realversion}/build/client \ -DCMAKE_INSTALL_PREFIX="%{i}" \ -DCMAKE_INSTALL_LIBDIR=lib \ -DCMAKE_BUILD_TYPE=Release \ - -DTRITON_ENABLE_GPU=OFF \ + -DTRITON_ENABLE_GPU=ON \ -DTRITON_CLIENT_SKIP_EXAMPLES=ON \ -DTRITON_CURL_WITHOUT_CONFIG=ON \ -DCURL_LIBRARY=${CURL_ROOT}/lib/libcurl.so \ From 1bc75bd3c0ab37b3d1ae3e2ce7c339a7c2e25b94 Mon Sep 17 00:00:00 2001 From: Kevin Pedro Date: Mon, 24 May 2021 18:23:33 -0500 Subject: [PATCH 2/3] enforce GPU macro --- triton-inference-server.spec | 3 +++ 1 file changed, 3 insertions(+) diff --git a/triton-inference-server.spec b/triton-inference-server.spec index 97a65c17a69..b748699a6b7 100644 --- a/triton-inference-server.spec +++ b/triton-inference-server.spec @@ -54,6 +54,9 @@ make %{makeprocesses} cd ../build make install +# modify header for consistent definition of GPU support +sed -i '/^#ifdef TRITON_ENABLE_GPU/i #define TRITON_ENABLE_GPU' %{i}/include/ipc.h + # extra headers needed cp src/core/model_config.pb.h %{i}/include/ cp src/core/grpc_service.grpc.pb.h %{i}/include/ From f88ebf5ca026c902ac9cc679bd169d18ceca65c1 Mon Sep 17 00:00:00 2001 From: Kevin Pedro Date: Tue, 25 May 2021 15:09:28 -0500 Subject: [PATCH 3/3] make CUDA optional --- triton-inference-server.spec | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/triton-inference-server.spec b/triton-inference-server.spec index b748699a6b7..6c4bb0a6f4d 100644 --- a/triton-inference-server.spec +++ b/triton-inference-server.spec @@ -31,11 +31,17 @@ rm -rf ../build mkdir ../build cd ../build +if [ $(%{cuda_gcc_support}) = true ]; then + TRITON_ENABLE_GPU_VALUE=ON +else + TRITON_ENABLE_GPU_VALUE=OFF +fi + cmake ../%{n}-%{realversion}/build/client \ -DCMAKE_INSTALL_PREFIX="%{i}" \ -DCMAKE_INSTALL_LIBDIR=lib \ -DCMAKE_BUILD_TYPE=Release \ - -DTRITON_ENABLE_GPU=ON \ + -DTRITON_ENABLE_GPU=${TRITON_ENABLE_GPU_VALUE} \ -DTRITON_CLIENT_SKIP_EXAMPLES=ON \ -DTRITON_CURL_WITHOUT_CONFIG=ON \ -DCURL_LIBRARY=${CURL_ROOT}/lib/libcurl.so \ @@ -54,8 +60,10 @@ make %{makeprocesses} cd ../build make install -# modify header for consistent definition of GPU support -sed -i '/^#ifdef TRITON_ENABLE_GPU/i #define TRITON_ENABLE_GPU' %{i}/include/ipc.h +if [ $(%{cuda_gcc_support}) = true ] ; then + # modify header for consistent definition of GPU support + sed -i '/^#ifdef TRITON_ENABLE_GPU/i #define TRITON_ENABLE_GPU' %{i}/include/ipc.h +fi # extra headers needed cp src/core/model_config.pb.h %{i}/include/