Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2021-2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# Copyright 2021-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
Expand Down Expand Up @@ -118,8 +118,10 @@ endif()
# platform
if (WIN32)
set(_FINDPACKAGE_PROTOBUF_CONFIG_DIR "${TRITON_THIRD_PARTY_INSTALL_PREFIX}/protobuf/cmake")
set(_FINDPACKAGE_UTF8_RANGE_CONFIG_DIR "${TRITON_THIRD_PARTY_INSTALL_PREFIX}/protobuf/cmake/utf8_range")
else()
set(_FINDPACKAGE_PROTOBUF_CONFIG_DIR "${TRITON_THIRD_PARTY_INSTALL_PREFIX}/protobuf/${LIB_DIR}/cmake/protobuf")
set(_FINDPACKAGE_UTF8_RANGE_CONFIG_DIR "${TRITON_THIRD_PARTY_INSTALL_PREFIX}/protobuf/${LIB_DIR}/cmake/utf8_range")
endif()

if(TRITON_ENABLE_CC_HTTP OR TRITON_ENABLE_CC_GRPC)
Expand All @@ -142,6 +144,7 @@ if(TRITON_ENABLE_CC_HTTP OR TRITON_ENABLE_CC_GRPC)
${_CMAKE_ARGS_VCPKG_TARGET_TRIPLET}
-DCURL_DIR:PATH=${TRITON_THIRD_PARTY_INSTALL_PREFIX}/curl/${LIB_DIR}/cmake/CURL
-DProtobuf_DIR:PATH=${_FINDPACKAGE_PROTOBUF_CONFIG_DIR}
-Dutf8_range_DIR:PATH=${_FINDPACKAGE_UTF8_RANGE_CONFIG_DIR}
-DgRPC_DIR:PATH=${TRITON_THIRD_PARTY_INSTALL_PREFIX}/grpc/lib/cmake/grpc
-Dabsl_DIR:PATH=${TRITON_THIRD_PARTY_INSTALL_PREFIX}/absl/${LIB_DIR}/cmake/absl
-Dre2_DIR:PATH=${TRITON_THIRD_PARTY_INSTALL_PREFIX}/re2/${LIB_DIR}/cmake/re2
Expand Down Expand Up @@ -179,6 +182,7 @@ if(TRITON_ENABLE_PYTHON_HTTP OR TRITON_ENABLE_PYTHON_GRPC)
${_CMAKE_ARGS_CMAKE_TOOLCHAIN_FILE}
${_CMAKE_ARGS_VCPKG_TARGET_TRIPLET}
-DProtobuf_DIR:PATH=${_FINDPACKAGE_PROTOBUF_CONFIG_DIR}
-Dutf8_range_DIR:PATH=${_FINDPACKAGE_UTF8_RANGE_CONFIG_DIR}
-DgRPC_DIR:PATH=${TRITON_THIRD_PARTY_INSTALL_PREFIX}/grpc/lib/cmake/grpc
-Dabsl_DIR:PATH=${TRITON_THIRD_PARTY_INSTALL_PREFIX}/absl/${LIB_DIR}/cmake/absl
-Dc-ares_DIR:PATH=${TRITON_THIRD_PARTY_INSTALL_PREFIX}/c-ares/${LIB_DIR}/cmake/c-ares
Expand Down
11 changes: 8 additions & 3 deletions src/c++/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2021-2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# Copyright (c) 2021-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
Expand Down Expand Up @@ -113,7 +113,9 @@ if(TRITON_ENABLE_CC_GRPC)
set(protobuf_MODULE_COMPATIBLE TRUE CACHE BOOL "protobuf_MODULE_COMPATIBLE" FORCE)
find_package(Protobuf CONFIG REQUIRED)
message(STATUS "Using protobuf ${Protobuf_VERSION}")
include_directories(${Protobuf_INCLUDE_DIRS})
# SYSTEM so header-internal deprecation warnings in protobuf do not
# fail the -Werror build.
include_directories(SYSTEM ${Protobuf_INCLUDE_DIRS})
endif() # TRITON_ENABLE_CC_GRPC

