Bash: trtexec: command not found


I tried to build trtexec in .../TensorRT/samples. I followed this git link for building the sample but it didn’t work. It looks like it’s not a valid command with the message :
bash: trtexec: command not found


TensorRT Version: 7.1.0:
GPU Type: Xavier:
Nvidia Driver Version: N/A:
CUDA Version: 10.2:
CUDNN Version: n/a:
Operating System + Version: Ubuntu 18.04:
Python Version (if applicable):
TensorFlow Version (if applicable):
PyTorch Version (if applicable):
Baremetal or Container (if container which image + tag):

I am new to the platform. Thanks for your help!

Please refer below link in case it helps:


I think the building steps are similar and and intuitive with make commad. But I am not sure why I got the error after make the trtexec and I cannot use the trtexec command.

Which Jetpack version you are currently using?
Can you try to reinstall the latest Jetpack?

It should be located in /usr/src/tensorrt/bin or /opt/tensorrt/bin


I have the exact same problem that the command is not recognized. I am also using a xavier and i also tried it on tx2. The build using make in /usr/src/tensorrt/samples/trtexec/ looks to be succesful and I can see the files in /usr/src/tensorrt/bin but when I try to use trtexec command i get : -bash: trtexec: command not found

I have read somewhere that maybe I should add it to the path but I do not know how that works. Any idea how I can solve this ?
Thank you in advance

1 Like

After the make command I ended up with creating an alias:

alias trtexec="/usr/src/tensorrt/bin/trtexec"

Request you to share the ONNX model and the script if not shared already so that we can assist you better.
Alongside you can try few things:

  1. validating your model with the below snippet

import sys
import onnx
filename = yourONNXmodel
model = onnx.load(filename)
2) Try running your model with trtexec command.

In case you are still facing issue, request you to share the trtexec “”–verbose"" log for further debugging

I actually solved by problem by simply copying the trtexec from “/usr/src/tensorrt/bin/trtexec/” to “/usr/local/bin/” I think there might have been a problem with linking the file.