Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

client fails to compile #5078

Closed
johntaves opened this issue Nov 15, 2022 · 10 comments
Closed

client fails to compile #5078

johntaves opened this issue Nov 15, 2022 · 10 comments

Comments

@johntaves
Copy link

I get the following when attempting to compile the client c++ version on a fresh install of ubuntu.

I downloaded https://github.com/triton-inference-server/client/archive/refs/heads/main.zip, unzipped, cd'd into that folder, then:
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=pwd/install -DTRITON_ENABLE_CC_HTTP=ON -DTRITON_ENABLE_CC_GRPC=ON -DTRITON_ENABLE_GPU=ON -DTRITON_ENABLE_EXAMPLES=ON -DTRITON_ENABLE_TESTS=ON ..
make

This failed several times and I was able to determine what "apt install xxx" it needed and rerun "make". Finally it results in the following.

I assume this is some mixed up C++11 vs C++17 setting, but I have no clue how it might be fixed.

[ 42%] Building CXX object examples/CMakeFiles/image_client.dir/image_client.cc.o
[ 43%] Linking CXX executable image_client
/usr/bin/ld: /home/jtaves/client-main/build/third-party/grpc/lib/libgrpc.a(client_channel.cc.o): in function grpc_core::ClientChannel::LoadBalancedCall::Orphan()': client_channel.cc:(.text+0x5955): undefined reference to absl::lts_20220623::CancelledError(absl::lts_20220623::string_view)'
/usr/bin/ld: /home/jtaves/client-main/build/third-party/grpc/lib/libgrpc.a(client_channel.cc.o): in function grpc_core::ClientChannel::LoadBalancedCall::RecvTrailingMetadataReady(void*, absl::lts_20220623::Status)': client_channel.cc:(.text+0x5a80): undefined reference to absl::lts_20220623::Status::Status(absl::lts_20220623::StatusCode, absl::lts_20220623::string_view)'
/usr/bin/ld: client_channel.cc:(.text+0x5bf3): undefined reference to absl::lts_20220623::Status::Status(absl::lts_20220623::StatusCode, absl::lts_20220623::string_view)' /usr/bin/ld: /home/jtaves/client-main/build/third-party/grpc/lib/libgrpc.a(client_channel.cc.o): in function grpc_core::ClientChannel::LoadBalancedCall::Metadata::Add(absl::lts_20220623::string_view, absl::lts_20220623::string_view)::{lambda(absl::lts_20220623::string_view, grpc_core::Slice const&)#1}::operator()(absl::lts_20220623::string_view, grpc_core::Slice const&) const [clone .isra.0]':
client_channel.cc:(.text.ZZN9grpc_core13ClientChannel16LoadBalancedCall8Metadata3AddEN4absl12lts_2022062311string_viewES5_ENKUlS5_RKNS_5SliceEE_clES5_S8.isra.0[_ZN4absl12lts_2022062319functional_internal12InvokeObjectIZN9grpc_core13ClientChannel16LoadBalancedCall8Metadata3AddENS0_11string_viewES7_EUlS7_RKNS3_5SliceEE_vJS7_SA_EEET0_NS1_7VoidPtrEDpNS1_8ForwardTIT1_E4typeE]+0x80): undefined reference to `absl::lts_20220623::strings_internal::CatPiecesabi:cxx11'

@InfiniteLife
Copy link

Same issue. Trying to find all linkable libs from abseil to manually add them to my project..

/usr/bin/ld: /home/superman/projects/2.27.0_triton_client/lib/libabsl_synchronization.a(mutex.cc.o): in function `absl::lts_20220623::PostSynchEvent(void*, int)':
mutex.cc:(.text+0xb43): undefined reference to `absl::lts_20220623::GetStackTrace(void**, int, int)'
/usr/bin/ld: mutex.cc:(.text+0xc53): undefined reference to `absl::lts_20220623::GetStackTrace(void**, int, int)'
/usr/bin/ld: /home/superman/projects/2.27.0_triton_client/lib/libabsl_synchronization.a(mutex.cc.o): in function `absl::lts_20220623::Mutex::AwaitWithDeadline(absl::lts_20220623::Condition const&, absl::lts_20220623::Time)':
mutex.cc:(.text+0x224a): undefined reference to `absl::lts_20220623::ToUnixNanos(absl::lts_20220623::Time)'
/usr/bin/ld: /home/superman/projects/2.27.0_triton_client/lib/libabsl_synchronization.a(mutex.cc.o): in function `absl::lts_20220623::Mutex::AwaitWithTimeout(absl::lts_20220623::Condition const&, absl::lts_20220623::Duration)':
mutex.cc:(.text+0x231e): undefined reference to `absl::lts_20220623::TimeFromTimeval(timeval)'

@InfiniteLife
Copy link

Here the list that did it for me:

declare_dependency(link_args : ['-L' + triton_client_lib_dir, '-labsl_synchronization'],
                               include_directories : [triton_client_inc_dir]),

declare_dependency(link_args : ['-L' + triton_client_lib_dir, '-labsl_base'],
                               include_directories : [triton_client_inc_dir]),

declare_dependency(link_args : ['-L' + triton_client_lib_dir, '-labsl_raw_logging_internal'],
                               include_directories : [triton_client_inc_dir]),

