MATLAB Answers

Issues with TensorRT execution

11 views (last 30 days)
Alvaro Izaguirre Serrano
Alvaro Izaguirre Serrano on 21 May 2020
Answered: Mikaël LE GRAND on 5 Nov 2020
Currently I create a Simulink model that calls a mexw64 file that was generated for deep learning with TensorRT, I have no issues to generate the mex file but when I try to execute I have the following message:
Invalid MEX-file 'D:\PhD\ITESO\Clases\10._Semestre_7\IDI_X\Simulation\resNet18SemanticSegmentationRT_mex.mexw64': No se puede
encontrar el módulo especificado.
But the file is present on the same folder. Also when I execute the verification of the setup as follows:
gpuEnvObj = coder.gpuEnvConfig;
gpuEnvObj.BasicCodegen = 1;
gpuEnvObj.BasicCodeexec = 1;
gpuEnvObj.DeepLibTarget = 'tensorrt';
gpuEnvObj.DeepCodeexec = 1;
gpuEnvObj.DeepCodegen = 1;
results = coder.checkGpuInstall(gpuEnvObj)
I have the following:
Compatible GPU : PASSED
CUDA Environment : PASSED
Runtime : PASSED
cuFFT : PASSED
cuSOLVER : PASSED
cuBLAS : PASSED
cuDNN Environment : PASSED
TensorRT Environment : PASSED
Basic Code Generation : PASSED
Basic Code Execution : PASSED
Deep Learning (TensorRT) Code Generation: PASSED
Deep Learning (TensorRT) Code Execution: FAILED (Generated GPU code failed to execute properly with the following error 'Invalid MEX-file 'C:\Users\alis\AppData\Local\Temp\tp22472ee1_cce8_43cd_b782_e5b03357a893\dlEntryPointTest_mex.mexw64': No se puede encontrar el módulo especificado.')
results =
struct with fields:
gpu: 1
cuda: 1
cudnn: 1
tensorrt: 1
basiccodegen: 1
basiccodeexec: 1
deepcodegen: 1
deepcodeexec: 0
tensorrtdatatype: 1
profiling: 0
This is on a Windows 10 machine.
Any idea of waht can be the issue?

  0 Comments

Sign in to comment.

Answers (3)

sunho jang
sunho jang on 12 Sep 2020
The same problem happens to me. Have you solved it yet?

  0 Comments

Sign in to comment.


Mikaël LE GRAND
Mikaël LE GRAND on 23 Oct 2020
Hello,
I also encounter the same problem :
gpuEnvObj = coder.gpuEnvConfig;
gpuEnvObj.BasicCodegen = 1;
gpuEnvObj.BasicCodeexec = 1;
gpuEnvObj.DeepLibTarget = 'tensorrt';
gpuEnvObj.DeepCodeexec = 1;
gpuEnvObj.DeepCodegen = 1;
results = coder.checkGpuInstall(gpuEnvObj)
Compatible GPU : PASSED
CUDA Environment : PASSED
Runtime : PASSED
cuFFT : PASSED
cuSOLVER : PASSED
cuBLAS : PASSED
cuDNN Environment : PASSED
TensorRT Environment : PASSED
Basic Code Generation : PASSED
Basic Code Execution : PASSED
Deep Learning (TensorRT) Code Generation: PASSED
Deep Learning (TensorRT) Code Execution: FAILED (Generated GPU code failed to execute properly with the following error 'Invalid MEX-file 'C:\Users\adm.mle_grand\AppData\Local\Temp\tp05f76285_6ff4_4487_8fca_16965e73b665\dlEntryPointTest_mex.mexw64': Le module spécifié est introuvable.')
results =
struct with fields:
gpu: 1
cuda: 1
cudnn: 1
tensorrt: 1
basiccodegen: 1
basiccodeexec: 1
deepcodegen: 1
deepcodeexec: 0
tensorrtdatatype: 1
profiling: 0
However the specified function (dlEntryPointTest_mex.mexw64) is present in the directory. Is it a problem of TensorRT release problem ?!? For my part, I use TensorRT-5.1.2.2 release :
I tried other releases of TensorRT but the result is always the same via gpucoderSetup command :
Can someone from the staff of Mathworks help us solve this annoying problem ?

  0 Comments

Sign in to comment.


Mikaël LE GRAND
Mikaël LE GRAND on 5 Nov 2020
Hello,
i finally resolve the problem by reading more accuratly the MATLAB documentation. So :
3/ I have installed TensorRT 5.1.2.2 (R2020a compatible) https://developer.nvidia.com/nvidia-tensorrt-5x-download (choose TensorRT 5.1 RC version)
4/ I have setted up the environment variables that MATLAB need :
CUDA_PATH : C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1
CUDA_PATH_V10_1 : C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1
NVIDIA_CUDNN : C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\cuda
NVIDIA_TENSORRT : C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\TensorRT-5.1.2.2
NVTOOLSEXT_PATH : C:\Program Files\NVIDIA Corporation\NvToolsExt\
To finish, I add those path to the PATH variable :
  • C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\bin
  • C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\libnvvp
  • C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\cuda\bin
  • C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\TensorRT-5.1.2.2\lib
In MATLAB, it gives :
>> gpuEnvObj = coder.gpuEnvConfig('host');
gpuEnvObj.BasicCodegen = 1;
gpuEnvObj.BasicCodeexec = 1;
gpuEnvObj.DeepLibTarget = 'tensorrt';
gpuEnvObj.DeepCodeexec = 1;
gpuEnvObj.DeepCodegen = 1;
gpuEnvObj.Profiling = 1;
coder.checkGpuInstall(gpuEnvObj)
Compatible GPU : PASSED
CUDA Environment : PASSED
Runtime : PASSED
cuFFT : PASSED
cuSOLVER : PASSED
cuBLAS : PASSED
cuDNN Environment : PASSED
TensorRT Environment : PASSED
Profiling Environment : PASSED
Basic Code Generation : PASSED
Basic Code Execution : PASSED
Deep Learning (TensorRT) Code Generation: PASSED
Deep Learning (TensorRT) Code Execution: PASSED
ans =
struct with fields:
gpu: 1
cuda: 1
cudnn: 1
tensorrt: 1
basiccodegen: 1
basiccodeexec: 1
deepcodegen: 1
deepcodeexec: 1
tensorrtdatatype: 1
profiling: 1
>>
I hope this could help...

  0 Comments

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!