Problems with sampleMNIST on Jetson Nano

I am having problems running the TensorRT example sampleMNIST on the Jetson Nano.

First, I am unble to build samples as described in, “Building the TensorRT Components”, this requires CMake version 3.13 or later, but the version provided with the SD image is only 3.10.2 which is the latest available via ‘apt install’.

I was able to create my own Makefile in order to build sampleMNIST, but this generates a segmentation fault when trying create the builder config on line 156 of sampleMNIST.cpp

auto config = SampleUniquePtr<nvinfer1::IBuilderConfig>(builder->createBuilderConfig());

Similarly, if I follow the instructions from, I also get a seg fault when calling createBuilderConfig().

Just FYI, may not be the same as your case.

I also hit segfault at this exact API call. It turned out I was using a newer API than the system installed on, like using TensorRT 5.1 API on a system with TensorRT 5.0 installed, cannot remember the exact versions though. Mysteriously the compiler was happy but apparently it won’t work at runtime.

Check the /usr/src dir, see if there’s a tensorrt folder inside. Using the sample code under that folder if present instead of the one in github.


Please try the samples that are part of TRT package.

Refer to below link for step by step instruction to run the sample: