Cannot use built-in grpc & protobuf in DS-7.0 container

• Hardware Platform (Jetson / GPU) GPU
• DeepStream Version 7.0
• TensorRT Version Container
• NVIDIA GPU Driver Version (valid for GPU only) 565
• Issue Type( questions, new requirements, bugs) Question & Bug

• How to reproduce the issue ? (This is for bugs. Including which sample app is using, the configuration files content, the command line used and other details for reproducing)

Can not use protobuf provided inside container, in DS-7.0, the author added /root/.local/lib into LD_LIBRARY_PATH, which contains grpc, protobuf, absl (all dynamic). But they are incompatible with Deepstream itself when using nvinferserver.

From the call stack, seems this issue was caused by libnvdsgst_inferserver.so, the call stack:

I think the inferserver try dlload tritonserver when startup, and tritonserver contains a static protobuf, while my program already load a dynamic version, then cause this issue ??

maybe using the protobuf from /opt/tritonclient/lib will fix, but it’s sub-optimal, because i need to manage all dependencies by hand without cmake, not to mention I may use grpc in future, which would be more complex.

So is there any better way to deal with this?

• Requirement details( This is for new requirement. Including the module name-for which plugin or for which sample application, the function description)

Code to reproduce:

test.cc

int main(int argc, char *argv[]) {
  gst_init(&argc, &argv);
  assert(gst_is_initialized());
  test::Test t;
  t.set_name("hello");
  std::cout << grpc::Version() << " " << t.ShortDebugString() << std::endl;
  std::cout << t.ShortDebugString() << std::endl;
  auto *urisrc = gst_element_factory_make("nvurisrcbin", NULL);
  auto *inferserver = gst_element_factory_make("nvinferserver", NULL);
  return 0;
}

test.proto

syntax = "proto3";

package test;

message Test {
    string name = 1;
}

cmake

cmake_minimum_required(VERSION 3.17.0)

project(
  nvds_test
  VERSION 0.1
  LANGUAGES C CXX)

list(APPEND CMAKE_MODULE_PATH "/root/.local/lib/cmake")
find_package(PkgConfig REQUIRED)
find_package(Protobuf REQUIRED)
find_package(gRPC REQUIRED)
pkg_check_modules(glib2 REQUIRED glib-2.0>=2.0 IMPORTED_TARGET)
pkg_check_modules(
  gstreamer
  REQUIRED
  gstreamer-1.0
  gstreamer-audio-1.0
  gstreamer-video-1.0
  gstreamer-base-1.0
  IMPORTED_TARGET)

add_library(proto STATIC test.proto)
protobuf_generate(
  TARGET
  proto
  LANGUAGE
  cpp
  PLUGIN
  $<TARGET_FILE:protobuf::protoc>)
target_link_libraries(proto PRIVATE ${_GRPC} protobuf::libprotobuf)
target_include_directories(
  proto PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>)

if(TARGET gRPC::grpc++)
  set(_GRPC gRPC::grpc++)
  message(DEBUG "gRPC::grpc++")
elseif(TARGET grpc++)
  set(_GRPC grpc++)
  message(DEBUG "grpc++")
else()
  message(FATAL_ERROR "grpc++ not found")
endif()

add_executable(${PROJECT_NAME} test.cc)
target_include_directories(
  ${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}
                          $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>)
target_link_libraries(${PROJECT_NAME} PRIVATE PkgConfig::glib2 PkgConfig::gstreamer protobuf::libprotobuf ${_GRPC} proto )

nvinferserver plugin and low-level lib are opensource. please refer to \opt\nvidia\deepstream\deepstream\sources\gst-plugins\gst-nvinferserver\README and \opt\nvidia\deepstream\deepstream\sources\libs\nvdsinferserver\README. they both are using Protobuf compiler v3.21.12

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.