Stack smashing detected

Please provide the following info (check/uncheck the boxes after creating this topic):
Software Version
DRIVE OS Linux 5.2.6
DRIVE OS Linux 5.2.6 and DriveWorks 4.0
DRIVE OS Linux 5.2.0
DRIVE OS Linux 5.2.0 and DriveWorks 3.5
[*] NVIDIA DRIVE™ Software 10.0 (Linux)
NVIDIA DRIVE™ Software 9.0 (Linux)
other DRIVE OS version
other

Target Operating System
[*] Linux
QNX
other

Hardware Platform
[*] NVIDIA DRIVE™ AGX Xavier DevKit (E3550)
NVIDIA DRIVE™ AGX Pegasus DevKit (E3550)
other

SDK Manager Version
[*] 1.9.1.10844
other

Host Machine Version
[*] native Ubuntu 18.04
other

I am trying to run model in drive agx xavier by referring this page GitHub - jkjung-avt/tensorrt_demos: TensorRT MODNet, YOLOv4, YOLOv3, SSD, MTCNN, and GoogLeNet. I successfully deployed model in host machine but failed in drive agx xavier.
Below is the output error

nvidia@tegra-ubuntu:~/tensorrt_demos$ python3 trt_googlenet.py --image /yolo/dog.jpg
[ WARN:0@0.103] global loadsave.cpp:244 findDecoder imread_(‘/yolo/dog.jpg’): can’t open/read file: check file path/integrity
*** stack smashing detected ***: terminated
^CAborted (core dumped)

This is the code of trt_googlenet.py which was modified to take image file as input

