chrisboo opened a new issue #15176: MXNet TensorRT: Please ensure build was compiled with MXNET_USE_TENSORRT enabled. URL: https://github.com/apache/incubator-mxnet/issues/15176 ## Description I tried following this tutorial [Optimizing Deep Learning Computation Graphs with TensorRT](https://mxnet.incubator.apache.org/versions/master/tutorials/tensorrt/inference_with_trt.html) but I see that there are no improvements. When I try to get the optimized symbol, I get an error saying my MXNet is not compiled with MXNET_USE_TENSORRT. ## Environment info (Required) ``` ----------Python Info---------- Version : 3.7.1 Compiler : GCC 7.3.0 Build : ('default', 'Dec 14 2018 19:28:38') Arch : ('64bit', '') ------------Pip Info----------- Version : 18.1 Directory : /home/kaihsien/anaconda3/lib/python3.7/site-packages/pip ----------MXNet Info----------- Version : 1.3.0 Directory : /home/kaihsien/anaconda3/lib/python3.7/site-packages/mxnet Hashtag not found. Not installed from pre-built package. ----------System Info---------- Platform : Linux-4.15.0-51-generic-x86_64-with-debian-stretch-sid system : Linux node : kaihsien release : 4.15.0-51-generic version : #55~16.04.1-Ubuntu SMP Thu May 16 09:24:37 UTC 2019 ----------Hardware Info---------- machine : x86_64 processor : x86_64 Architecture: x86_64 CPU op-mode(s): 32-bit, 64-bit Byte Order: Little Endian CPU(s): 8 On-line CPU(s) list: 0-7 Thread(s) per core: 2 Core(s) per socket: 4 Socket(s): 1 NUMA node(s): 1 Vendor ID: GenuineIntel CPU family: 6 Model: 60 Model name: Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz Stepping: 3 CPU MHz: 3296.657 CPU max MHz: 4000.0000 CPU min MHz: 800.0000 BogoMIPS: 7195.57 Virtualization: VT-x L1d cache: 32K L1i cache: 32K L2 cache: 256K L3 cache: 8192K NUMA node0 CPU(s): 0-7 Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm cpuid_fault epb invpcid_single pti ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid xsaveopt dtherm ida arat pln pts md_clear flush_l1d ----------Network Test---------- Setting timeout: 10 Timing for MXNet: https://github.com/apache/incubator-mxnet, DNS: 0.0015 sec, LOAD: 0.6010 sec. Timing for Gluon Tutorial(en): http://gluon.mxnet.io, DNS: 0.2301 sec, LOAD: 0.1615 sec. Timing for Gluon Tutorial(cn): https://zh.gluon.ai, DNS: 0.1514 sec, LOAD: 1.0101 sec. Timing for FashionMNIST: https://apache-mxnet.s3-accelerate.dualstack.amazonaws.com/gluon/dataset/fashion-mnist/train-labels-idx1-ubyte.gz, DNS: 0.0808 sec, LOAD: 0.3501 sec. Timing for PYPI: https://pypi.python.org/pypi/pip, DNS: 0.0067 sec, LOAD: 2.6970 sec. Timing for Conda: https://repo.continuum.io/pkgs/free/, DNS: 0.0072 sec, LOAD: 0.0646 sec. ``` I'm using Python. ## Build info (Required if built from source) ``` pip install mxnet-tensorrt-cu90 ``` ## Error Message: ``` Warming up MXNet [15:11:27] src/operator/nn/./cudnn/./cudnn_algoreg-inl.h:97: Running performance tests to find the best convolution algorithm, this can take a while... (setting env variable MXNET_CUDNN_AUTOTUNE_DEFAULT to 0 to disable) Starting MXNet timed run 0.9185287219999996 ERROR:root:Error while trying to fetch TRT optimized symbol for graph. Please ensure build was compiled with MXNET_USE_TENSORRT enabled. Traceback (most recent call last): File "test.py", line 36, in <module> optimized_sym = mx.contrib.tensorrt.get_optimized_symbol(executor) File "/home/kaihsien/anaconda3/lib/python3.7/site-packages/mxnet/contrib/tensorrt.py", line 67, in get_optimized_symbol check_call(_LIB.MXExecutorGetOptimizedSymbol(executor.handle, ctypes.byref(handle))) File "/home/kaihsien/anaconda3/lib/python3.7/site-packages/mxnet/base.py", line 252, in check_call raise MXNetError(py_str(_LIB.MXGetLastError())) mxnet.base.MXNetError: [15:11:29] src/c_api/c_api_executor.cc:641: GetOptimizedSymbol may only be used when MXNet is compiled with MXNET_USE_TENSORRT enabled. Please re-compile MXNet with TensorRT support. Stack trace returned 10 entries: [bt] (0) /home/kaihsien/dev/as-inference-engine/build/release/libmxnet.so(dmlc::StackTrace[abi:cxx11]()+0x5b) [0x7f01487edeab] [bt] (1) /home/kaihsien/dev/as-inference-engine/build/release/libmxnet.so(dmlc::LogMessageFatal::~LogMessageFatal()+0x28) [0x7f01487eea18] [bt] (2) /home/kaihsien/dev/as-inference-engine/build/release/libmxnet.so(MXExecutorGetOptimizedSymbol+0x7c) [0x7f014b8fb7ac] [bt] (3) /home/kaihsien/anaconda3/lib/python3.7/lib-dynload/../../libffi.so.6(ffi_call_unix64+0x4c) [0x7f016cb73ec0] [bt] (4) /home/kaihsien/anaconda3/lib/python3.7/lib-dynload/../../libffi.so.6(ffi_call+0x22d) [0x7f016cb7387d] [bt] (5) /home/kaihsien/anaconda3/lib/python3.7/lib-dynload/_ctypes.cpython-37m-x86_64-linux-gnu.so(_ctypes_callproc+0x2ce) [0x7f016e77aeee] [bt] (6) /home/kaihsien/anaconda3/lib/python3.7/lib-dynload/_ctypes.cpython-37m-x86_64-linux-gnu.so(+0x13924) [0x7f016e77b924] [bt] (7) python(_PyObject_FastCallKeywords+0x4ab) [0x55e4505c065b] [bt] (8) python(_PyEval_EvalFrameDefault+0x532e) [0x55e45061c40e] [bt] (9) python(_PyFunction_FastCallKeywords+0xfb) [0x55e4505bf0ab] ``` ## Minimum reproducible example My code follows the tutorial. The only line I add is to get the optimized symbol. ``` # Timing print('Starting MXNet timed run') start = time.process_time() for i in range(0, 100): y_gen = executor.forward(is_train=False, data=input) y_gen[0].wait_to_read() end = time.time() print(time.process_time() - start) optimized_sym = mx.contrib.tensorrt.get_optimized_symbol(executor) ``` ## What have you tried to solve it? 1. Install MXNet from source with setting `USE_TENSORRT`, but I think it should be working directly from the `pip install mxnet-tensorrt-cu90`?
---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
