Unable to open shared library libnvds_kafka_proto.so

When I compile libnvds_kafka_proto.so from the source, the resulting shared library cannot be opened.

The error message is:

/opt/nvidia/deepstream/deepstream/lib/libnvds_kafka_proto.so: undefined symbol: _ZTVN10__cxxabiv120__si_class_type_infoE
unable to open shared library

Hardware Platform: GPU, x86_64
DeepStream Version: 5.1-21.02
NVIDIA GPU Driver Version: 460.39

Reproduction steps:

# Run Deepstream container on x86_64.
$ docker run --gpus all -it --rm --network host -e CUDA_VER=11.1 nvcr.io/nvidia/deepstream:5.1-21.02-devel

# test_kafka_proto_sync works correctly before I attempt to rebuild libnvds_kafka_proto.so
$ cd /opt/nvidia/deepstream/deepstream/sources/libs/kafka_protocol_adaptor
$ make -f Makefile.test
$ ./test_kafka_proto_sync
Refer to nvds log file for log output
Adapter protocol=KAFKA , version=2.0
connection signature queried=
send [0] completed
...
Disconnecting in 3 secs

# Rebuild libnvds_kafka_proto.so.
$ cd /opt/nvidia/deepstream/deepstream/sources/libs/kafka_protocol_adaptor
$ make
# Note the large difference in file size between the original and new file.
$ ls -l /opt/nvidia/deepstream/deepstream/lib/libnvds_kafka_proto.so libnvds_kafka_proto.so
-rwxr-xr-x 1 root root 345184 Feb 16 09:54 /opt/nvidia/deepstream/deepstream/lib/libnvds_kafka_proto.so
-rwxr-xr-x 1 root root 122152 Feb 27 04:15 libnvds_kafka_proto.so
$ cp libnvds_kafka_proto.so /opt/nvidia/deepstream/deepstream/lib/libnvds_kafka_proto.so
$ ldconfig

# Now test_kafka_proto_sync fails.
$ ./test_kafka_proto_sync
Refer to nvds log file for log output
/opt/nvidia/deepstream/deepstream/lib/libnvds_kafka_proto.so: undefined symbol: _ZTVN10__cxxabiv120__si_class_type_infoE
unable to open shared library

# I have also tried to install the dependencies as described in the README.
# The problem remained the same.
cd
git clone https://github.com/edenhill/librdkafka.git
cd librdkafka
git reset --hard 7101c2310341ab3f4675fc565f64f0967e135a6a
./configure --enable-ssl
make
make install
cp /usr/local/lib/librdkafka* /opt/nvidia/deepstream/deepstream/lib/
ldconfig
apt-get install libglib2.0 libglib2.0-dev
apt-get install libjansson4 libjansson-dev

run with
./test_kafka_proto_sync /kafka protocl adapter library path/

Thank you for your response. Unfortunately I get the same error.

./test_kafka_proto_sync /opt/nvidia/deepstream/deepstream/lib/libnvds_kafka_proto.so
Refer to nvds log file for log output
/opt/nvidia/deepstream/deepstream/lib/libnvds_kafka_proto.so: undefined symbol: 
_ZTVN10__cxxabiv120__si_class_type_infoE
unable to open shared library

In any case, I was able to successfully build a custom implementation of the message broker interface using Rust, so I do not need this to work for my use case. It may be something that you wish to investigate for others.

There is no update from you for a period, assuming this is not an issue any more.
Hence we are closing this topic. If need further support, please open a new one.
Thanks

What rust is? the customization is still using kafka protocl or your own?

I encountered the same issue. The Makefile contains some errors, see the difference here:

##################
# < Makefile_old #
# > Makefile_new #
##################
< LIBS+= -L../../lib -lrdkafka -ljansson -lnvds_logger -lpthread -lcrypto
< LDFLAGS+= -shared
---
> LIBS+= -L../../../lib -lrdkafka -ljansson -lnvds_logger -lpthread -lcrypto
> LDFLAGS+= -shared -lstdc++
39c39
<       $(CC) -o $@ $^ $(CFLAGS) $(LDFLAGS)
---
>       $(CC) -o $@ $^ $(CFLAGS) $(LDFLAGS) $(LIBS)

The modified Makefile is attached to this comment.
Makefile (1.3 KB)

4 Likes