# About build errors for sampleOnnxMNIST

**URL:** <https://forums.developer.nvidia.com/t/about-build-errors-for-sampleonnxmnist/166880>\
**Category:** TensorRT\
**Tags:** tensorrt, cuda\
**Created:** [January 26, 2021, 11:25pm UTC](https://forums.developer.nvidia.com/t/about-build-errors-for-sampleonnxmnist/166880 "2021-01-26T23:25:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![forumuser](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@forumuser](https://forums.developer.nvidia.com/u/forumuser)\
**Post date:** [January 26, 2021, 11:25pm UTC](https://forums.developer.nvidia.com/t/about-build-errors-for-sampleonnxmnist/166880/1 "2021-01-26T23:25:41Z")

</div>

## Description

yhlee@yhlee-H110-D3:/usr/src/tensorrt/samples/sampleOnnxMNIST$ sudo make -j8  
[sudo] password for yhlee:  
../Makefile.config:10: CUDA\_INSTALL\_DIR variable is not specified, using /usr/local/cuda by default, use CUDA\_INSTALL\_DIR=\<cuda\_directory\> to change.  
../Makefile.config:15: CUDNN\_INSTALL\_DIR variable is not specified, using /usr/local/cuda by default, use CUDNN\_INSTALL\_DIR=\<cudnn\_directory\> to change.  
../Makefile.config:28: TRT\_LIB\_DIR is not specified, searching ../../lib, ../../lib, ../lib by default, use TRT\_LIB\_DIR=\<trt\_lib\_directory\> to change.  
Linking: ../../bin/sample\_onnx\_mnist\_debug  
/usr/bin/ld: warning: libnvrtc.so.11.0, needed by /usr/lib/gcc/x86\_64-linux-gnu/7/../../../x86\_64-linux-gnu/libnvinfer.so, not found (try using -rpath or -rpath-link)  
/usr/lib/gcc/x86\_64-linux-gnu/7/../../../x86\_64-linux-gnu/libnvinfer.so: undefined reference to `nvrtcGetPTX@libnvrtc.so.11.0' /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/libnvinfer.so: undefined reference to `nvrtcDestroyProgram@libnvrtc.so.11.0’  
/usr/lib/gcc/x86\_64-linux-gnu/7/../../../x86\_64-linux-gnu/libmyelin.so: undefined reference to `nvrtcGetLoweredName@libnvrtc.so.11.0' /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/libnvinfer.so: undefined reference to `nvrtcCompileProgram@libnvrtc.so.11.0’  
/usr/lib/gcc/x86\_64-linux-gnu/7/../../../x86\_64-linux-gnu/libnvinfer.so: undefined reference to `nvrtcGetPTXSize@libnvrtc.so.11.0' /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/libnvinfer.so: undefined reference to `nvrtcCreateProgram@libnvrtc.so.11.0’  
/usr/lib/gcc/x86\_64-linux-gnu/7/../../../x86\_64-linux-gnu/libmyelin.so: undefined reference to `nvrtcAddNameExpression@libnvrtc.so.11.0' /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/libnvinfer.so: undefined reference to `nvrtcVersion@libnvrtc.so.11.0’  
/usr/lib/gcc/x86\_64-linux-gnu/7/../../../x86\_64-linux-gnu/libnvinfer.so: undefined reference to `nvrtcGetProgramLog@libnvrtc.so.11.0' /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/libnvinfer.so: undefined reference to `nvrtcGetProgramLogSize@libnvrtc.so.11.0’  
/usr/lib/gcc/x86\_64-linux-gnu/7/../../../x86\_64-linux-gnu/libnvinfer.so: undefined reference to `nvrtcGetErrorString@libnvrtc.so.11.0’  
collect2: error: ld returned 1 exit status  
../Makefile.config:300: recipe for target ‘../../bin/sample\_onnx\_mnist\_debug’ failed  
make: \*\*\* [../../bin/sample\_onnx\_mnist\_debug] Error 1

A clear and concise description of the bug or issue.

## Environment

**TensorRT Version** : nv-tensorrt-repo-ubuntu1804-cuda11.0-trt7.1.3.4-ga-20200617\_1-1\_amd64  
**GPU Type** : gtx3080  
**Nvidia Driver Version** : Driver Version: 455.23.04  
**CUDA Version** : 11.1  
**CUDNN Version** : 10.2  
**Operating System + Version** : ubuntu18.04  
**Python Version (if applicable)**:  
**TensorFlow Version (if applicable)**:  
**PyTorch Version (if applicable)**:  
**Baremetal or Container (if container which image + tag)**:

## Relevant Files

Please attach or include links to any models, data, files, or scripts necessary to reproduce your issue. (Github repo, Google Drive, Dropbox, etc.)

## Steps To Reproduce

yhlee@yhlee-H110-D3:/usr/src/tensorrt/samples/sampleOnnxMNIST$ sudo make -j8

Please include:

- Exact steps/commands to build your repro
- Exact steps/commands to run your repro
- Full traceback of errors encountered

---

<div class="post-metadata">

**Author:** ![NVES](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/nves/32/14043_2.png) [@NVES](https://forums.developer.nvidia.com/u/NVES)\
**Post date:** [January 26, 2021, 11:37pm UTC](https://forums.developer.nvidia.com/t/about-build-errors-for-sampleonnxmnist/166880/2 "2021-01-26T23:37:51Z")

</div>

Hi, Request you to share the ONNX model and the script so that we can assist you better.

Alongside you can try validating your model with the below snippet

check\_model.py

> import sys  
> import onnx  
> filename = yourONNXmodel  
> model = onnx.load(filename)  
> onnx.checker.check\_model(model).

Alternatively, you can try running your model with trtexec command.  
[https://github.com/NVIDIA/TensorRT/tree/master/samples/opensource/trtexec](https://github.com/NVIDIA/TensorRT/tree/master/samples/opensource/trtexec)

Thanks!

---

<div class="post-metadata">

**Author:** ![forumuser](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@forumuser](https://forums.developer.nvidia.com/u/forumuser)\
**Post date:** [January 26, 2021, 11:40pm UTC](https://forums.developer.nvidia.com/t/about-build-errors-for-sampleonnxmnist/166880/3 "2021-01-26T23:40:21Z")

</div>

Hello,

This is the mnist.onnx file included in the sample that is automatically installed when tensorRT is installed.

Thank you.

---

<div class="post-metadata">

**Author:** ![spolisetty](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/spolisetty/32/14047_2.png) [@spolisetty](https://forums.developer.nvidia.com/u/spolisetty)\
**Post date:** [February 4, 2021, 9:26am UTC](https://forums.developer.nvidia.com/t/about-build-errors-for-sampleonnxmnist/166880/4 "2021-02-04T09:26:35Z")

</div>

Hi @forumuser,

Sorry for late reply.  
I tried reproducing this issue. But for me its working fine.  
Please make sure you’ve installed tensorrt correctly. For your reference, installation guide.

> **[Installation Guide :: NVIDIA Deep Learning TensorRT Documentation](https://docs.nvidia.com/deeplearning/tensorrt/install-guide/index.html#installing)**
>
> This NVIDIA TensorRT 8.4.1 Installation Guide provides the installation requirements, a list of what is included in the TensorRT package, and step-by-step instructions for installing TensorRT.

or you can also use tensorrt NGC container to avoid system dependency.

> **[TensorRT | NVIDIA NGC](https://catalog.ngc.nvidia.com/orgs/nvidia/containers/tensorrt)**
>
> NVIDIA TensorRT is a C++ library that facilitates high-performance inference on NVIDIA graphics processing units (GPUs). TensorRT takes a trained network and produces a highly optimized runtime engine that performs inference for that network.

Thank you.
