Python, import mxnet & import tensorrt conflict?

When I import mxnet and tensorrt in same python file, there would exist a segmentation falult 11, the error outputs are as the below:

Segmentation fault: 11

Stack trace returned 10 entries:
[bt] (0) /search/odin/songminghui/anaconda3/lib/python3.6/site-packages/mxnet/libmxnet.so(+0x23d55a) [0x7feb2300855a]
[bt] (1) /search/odin/songminghui/anaconda3/lib/python3.6/site-packages/mxnet/libmxnet.so(+0x32ab1b6) [0x7feb260761b6]
[bt] (2) /lib64/libc.so.6(+0x35250) [0x7feba8561250]
[bt] (3) /search/odin/songminghui/anaconda3/lib/python3.6/site-packages/tensorrt/tensorrt.so(+0x6e701) [0x7feb30065701]
[bt] (4) /search/odin/songminghui/anaconda3/lib/python3.6/site-packages/tensorrt/tensorrt.so(PyInit_tensorrt+0x17a) [0x7feb300d830a]
[bt] (5) python(_PyImport_LoadDynamicModuleWithSpec+0x185) [0x7feba8f43335]
[bt] (6) python(+0x217540) [0x7feba8f43540]
[bt] (7) python(PyCFunction_Call+0x131) [0x7feba8e40711]
[bt] (8) python(_PyEval_EvalFrameDefault+0x542d) [0x7feba8eee4ad]
[bt] (9) python(+0x1918e4) [0x7feba8ebd8e4]

My platform:

Centos: 6.5
Python: Anaconda, python 3.6.8
MXNet: 1.4.0
TensorRT: 5.1.2.2
GPU: P40
CUDA: 10.0.130
Driver: 410.48

Thanks in advance.

Could you provide the full example, please?

Also, have you seen this tutorial - http://mxnet.incubator.apache.org/versions/master/tutorials/tensorrt/inference_with_trt.html ? I don’t see they explicitly import TensorRT package into their code…

Sure, the example from this link is applied to mxnet-cu90 or mxnet-cu92 which integrate the tensorrt within mxnet. However my CUDA version is 10.0.130 and mxnet-cu100 was installed.

The code is very simple to repeat this error information:

import mxnet ax mx
import tensorrt as trt

Above two lines can lead to this error.

Actually, I have found this statement from TensorRT Developer Guide:

On Ubuntu 14.04 and CentOS, loading the Torch module and TensorRT at the same time may cause segmentation faults.

This statement may apply to MXNet and TensorRT as well, by the way, my os is CentOS.

hi, I found the same problem. Have you solved the problem?

Sorry, I did not use TRT later, so problems may still exist. @someoneAlready