# onnx-tensorrt build failure

**URL:** <https://forums.developer.nvidia.com/t/onnx-tensorrt-build-failure/69046>\
**Category:** TensorRT\
**Created:** [January 3, 2019, 5:05pm UTC](https://forums.developer.nvidia.com/t/onnx-tensorrt-build-failure/69046 "2019-01-03T17:05:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![lukee2ni6](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@lukee2ni6](https://forums.developer.nvidia.com/u/lukee2ni6)\
**Post date:** [January 3, 2019, 5:05pm UTC](https://forums.developer.nvidia.com/t/onnx-tensorrt-build-failure/69046/1 "2019-01-03T17:05:01Z")

</div>

Hi,

I have installed the latest tensorrt via dpkg/apt on Ubuntu 16.04 with CUDA 10 already built and tested. All of the samples in tensorrt run successfully. I am now trying to build onnx-tensorrt so that I can use yolov3.

When I attempt to install I do the following:

mkdir build  
cd build  
cmake … -DTENSORRT\_ROOT=/usr/src/tensorrt  
make -j8

How can I build this?

This is the traceback (it is very long so I just include the beginning and the end):

```auto
me@mylaptop:~/onnx-tensorrt/build$ make -j8 | tee > builderror
In file included from /usr/local/cuda-10.0/include/channel_descriptor.h:61:0,
                 from /usr/local/cuda-10.0/include/cuda_runtime.h:95,
                 from /usr/include/cudnn.h:64,
                 from /home/luke/onnx-tensorrt/InstanceNormalization.hpp:27,
                 from /home/luke/onnx-tensorrt/InstanceNormalization.cpp:23:
/usr/local/cuda-10.0/include/cuda_runtime_api.h:1775:101: error: use of enum ‘cudaDeviceP2PAttr’ without previous declaration
 extern __host__  __cudart_builtin__ cudaError_t CUDARTAPI cudaDeviceGetP2PAttribute(int *value, enum cudaDeviceP2PAttr attr, int srcDevice, int dstDevice);
                                                                                                     ^
/usr/local/cuda-10.0/include/cuda_runtime_api.h:2232:25: error: expected ‘)’ before ‘*’ token
 typedef void (CUDART_CB *cudaStreamCallback_t)(cudaStream_t stream, cudaError_t status, void *userData);
                         ^
/usr/local/cuda-10.0/include/cuda_runtime_api.h:2300:9: error: ‘cudaStreamCallback_t’ has not been declared
         cudaStreamCallback_t callback, void *userData, unsigned int flags);
         ^
/usr/local/cuda-10.0/include/cuda_runtime_api.h:2484:81: error: ‘cudaGraph_t’ has not been declared
 extern __host__ cudaError_t CUDARTAPI cudaStreamEndCapture(cudaStream_t stream, cudaGraph_t *pGraph);
                                                                                 ^
/usr/local/cuda-10.0/include/cuda_runtime_api.h:2523:87: error: use of enum ‘cudaStreamCaptureStatus’ without previous declaration
 extern __host__ cudaError_t CUDARTAPI cudaStreamIsCapturing(cudaStream_t stream, enum cudaStreamCaptureStatus *pCaptureStatus);
 
.
.
.
.
.
.

/usr/local/cuda-10.0/include/cuda_runtime_api.h:9135:101: error: expression list treated as compound expression in initializer [-fpermissive]
 extern __host__ cudaError_t CUDARTAPI cudaGraphLaunch(cudaGraphExec_t graphExec, cudaStream_t stream);
                                                                                                     ^
/usr/local/cuda-10.0/include/cuda_runtime_api.h:9156:60: error: ‘cudaGraphExec_t’ was not declared in this scope
 extern __host__ cudaError_t CUDARTAPI cudaGraphExecDestroy(cudaGraphExec_t graphExec);
                                                            ^
/usr/local/cuda-10.0/include/cuda_runtime_api.h:9176:56: error: ‘cudaGraph_t’ was not declared in this scope
 extern __host__ cudaError_t CUDARTAPI cudaGraphDestroy(cudaGraph_t graph);
                                                        ^
make[2]: *** [CMakeFiles/nvonnxparser_plugin.dir/InstanceNormalization.cpp.o] Error 1
make[1]: *** [CMakeFiles/nvonnxparser_plugin.dir/all] Error 2
make: *** [all] Error 2

```

---

<div class="post-metadata">

**Author:** ![nimasratna](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@nimasratna](https://forums.developer.nvidia.com/u/nimasratna)\
**Post date:** [January 4, 2019, 9:47pm UTC](https://forums.developer.nvidia.com/t/onnx-tensorrt-build-failure/69046/2 "2019-01-04T21:47:05Z")

</div>

I have the same error when installing PyTorch from source.

---

<div class="post-metadata">

**Author:** ![lukee2ni6](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@lukee2ni6](https://forums.developer.nvidia.com/u/lukee2ni6)\
**Post date:** [January 8, 2019, 1:12pm UTC](https://forums.developer.nvidia.com/t/onnx-tensorrt-build-failure/69046/3 "2019-01-08T13:12:38Z")

</div>

nobody any ideas…? I can build other CUDA dependent things without issue - is it possible that onnx-tensorrt does not yet support Cuda10?

---

<div class="post-metadata">

**Author:** ![u3004330](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@u3004330](https://forums.developer.nvidia.com/u/u3004330)\
**Post date:** [January 9, 2019, 9:27am UTC](https://forums.developer.nvidia.com/t/onnx-tensorrt-build-failure/69046/4 "2019-01-09T09:27:09Z")

</div>

I open the file:  
/usr/include/cudnn.h

And I changed the line:  
#include “driver\_types.h”

to:  
#include \<driver\_types.h\>

and now it can compile…

Worked for me on Ubuntu18.04 CUDA10 cuDNN7.4

[Reference]

> **[cuDNN Test did not pass](https://forums.developer.nvidia.com/default/topic/1025801/cudnn/cudnn-test-did-not-pass/)**
>
> Hi All, I followed the installation guide to install cuDNN but I end up with ubuntu@ubuntu:~/cudnn\_samples\_v7/mnistCUDNN$ make clean && make rm -rf \*o rm -rf mnistCUDNN /usr/local/cuda/bin/nvcc -ccbin g++ -I/usr/local/cuda/include...