declare_dependency(link_args : ['-L' + triton_client_lib_dir, '-labsl_spinlock_wait'],
                               include_directories : [triton_client_inc_dir]),

declare_dependency(link_args : ['-L' + triton_client_lib_dir, '-labsl_stacktrace'],
                               include_directories : [triton_client_inc_dir]),

declare_dependency(link_args : ['-L' + triton_client_lib_dir, '-labsl_debugging_internal'],
                               include_directories : [triton_client_inc_dir]),

declare_dependency(link_args : ['-L' + triton_client_lib_dir, '-labsl_symbolize'],
                               include_directories : [triton_client_inc_dir]),

declare_dependency(link_args : ['-L' + triton_client_lib_dir, '-labsl_malloc_internal'],
                               include_directories : [triton_client_inc_dir]),

declare_dependency(link_args : ['-L' + triton_client_lib_dir, '-labsl_demangle_internal'],
                               include_directories : [triton_client_inc_dir]),

declare_dependency(link_args : ['-L' + triton_client_lib_dir, '-labsl_time'],
                               include_directories : [triton_client_inc_dir]),

declare_dependency(link_args : ['-L' + triton_client_lib_dir, '-labsl_time_zone'],
                               include_directories : [triton_client_inc_dir]),

declare_dependency(link_args : ['-L' + triton_client_lib_dir, '-labsl_int128'],
                               include_directories : [triton_client_inc_dir])

@johntaves
Copy link
Author

johntaves commented Nov 15, 2022

Is the above a fix? Where does this go? What are "triton_client_lib_dir" and "triton_client_inc_dir"?

@GuanLuo
Copy link
Contributor

GuanLuo commented Nov 16, 2022

What OS are you building the client on? absl is one of grpc dependencies and it is configured to be built along with grpc to match the version used in grpc. I wonder if the system has already installed absl which results in linking the wrong library.

FYI, we build the client libraries in Docker (see Dockerfile.sdk for detail), you can use it as reference on gathering dependencies if you have to build outside Docker.

@johntaves
Copy link
Author

I built it on a fresh install of ubuntu. I encountered errors that I solved by installing additional packages. I might have installed absl, but only because some part of the compile was not happy about missing absl. I found a package with absl in it and removed it. My ubuntu desktop died.

Make returned the same error.

I have an example python script that sends a tiff image to the server and get the result. What do you recommend is the fastest/easiest way to make this happen from a c# windows program?

Should I attempt to compile and run an example from Windows using Docker?

@GuanLuo
Copy link
Contributor

GuanLuo commented Nov 17, 2022

Using Docker is the suggested way to build from source as it manages the dependencies in the way that isolates from the host system.

I am not familiar with the Windows build process, @jbkyang-nvi @nv-kmcgill53 . I think we do release the compiled Triton and client library for each release, have you tried to use them directly? https://github.com/triton-inference-server/server/releases/tag/v2.27.0

@nv-kmcgill53
Copy link
Contributor

nv-kmcgill53 commented Nov 17, 2022

https://github.com/triton-inference-server/server/releases/tag/v2.27.0

From here you can download the latest release of Triton for windows:

  • tritonserver<major.minor.patch>-win.zip includes the executable, tritonserver DLL (for C API use), tensorrt_backend, onnxruntime_backend, and openvino_backend
  • tritonserver<major.minor.patch>-sdk-win.zip includes many sample clients written in python, wheel to install, and header files to allow you to write your own client.

@johntaves I would like to understand better what platform you are attempting to build the client library on. Is it Windows or Linux? Do you have a preference? This will allow us to help you better.

@johntaves
Copy link
Author

johntaves commented Nov 17, 2022

We have an existing C#.net program that needs to send tiff images to a triton server for pattern recognition. We have a sample python script that reads a tiff and gets the results, so this is a simple matter of plopping that functionality into the real time c# executable.

My initial thought was to make a c# wrapper around a windows c++ that would hit the triton server. Another thought was to exec the python from c#.

However, after struggling with the triton client, I am concluding that it is not properly sorted out yet. It seems to me that the triton client is including the source for the whole triton project. I don't know if that is really necessary. If there is a trivial additional layer above the http/rest or gRPC calls, then why not make the client library just that code without all the other baggage?

I put a man in the middle of the http/rest call and it looks pretty simple. I am going to replicate that in c#.

If the gRPC method is faster, then later I will probably attempt to use gRPC.net and sort out how to do it without the triton client. If the triton client is just a trivial layer above gRPC, then where is that source? I might need to reference it to make a c# version.

@GuanLuo
Copy link
Contributor

GuanLuo commented Nov 17, 2022

the triton client is including the source for the whole triton project

the "sdk" package should only include the source code of the Triton clients (including perf analyzer which you can exclude from build).

You don't have to use the Triton client, it is an out-of-box client to interact with Triton server via HTTP/GRPC, you can implement your own client following the Triton server protocols, the extensions are optional for client and the predict protocol is what should be implemented to perform inference.

@dyastremsky
Copy link
Contributor

dyastremsky commented Dec 6, 2022

Closing issue due to inactivity. If you would like to reopen this ticket for follow-up, please let us know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

5 participants