> """trt_googlenet.py
> 
> This script demonstrates how to do real-time image classification
> (inferencing) with Cython wrapped TensorRT optimized googlenet engine.
> """
> 
> 
> import timeit
> import argparse
> 
> import numpy as np
> import cv2
> from utils.camera import add_camera_args, Camera
> from utils.display import open_window, show_help_text, set_display
> from pytrt import PyTrtGooglenet
> 
> 
> PIXEL_MEANS = np.array([[[104., 117., 123.]]], dtype=np.float32)
> DEPLOY_ENGINE = 'googlenet/deploy.engine'
> ENGINE_SHAPE0 = (3, 224, 224)
> ENGINE_SHAPE1 = (1000, 1, 1)
> RESIZED_SHAPE = (112, 112)
> 
> WINDOW_NAME = 'TrtGooglenetDemo'
> 
> 
> 
> 
> def parse_args():
>     """Parse input arguments."""
>     desc = ('Capture and display live camera video, while doing '
>             'real-time image classification with TrtGooglenet '
>             'on Jetson Nano')
>     parser = argparse.ArgumentParser(description=desc)
>     parser = add_camera_args(parser)
>     parser.add_argument('--crop', dest='crop_center',
>                         help='crop center square of image for '
>                              'inferencing [False]',
>                         action='store_true')
>     args = parser.parse_args()
>     return args
> 
> 
> def show_top_preds(img, top_probs, top_labels):
>     """Show top predicted classes and softmax scores."""
>     x = 10
>     y = 40
>     for prob, label in zip(top_probs, top_labels):
>         pred = '{:.4f} {:20s}'.format(prob, label)
>         #cv2.putText(img, pred, (x+1, y), cv2.FONT_HERSHEY_PLAIN, 1.0,
>         #            (32, 32, 32), 4, cv2.LINE_AA)
>         cv2.putText(img, pred, (x, y), cv2.FONT_HERSHEY_PLAIN, 1.0,
>                     (0, 0, 240), 1, cv2.LINE_AA)
>         y += 20
> 
> 
> def classify(img, net, labels, do_cropping):
>     """Classify 1 image (crop)."""
>     crop = img
>     if do_cropping:
>         h, w, _ = img.shape
>         if h < w:
>             crop = img[:, ((w-h)//2):((w+h)//2), :]
>         else:
>             crop = img[((h-w)//2):((h+w)//2), :, :]
> 
>     # preprocess the image crop
>     
>     crop = cv2.resize(crop, RESIZED_SHAPE)
>     print("COming here ..........................................",crop.shape,RESIZED_SHAPE)
>     crop = crop.astype(np.float32) - PIXEL_MEANS
>     crop = crop.transpose((2, 0, 1))  # HWC -> CHW
>     # inference the (cropped) image
>     tic = timeit.default_timer()
>     out = net.forward(crop[None])  # add 1 dimension to 'crop' as batch
>     toc = timeit.default_timer()
>     print('{:.3f}s'.format(toc-tic))
> 
>     # output top 3 predicted scores and class labels
>     out_prob = np.squeeze(out['prob'][0])
>     top_inds = out_prob.argsort()[::-1][:3]
>     return (out_prob[top_inds], labels[top_inds])
> 
> 
> def loop_and_classify(img, net, labels, do_cropping):
>     """Continuously capture images from camera and do classification."""
>     
>     show_help = True
>     full_scrn = False
>     help_text = '"Esc" to Quit, "H" for Help, "F" to Toggle Fullscreen'
>     while True:
>         # if cv2.getWindowProperty(WINDOW_NAME, 0) < 0:
>         #     break
>         img = cv2.imread('/home/jramesh/tensorrt_demos/yolo/dog.jpg')
>         #h, w, _ = img.shape
>         #img= np.zeros((h,w, 3), dtype=np.uint8)
>         if img is None:
>             print("Not an image")
>             break
>         top_probs, top_labels = classify(img, net, labels, do_cropping)
>         show_top_preds(img, top_probs, top_labels)
>         if show_help:
>             show_help_text(img, help_text)
>             
>         print("called")    
>         cv2.imshow(WINDOW_NAME, img)
>         
>         key = cv2.waitKey(1)
>         if key == 27:  # ESC key: quit program
>             break
>         elif key == ord('H') or key == ord('h'):  # Toggle help message
>             show_help = not show_help
>         elif key == ord('F') or key == ord('f'):  # Toggle fullscreen
>             full_scrn = not full_scrn
>             set_display(WINDOW_NAME, full_scrn)
> 
> 
> def main():
>     args = parse_args()
>     labels = np.loadtxt('googlenet/synset_words.txt', str, delimiter='\t')
>     cam = Camera(args)
>     print("--------------------------------")
>    # if not cam.isOpened():
>      #  raise SystemExit('ERROR: failed to open camera!')
> 
>     # initialize the tensorrt googlenet engine
>     net = PyTrtGooglenet(DEPLOY_ENGINE, ENGINE_SHAPE0, ENGINE_SHAPE1)
>     #print("--------------------------------")
>     #print(net)
>     #open_window(
>        # WINDOW_NAME, 'Camera TensorRT GoogLeNet Demo',
>       #  cam.img_width, cam.img_height)
>     print("--------------------------------")
>     loop_and_classify(cv2.imread('/home/jramesh/tensorrt_demos/yolo/dog.jpg'), net, labels, args.crop_center)
>    
>     
> 
> 
>     cam.release()
>     cv2.destroyAllWindows()
> 
> 
> if __name__ == '__main__':
>     main()

I was trying to run Demo #1: GoogLeNet example in GitHub - jkjung-avt/tensorrt_demos: TensorRT MODNet, YOLOv4, YOLOv3, SSD, MTCNN, and GoogLeNet

Dear @sankal.pattanashetti,
TRT python bindings are not available on DRIVE platform. Could you please check using C++ samples. We have Googlenet TensorRT c++ sample already under TensorRT samples.

TensorRT c++ sample w.r.t Googlenet is not present in Github.

Dear @sankal.pattanashetti,
I see the sample is part of TRT 5.x (TensorRT Samples Support Guide :: Deep Learning SDK Documentation)
Could you check /usr/src/tensorrt/samples folder on host after installing the DRIVE SW on host?

Thanks @SivaRamaKrishnaNV I can see tensorrt samples in host system. What about drive agx? do we need to cross-compile samples .

Dear @sankal.pattanashetti,
Please check if you see TensorRT sample on target(at /usr/src/tensorrt/samples). If not, you may check copy the samples to target or check cross compilation.

There are no samples on target (at /usr/src/tensorrt/samples ).
First I’ll try to cross compile them.

During cross compilation I am not able to install few packages which are mentioned in tensorrt sample documention

jramesh@jramesh-Precision-7920-Tower:~$ sudo apt install libnvinfer-dev-cross-aarch64
Reading package lists... Done
Building dependency tree       
Reading state information... Done
libnvinfer-dev-cross-aarch64 is already the newest version (5.1.4-1+cuda10.2).
The following packages were automatically installed and are no longer required:
  cuda-12-1 cuda-cccl-12-1 cuda-command-line-tools-12-1 cuda-compiler-12-1 cuda-cudart-12-1 cuda-cudart-dev-12-1 cuda-cuobjdump-12-1 cuda-cupti-12-1 cuda-cupti-dev-12-1 cuda-cuxxfilt-12-1
  cuda-demo-suite-10-2 cuda-demo-suite-12-1 cuda-documentation-12-1 cuda-driver-dev-12-1 cuda-drivers cuda-drivers-530 cuda-gdb-12-1 cuda-libraries-10-2 cuda-libraries-12-1 cuda-libraries-dev-12-1
  cuda-nsight-12-1 cuda-nsight-compute-12-1 cuda-nsight-systems-12-1 cuda-nvcc-12-1 cuda-nvdisasm-12-1 cuda-nvml-dev-12-1 cuda-nvprof-12-1 cuda-nvprune-12-1 cuda-nvrtc-12-1 cuda-nvrtc-dev-12-1
  cuda-nvtx-12-1 cuda-nvvp-12-1 cuda-opencl-12-1 cuda-opencl-dev-12-1 cuda-profiler-api-12-1 cuda-runtime-10-2 cuda-runtime-12-1 cuda-sanitizer-12-1 cuda-toolkit-12-1 cuda-toolkit-12-1-config-common
  cuda-toolkit-12-config-common cuda-toolkit-config-common cuda-tools-12-1 cuda-visual-tools-12-1 g++-6 gds-tools-12-1 libaccinj64-9.1 libcublas-12-1 libcublas-dev-12-1 libcublas9.1 libcudart9.1
  libcufft-12-1 libcufft-dev-12-1 libcufft9.1 libcufftw9.1 libcufile-12-1 libcufile-dev-12-1 libcuinj64-9.1 libcurand-12-1 libcurand-dev-12-1 libcurand9.1 libcusolver-12-1 libcusolver-dev-12-1
  libcusolver9.1 libcusparse-12-1 libcusparse-dev-12-1 libcusparse9.1 libnpp-12-1 libnpp-dev-12-1 libnppc9.1 libnppial9.1 libnppicc9.1 libnppicom9.1 libnppidei9.1 libnppif9.1 libnppig9.1 libnppim9.1
  libnppist9.1 libnppisu9.1 libnppitc9.1 libnpps9.1 libnvblas9.1 libnvgraph9.1 libnvjitlink-12-1 libnvjitlink-dev-12-1 libnvjpeg-12-1 libnvjpeg-dev-12-1 libnvrtc9.1 libnvtoolsext1 libnvvm-samples-12-1
  libnvvm3 libthrust-dev libvdpau-dev nvidia-cuda-dev nvidia-modprobe nvidia-opencl-dev nvidia-profiler nvidia-visual-profiler ocl-icd-opencl-dev opencl-c-headers
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 216 not upgraded.
jramesh@jramesh-Precision-7920-Tower:~$ sudo apt install libnvinfer5-cross-aarch64
Reading package lists... Done
Building dependency tree       
Reading state information... Done
libnvinfer5-cross-aarch64 is already the newest version (5.1.4-1+cuda10.2).
The following packages were automatically installed and are no longer required:
  cuda-12-1 cuda-cccl-12-1 cuda-command-line-tools-12-1 cuda-compiler-12-1 cuda-cudart-12-1 cuda-cudart-dev-12-1 cuda-cuobjdump-12-1 cuda-cupti-12-1 cuda-cupti-dev-12-1 cuda-cuxxfilt-12-1
  cuda-demo-suite-10-2 cuda-demo-suite-12-1 cuda-documentation-12-1 cuda-driver-dev-12-1 cuda-drivers cuda-drivers-530 cuda-gdb-12-1 cuda-libraries-10-2 cuda-libraries-12-1 cuda-libraries-dev-12-1
  cuda-nsight-12-1 cuda-nsight-compute-12-1 cuda-nsight-systems-12-1 cuda-nvcc-12-1 cuda-nvdisasm-12-1 cuda-nvml-dev-12-1 cuda-nvprof-12-1 cuda-nvprune-12-1 cuda-nvrtc-12-1 cuda-nvrtc-dev-12-1
  cuda-nvtx-12-1 cuda-nvvp-12-1 cuda-opencl-12-1 cuda-opencl-dev-12-1 cuda-profiler-api-12-1 cuda-runtime-10-2 cuda-runtime-12-1 cuda-sanitizer-12-1 cuda-toolkit-12-1 cuda-toolkit-12-1-config-common
  cuda-toolkit-12-config-common cuda-toolkit-config-common cuda-tools-12-1 cuda-visual-tools-12-1 g++-6 gds-tools-12-1 libaccinj64-9.1 libcublas-12-1 libcublas-dev-12-1 libcublas9.1 libcudart9.1
  libcufft-12-1 libcufft-dev-12-1 libcufft9.1 libcufftw9.1 libcufile-12-1 libcufile-dev-12-1 libcuinj64-9.1 libcurand-12-1 libcurand-dev-12-1 libcurand9.1 libcusolver-12-1 libcusolver-dev-12-1
  libcusolver9.1 libcusparse-12-1 libcusparse-dev-12-1 libcusparse9.1 libnpp-12-1 libnpp-dev-12-1 libnppc9.1 libnppial9.1 libnppicc9.1 libnppicom9.1 libnppidei9.1 libnppif9.1 libnppig9.1 libnppim9.1
  libnppist9.1 libnppisu9.1 libnppitc9.1 libnpps9.1 libnvblas9.1 libnvgraph9.1 libnvjitlink-12-1 libnvjitlink-dev-12-1 libnvjpeg-12-1 libnvjpeg-dev-12-1 libnvrtc9.1 libnvtoolsext1 libnvvm-samples-12-1
  libnvvm3 libthrust-dev libvdpau-dev nvidia-cuda-dev nvidia-modprobe nvidia-opencl-dev nvidia-profiler nvidia-visual-profiler ocl-icd-opencl-dev opencl-c-headers
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 216 not upgraded.
jramesh@jramesh-Precision-7920-Tower:~$ sudo apt install libnvinfer-plugin-dev-cross-aarch64
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package libnvinfer-plugin-dev-cross-aarch64
jramesh@jramesh-Precision-7920-Tower:~$ sudo apt install libnvinfer-plugin5-cross-aarch64
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package libnvinfer-plugin5-cross-aarch64
jramesh@jramesh-Precision-7920-Tower:~$ sudo apt install libnvparsers-dev-cross-aarch64
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package libnvparsers-dev-cross-aarch64
jramesh@jramesh-Precision-7920-Tower:~$ sudo apt install libnvparsers8-cross-aarch64
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package libnvparsers8-cross-aarch64

Few are already installed and few are not installing.
This one is reference file as mentioned by you-https://docs.nvidia.com/deeplearning/tensorrt/archives/tensorrt-840-ea/pdf/TensorRT-Sample-Support-Guide.pdf

Dear @sankal.pattanashetti,
Meanwhile, could you try compiling on target directly?

Yes @SivaRamaKrishnaNV I tried to deploy directly on target system but I am getting error as

nvidia@tegra-ubuntu:~/tensorrt/samples/sampleOnnxMNIST$ sudo make TARGET=aarch64
Linking: ../../bin/sample_onnx_mnist_debug
/usr/bin/ld: ../../bin/dchobj/../common/logger.o: Relocations in generic ELF (EM: 62)
/usr/bin/ld: ../../bin/dchobj/../common/logger.o: Relocations in generic ELF (EM: 62)
/usr/bin/ld: ../../bin/dchobj/../common/logger.o: Relocations in generic ELF (EM: 62)
/usr/bin/ld: ../../bin/dchobj/../common/logger.o: Relocations in generic ELF (EM: 62)
/usr/bin/ld: ../../bin/dchobj/../common/logger.o: Relocations in generic ELF (EM: 62)
/usr/bin/ld: ../../bin/dchobj/../common/logger.o: Relocations in generic ELF (EM: 62)
/usr/bin/ld: ../../bin/dchobj/../common/logger.o: Relocations in generic ELF (EM: 62)
/usr/bin/ld: ../../bin/dchobj/../common/logger.o: Relocations in generic ELF (EM: 62)
/usr/bin/ld: ../../bin/dchobj/../common/logger.o: Relocations in generic ELF (EM: 62)
/usr/bin/ld: ../../bin/dchobj/../common/logger.o: Relocations in generic ELF (EM: 62)
/usr/bin/ld: ../../bin/dchobj/../common/logger.o: Relocations in generic ELF (EM: 62)
/usr/bin/ld: ../../bin/dchobj/../common/logger.o: Relocations in generic ELF (EM: 62)
/usr/bin/ld: ../../bin/dchobj/../common/logger.o: Relocations in generic ELF (EM: 62)
/usr/bin/ld: ../../bin/dchobj/../common/logger.o: Relocations in generic ELF (EM: 62)
/usr/bin/ld: ../../bin/dchobj/../common/logger.o: Relocations in generic ELF (EM: 62)
/usr/bin/ld: ../../bin/dchobj/../common/logger.o: Relocations in generic ELF (EM: 62)
/usr/bin/ld: ../../bin/dchobj/../common/logger.o: Relocations in generic ELF (EM: 62)
/usr/bin/ld: ../../bin/dchobj/../common/logger.o: Relocations in generic ELF (EM: 62)
/usr/bin/ld: ../../bin/dchobj/../common/logger.o: Relocations in generic ELF (EM: 62)
/usr/bin/ld: ../../bin/dchobj/../common/logger.o: Relocations in generic ELF (EM: 62)
/usr/bin/ld: ../../bin/dchobj/../common/logger.o: Relocations in generic ELF (EM: 62)
/usr/bin/ld: ../../bin/dchobj/../common/logger.o: Relocations in generic ELF (EM: 62)
/usr/bin/ld: ../../bin/dchobj/../common/logger.o: Relocations in generic ELF (EM: 62)
/usr/bin/ld: ../../bin/dchobj/../common/logger.o: Relocations in generic ELF (EM: 62)
/usr/bin/ld: ../../bin/dchobj/../common/logger.o: Relocations in generic ELF (EM: 62)
/usr/bin/ld: ../../bin/dchobj/../common/logger.o: Relocations in generic ELF (EM: 62)
/usr/bin/ld: ../../bin/dchobj/../common/logger.o: Relocations in generic ELF (EM: 62)
/usr/bin/ld: ../../bin/dchobj/../common/logger.o: Relocations in generic ELF (EM: 62)
/usr/bin/ld: ../../bin/dchobj/../common/logger.o: Relocations in generic ELF (EM: 62)
/usr/bin/ld: ../../bin/dchobj/../common/logger.o: Relocations in generic ELF (EM: 62)
/usr/bin/ld: ../../bin/dchobj/../common/logger.o: Relocations in generic ELF (EM: 62)
/usr/bin/ld: ../../bin/dchobj/../common/logger.o: Relocations in generic ELF (EM: 62)
/usr/bin/ld: ../../bin/dchobj/../common/logger.o: Relocations in generic ELF (EM: 62)
/usr/bin/ld: ../../bin/dchobj/../common/logger.o: Relocations in generic ELF (EM: 62)
/usr/bin/ld: ../../bin/dchobj/../common/logger.o: Relocations in generic ELF (EM: 62)
/usr/bin/ld: ../../bin/dchobj/../common/logger.o: Relocations in generic ELF (EM: 62)
/usr/bin/ld: ../../bin/dchobj/../common/logger.o: Relocations in generic ELF (EM: 62)
/usr/bin/ld: ../../bin/dchobj/../common/logger.o: Relocations in generic ELF (EM: 62)
/usr/bin/ld: ../../bin/dchobj/../common/logger.o: Relocations in generic ELF (EM: 62)
/usr/bin/ld: ../../bin/dchobj/../common/logger.o: Relocations in generic ELF (EM: 62)
/usr/bin/ld: ../../bin/dchobj/../common/logger.o: Relocations in generic ELF (EM: 62)
/usr/bin/ld: ../../bin/dchobj/../common/logger.o: Relocations in generic ELF (EM: 62)
/usr/bin/ld: ../../bin/dchobj/../common/logger.o: Relocations in generic ELF (EM: 62)
../../bin/dchobj/../common/logger.o: error adding symbols: File in wrong format
collect2: error: ld returned 1 exit status
../Makefile.config:163: recipe for target '../../bin/sample_onnx_mnist_debug' failed
make: *** [../../bin/sample_onnx_mnist_debug] Error 1

Dear @sankal.pattanashetti,
Could you check with sudo make as well o target?

I am getting same error with sudo make also

nvidia@tegra-ubuntu:~/tensorrt/samples/sampleOnnxMNIST$ sudo make
if [ ! -d ../../bin/chobj/../common ]; then mkdir -p ../../bin/dchobj/../common; fi; :
Compiling: sampleOnnxMNIST.cpp
In file included from sampleOnnxMNIST.cpp:65:0:
../common/common.h: In function ‘void samplesCommon::setDummyInt8Scales(const nvinfer1::IBuilder*, nvinfer1::INetworkDefinition*)’:
../common/common.h:467:24: warning: ‘virtual bool nvinfer1::IBuilder::getInt8Mode() const’ is deprecated [-Wdeprecated-declarations]
     if (b->getInt8Mode())
                        ^
In file included from sampleOnnxMNIST.cpp:61:0:
/usr/include/aarch64-linux-gnu/NvInfer.h:5973:33: note: declared here
     TRT_DEPRECATED virtual bool getInt8Mode() const TRTNOEXCEPT = 0;
                                 ^~~~~~~~~~~
In file included from sampleOnnxMNIST.cpp:65:0:
../common/common.h: In function ‘void samplesCommon::enableDLA(nvinfer1::IBuilder*, int, bool)’:
../common/common.h:483:45: warning: ‘virtual void nvinfer1::IBuilder::allowGPUFallback(bool)’ is deprecated [-Wdeprecated-declarations]
         b->allowGPUFallback(allowGPUFallback);
                                             ^
In file included from sampleOnnxMNIST.cpp:61:0:
/usr/include/aarch64-linux-gnu/NvInfer.h:6065:33: note: declared here
     TRT_DEPRECATED virtual void allowGPUFallback(bool setFallBackMode) TRTNOEXCEPT = 0;
                                 ^~~~~~~~~~~~~~~~
In file included from sampleOnnxMNIST.cpp:65:0:
../common/common.h:484:29: warning: ‘virtual bool nvinfer1::IBuilder::getInt8Mode() const’ is deprecated [-Wdeprecated-declarations]
         if (!b->getInt8Mode())
                             ^
In file included from sampleOnnxMNIST.cpp:61:0:
/usr/include/aarch64-linux-gnu/NvInfer.h:5973:33: note: declared here
     TRT_DEPRECATED virtual bool getInt8Mode() const TRTNOEXCEPT = 0;
                                 ^~~~~~~~~~~
In file included from sampleOnnxMNIST.cpp:65:0:
../common/common.h:488:32: warning: ‘virtual void nvinfer1::IBuilder::setFp16Mode(bool)’ is deprecated [-Wdeprecated-declarations]
             b->setFp16Mode(true);
                                ^
In file included from sampleOnnxMNIST.cpp:61:0:
/usr/include/aarch64-linux-gnu/NvInfer.h:6129:33: note: declared here
     TRT_DEPRECATED virtual void setFp16Mode(bool mode) TRTNOEXCEPT = 0;
                                 ^~~~~~~~~~~
In file included from sampleOnnxMNIST.cpp:65:0:
../common/common.h:490:49: warning: ‘virtual void nvinfer1::IBuilder::setDefaultDeviceType(nvinfer1::DeviceType)’ is deprecated [-Wdeprecated-declarations]
         b->setDefaultDeviceType(DeviceType::kDLA);
                                                 ^
In file included from sampleOnnxMNIST.cpp:61:0:
/usr/include/aarch64-linux-gnu/NvInfer.h:6038:33: note: declared here
     TRT_DEPRECATED virtual void setDefaultDeviceType(DeviceType deviceType) TRTNOEXCEPT = 0;
                                 ^~~~~~~~~~~~~~~~~~~~
In file included from sampleOnnxMNIST.cpp:65:0:
../common/common.h:491:33: warning: ‘virtual void nvinfer1::IBuilder::setDLACore(int32_t)’ is deprecated [-Wdeprecated-declarations]
         b->setDLACore(useDLACore);
                                 ^
In file included from sampleOnnxMNIST.cpp:61:0:
/usr/include/aarch64-linux-gnu/NvInfer.h:6082:33: note: declared here
     TRT_DEPRECATED virtual void setDLACore(int32_t dlaCore) TRTNOEXCEPT = 0;
                                 ^~~~~~~~~~
In file included from sampleOnnxMNIST.cpp:65:0:
../common/common.h:492:41: warning: ‘virtual void nvinfer1::IBuilder::setStrictTypeConstraints(bool)’ is deprecated [-Wdeprecated-declarations]
         b->setStrictTypeConstraints(true);
                                         ^
In file included from sampleOnnxMNIST.cpp:61:0:
/usr/include/aarch64-linux-gnu/NvInfer.h:6158:33: note: declared here
     TRT_DEPRECATED virtual void setStrictTypeConstraints(bool mode) TRTNOEXCEPT = 0;
                                 ^~~~~~~~~~~~~~~~~~~~~~~~
sampleOnnxMNIST.cpp: In function ‘bool onnxToTRTModel(const string&, unsigned int, nvinfer1::IHostMemory*&)’:
sampleOnnxMNIST.cpp:89:68: warning: ‘virtual nvinfer1::INetworkDefinition* nvinfer1::IBuilder::createNetwork()’ is deprecated [-Wdeprecated-declarations]
     nvinfer1::INetworkDefinition* network = builder->createNetwork();
                                                                    ^
In file included from sampleOnnxMNIST.cpp:61:0:
/usr/include/aarch64-linux-gnu/NvInfer.h:5800:58: note: declared here
     TRT_DEPRECATED virtual nvinfer1::INetworkDefinition* createNetwork() TRTNOEXCEPT = 0;
                                                          ^~~~~~~~~~~~~
sampleOnnxMNIST.cpp:105:41: warning: ‘virtual void nvinfer1::IBuilder::setMaxWorkspaceSize(std::size_t)’ is deprecated [-Wdeprecated-declarations]
     builder->setMaxWorkspaceSize(1 << 20);
                                         ^
In file included from sampleOnnxMNIST.cpp:61:0:
/usr/include/aarch64-linux-gnu/NvInfer.h:5831:33: note: declared here
     TRT_DEPRECATED virtual void setMaxWorkspaceSize(std::size_t workspaceSize) TRTNOEXCEPT = 0;
                                 ^~~~~~~~~~~~~~~~~~~
sampleOnnxMNIST.cpp:106:41: warning: ‘virtual void nvinfer1::IBuilder::setFp16Mode(bool)’ is deprecated [-Wdeprecated-declarations]
     builder->setFp16Mode(gArgs.runInFp16);
                                         ^
In file included from sampleOnnxMNIST.cpp:61:0:
/usr/include/aarch64-linux-gnu/NvInfer.h:6129:33: note: declared here
     TRT_DEPRECATED virtual void setFp16Mode(bool mode) TRTNOEXCEPT = 0;
                                 ^~~~~~~~~~~
sampleOnnxMNIST.cpp:107:41: warning: ‘virtual void nvinfer1::IBuilder::setInt8Mode(bool)’ is deprecated [-Wdeprecated-declarations]
     builder->setInt8Mode(gArgs.runInInt8);
                                         ^
In file included from sampleOnnxMNIST.cpp:61:0:
/usr/include/aarch64-linux-gnu/NvInfer.h:5964:33: note: declared here
     TRT_DEPRECATED virtual void setInt8Mode(bool mode) TRTNOEXCEPT = 0;
                                 ^~~~~~~~~~~
sampleOnnxMNIST.cpp:116:60: warning: ‘virtual nvinfer1::ICudaEngine* nvinfer1::IBuilder::buildCudaEngine(nvinfer1::INetworkDefinition&)’ is deprecated [-Wdeprecated-declarations]
     ICudaEngine* engine = builder->buildCudaEngine(*network);
                                                            ^
In file included from sampleOnnxMNIST.cpp:61:0:
/usr/include/aarch64-linux-gnu/NvInfer.h:5935:51: note: declared here
     TRT_DEPRECATED virtual nvinfer1::ICudaEngine* buildCudaEngine(
                                                   ^~~~~~~~~~~~~~~
Linking: ../../bin/sample_onnx_mnist_debug
/usr/bin/ld: ../../bin/dchobj/../common/logger.o: Relocations in generic ELF (EM: 62)
/usr/bin/ld: ../../bin/dchobj/../common/logger.o: Relocations in generic ELF (EM: 62)
/usr/bin/ld: ../../bin/dchobj/../common/logger.o: Relocations in generic ELF (EM: 62)
/usr/bin/ld: ../../bin/dchobj/../common/logger.o: Relocations in generic ELF (EM: 62)
/usr/bin/ld: ../../bin/dchobj/../common/logger.o: Relocations in generic ELF (EM: 62)
/usr/bin/ld: ../../bin/dchobj/../common/logger.o: Relocations in generic ELF (EM: 62)
/usr/bin/ld: ../../bin/dchobj/../common/logger.o: Relocations in generic ELF (EM: 62)
/usr/bin/ld: ../../bin/dchobj/../common/logger.o: Relocations in generic ELF (EM: 62)
/usr/bin/ld: ../../bin/dchobj/../common/logger.o: Relocations in generic ELF (EM: 62)
/usr/bin/ld: ../../bin/dchobj/../common/logger.o: Relocations in generic ELF (EM: 62)
/usr/bin/ld: ../../bin/dchobj/../common/logger.o: Relocations in generic ELF (EM: 62)
/usr/bin/ld: ../../bin/dchobj/../common/logger.o: Relocations in generic ELF (EM: 62)
/usr/bin/ld: ../../bin/dchobj/../common/logger.o: Relocations in generic ELF (EM: 62)
/usr/bin/ld: ../../bin/dchobj/../common/logger.o: Relocations in generic ELF (EM: 62)
/usr/bin/ld: ../../bin/dchobj/../common/logger.o: Relocations in generic ELF (EM: 62)
/usr/bin/ld: ../../bin/dchobj/../common/logger.o: Relocations in generic ELF (EM: 62)
/usr/bin/ld: ../../bin/dchobj/../common/logger.o: Relocations in generic ELF (EM: 62)
/usr/bin/ld: ../../bin/dchobj/../common/logger.o: Relocations in generic ELF (EM: 62)
/usr/bin/ld: ../../bin/dchobj/../common/logger.o: Relocations in generic ELF (EM: 62)
/usr/bin/ld: ../../bin/dchobj/../common/logger.o: Relocations in generic ELF (EM: 62)
/usr/bin/ld: ../../bin/dchobj/../common/logger.o: Relocations in generic ELF (EM: 62)
/usr/bin/ld: ../../bin/dchobj/../common/logger.o: Relocations in generic ELF (EM: 62)
/usr/bin/ld: ../../bin/dchobj/../common/logger.o: Relocations in generic ELF (EM: 62)
/usr/bin/ld: ../../bin/dchobj/../common/logger.o: Relocations in generic ELF (EM: 62)
/usr/bin/ld: ../../bin/dchobj/../common/logger.o: Relocations in generic ELF (EM: 62)
/usr/bin/ld: ../../bin/dchobj/../common/logger.o: Relocations in generic ELF (EM: 62)
/usr/bin/ld: ../../bin/dchobj/../common/logger.o: Relocations in generic ELF (EM: 62)
/usr/bin/ld: ../../bin/dchobj/../common/logger.o: Relocations in generic ELF (EM: 62)
/usr/bin/ld: ../../bin/dchobj/../common/logger.o: Relocations in generic ELF (EM: 62)
/usr/bin/ld: ../../bin/dchobj/../common/logger.o: Relocations in generic ELF (EM: 62)
/usr/bin/ld: ../../bin/dchobj/../common/logger.o: Relocations in generic ELF (EM: 62)
/usr/bin/ld: ../../bin/dchobj/../common/logger.o: Relocations in generic ELF (EM: 62)
/usr/bin/ld: ../../bin/dchobj/../common/logger.o: Relocations in generic ELF (EM: 62)
/usr/bin/ld: ../../bin/dchobj/../common/logger.o: Relocations in generic ELF (EM: 62)
/usr/bin/ld: ../../bin/dchobj/../common/logger.o: Relocations in generic ELF (EM: 62)
/usr/bin/ld: ../../bin/dchobj/../common/logger.o: Relocations in generic ELF (EM: 62)
/usr/bin/ld: ../../bin/dchobj/../common/logger.o: Relocations in generic ELF (EM: 62)
/usr/bin/ld: ../../bin/dchobj/../common/logger.o: Relocations in generic ELF (EM: 62)
/usr/bin/ld: ../../bin/dchobj/../common/logger.o: Relocations in generic ELF (EM: 62)
/usr/bin/ld: ../../bin/dchobj/../common/logger.o: Relocations in generic ELF (EM: 62)
/usr/bin/ld: ../../bin/dchobj/../common/logger.o: Relocations in generic ELF (EM: 62)
/usr/bin/ld: ../../bin/dchobj/../common/logger.o: Relocations in generic ELF (EM: 62)
/usr/bin/ld: ../../bin/dchobj/../common/logger.o: Relocations in generic ELF (EM: 62)
../../bin/dchobj/../common/logger.o: error adding symbols: File in wrong format
collect2: error: ld returned 1 exit status
../Makefile.config:163: recipe for target '../../bin/sample_onnx_mnist_debug' failed
make: *** [../../bin/sample_onnx_mnist_debug] Error 1

Dear @sankal.pattanashetti,
Just want to confirm if your host has any other CUDA/TensorRT version installed. If so, please uninstall them.

When you copy the TRT samples onto target, did you copy the .o files compiled on host as well?

I uninstalled other tensorrt versions now I am able to run.

1 Like

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