error while running sampleMNIST sample

I have just installed TensorRT- and I can’t seem to be able to run the sampleMNIST example.
Here the detailed info:

  • uname -a:
Linux ip-<my ip> 5.4.0-1066-aws #69~18.04.1-Ubuntu SMP Wed Feb 9 15:36:54 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

Here what I have added to ~/.bashrc

# set env for TensorRT
export TENSORRT_DIR=$/home/ubuntu/TensorRT-

Here what I have added to ~/.profile

# set PATH for cuda 10.2 installation
if [ -d "/usr/local/cuda-10.2/bin/" ]; then
    export PATH=/usr/local/cuda-10.2/bin${PATH:+:${PATH}}
    export LD_LIBRARY_PATH=/usr/local/cuda-10.2/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}

Here what my TensorRT- looks like

I have already built the sample, so now when I execute make from the directory I get the following

as a result, a sample_mnist file has been created inside /home/ubuntu/TensorRT-
Inside the /home/ubuntu/TensorRT- I have created a mnist folder with the requested images

How do I execute the sample now?
This is what I tried from within the /home/ubuntu/TensorRT- directory
./sample_mnist --datadir=../samples/sampleMNIST/mnist --fp16
which raises

./sample_mnist: error while loading shared libraries: cannot open shared object file: No such file or directory

Is this the right way to run the test sample?
If yes, am I just missing something super silly with PATHs?

Please refer to the below link for Sample guide.

Refer to the installation steps from the link if in case you are missing on anything

However suggested approach is to use TRT NGC containers to avoid any system dependency related issues.

In order to run python sample, make sure TRT python packages are installed while using NGC container.

In case, if you are trying to run custom model, please share your model and script with us, so that we can assist you better.

Thanks for the prompt reply.
Much appreciated.

I am tracing my steps and trying to figure things out.
Keep you posted

Alright, apparently I had to append /home/ubuntu/TensorRT- to LD_LIBRARY_PATH .
Now it looks like this


I think the first part is actually not needed, e.g. I am repeating /home/ubuntu/TensorRT- twice.

Anyway, thanks for the input!

1 Like