#
Expand All @@ -122,7 +124,10 @@ endif() # TRITON_ENABLE_CC_GRPC
if(TRITON_ENABLE_CC_GRPC)
find_package(gRPC CONFIG REQUIRED)
message(STATUS "Using gRPC ${gRPC_VERSION}")
include_directories($<TARGET_PROPERTY:gRPC::grpc,INTERFACE_INCLUDE_DIRECTORIES>)
# SYSTEM so header-internal deprecation warnings in gRPC do not fail
# the -Werror build.
include_directories(
SYSTEM $<TARGET_PROPERTY:gRPC::grpc,INTERFACE_INCLUDE_DIRECTORIES>)
Comment on lines 116 to +130

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Directory-scope SYSTEM suppresses client-code deprecation warnings too

include_directories(SYSTEM ...) applies to every target in the current CMakeLists.txt and all add_subdirectory children (library, examples, tests). The SYSTEM flag suppresses [[deprecated]] warnings that fire when client code calls a deprecated protobuf or gRPC API — not only in-header warnings. A future call to a deprecated API in the client library or examples will silently compile clean under -Werror. The more targeted fix would be target_include_directories(<target> SYSTEM PRIVATE ...) on each affected target.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

endif() # TRITON_ENABLE_CC_GRPC

if(TRITON_ENABLE_CC_HTTP OR TRITON_ENABLE_CC_GRPC)
Expand Down
8 changes: 8 additions & 0 deletions src/c++/library/libgrpcclient.ldscript
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@
extern "C++" {
triton::client*;
inference*;
# protobuf v33's public message headers (exposed to consumers via the
# exported 'inference*' generated types) inline abseil CHECK/LOG(FATAL)
# calls. On aarch64 the inlined fast-path parser
# google::protobuf::internal::VarintParseSlowArm pulls these into the
# consumer translation unit, so a program linking only -lgrpcclient
# against this .so must be able to resolve the abseil log_internal
# symbols. Export them (glob keeps it version-string agnostic).
absl::*log_internal*;
};
local: *;
};
11 changes: 9 additions & 2 deletions src/c++/tests/cc_client_test.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2022-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
// Copyright 2022-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
Expand All @@ -24,6 +24,9 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

#include <google/protobuf/text_format.h>

#include <algorithm>
#include <fstream>

#define TRITON_INFERENCE_SERVER_CLIENT_CLASS InferenceServerHttpClient
Expand Down Expand Up @@ -234,7 +237,11 @@ class GRPCTraceTest : public ::testing::Test {
void ConvertResponse(
const inference::TraceSettingResponse& response, std::string* str)
{
*str = response.DebugString();
// Use TextFormat::PrintToString rather than DebugString(): protobuf v33
// deliberately makes DebugString() output unstable (it injects a
// "goo.gle/debugstr" marker) to discourage parsing, which breaks the
// string comparisons below. PrintToString gives stable text format.
google::protobuf::TextFormat::PrintToString(response, str);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 TextFormat::PrintToString returns false when serialisation fails (e.g. a required field is unset in proto2, or an internal error occurs). The return value is silently discarded here. While proto3 messages rarely fail, ignoring the result means a serialisation error would leave str unchanged and the subsequent string comparison would either pass spuriously or produce a misleading assertion failure rather than a clear "serialisation failed" message.

Suggested change
google::protobuf::TextFormat::PrintToString(response, str);
ASSERT_TRUE(google::protobuf::TextFormat::PrintToString(response, str))
<< "TextFormat::PrintToString failed";

str->erase(std::remove(str->begin(), str->end(), ' '), str->end());
str->erase(std::remove(str->begin(), str->end(), '\n'), str->end());
}
Expand Down
8 changes: 4 additions & 4 deletions src/grpc_generated/javascript/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/grpc_generated/javascript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "1.0.0",
"description": "Simple gRPC client for NVIDIA Triton in Node.js",
"dependencies": {
"@grpc/grpc-js": "^1.8.20",
"@grpc/grpc-js": "^1.14.4",
"@grpc/proto-loader": "^0.8.1"
},
"overrides": {
Expand Down
2 changes: 1 addition & 1 deletion src/java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.21.2</version>
<version>2.21.4</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
Expand Down
Loading