| # ❓ Q&A for Building TensorRT Engines | |
| ## 1. Error: `trtexec: not found` | |
| **Solution:** Try the following command | |
| ```shell | |
| source trt/activate.sh | |
| ``` | |
| This command is used to configure the environment variables required to build the TensorRT Engine. | |
| ## 2. Error: `Unable to open library: libnvinfer_plugin.so.9 due to libcublas.so.11: cannot open shared object file` | |
| **Solution:** This error occurs because the `libnvinfer_plugin.so.9` library depends on the `libcublas.so.11` library. | |
| However, you may use a different version of cuda library (see `/usr/local/cuda`), such as cuda-12. It is recommended | |
| to use cuda-11 to build the TensorRT Engine. | |
| ## 3. The size of the engine file generated by each build is different | |
| **Explanation:** During the process of building the engine, the building program will automatically select the | |
| optimal kernel and other parameters. Therefore, the size of the engine file generated by each build may be different. | |
| Therefore, please ensure that the GPU is idle during the build to ensure that the building program correctly selects | |
| the optimal kernel. | |