Hello, can anyone show me how to pip install the nvidia TensorRT library package so as to install in the PATH or LD_LIBRARY_PATH’. I’m not savvy in programming but I have a working gradio, local REMBG (remove image backgorund) python install. It’s works but, it generates the following EP error:
*EP Error D:\a_work\1\s\onnxruntime\python\onnxruntime_pybind_state.cc:507 onnxruntime::python::RegisterTensorRTPluginsAsCustomOps Please install TensorRT libraries as mentioned in the GPU requirements page, make sure they’re in the PATH or LD_LIBRARY_PATH, and that your GPU is supported.
when using [‘TensorrtExecutionProvider’, ‘CUDAExecutionProvider’, ‘CPUExecutionProvider’]
Falling back to [‘CUDAExecutionProvider’, ‘CPUExecutionProvider’] and retrying.
I can get the TensorRT package here, I believe (Installation Guide :: NVIDIA Deep Learning TensorRT Documentation), but I wouldn’t know how to use my powershell7 to pip install the TensorRT to the the PATH or LD_LIBRARY_PATH. Any help with this would be truly appreciated. Thank you all very much
To pip install the NVIDIA TensorRT library and set it in PATH using PowerShell, you can follow these steps:
-
Pip Install TensorRT Library:
- Open a PowerShell window.
- Navigate to the directory where you downloaded the TensorRT Python wheel files.
- Run the following command to install the TensorRT library (replace
cp3x
with your desired Python version, e.g.,cp310
for Python 3.10):python.exe -m pip install tensorrt-*-cp3x-none-win_amd64.whl
-
Set TensorRT Library in PATH:
- To set the TensorRT library in the PATH using PowerShell, you can use the following command:
Replace$env:Path += ";C:\path\to\TensorRT\lib"
C:\path\to\TensorRT\lib
with the actual path where the TensorRT library files are located.
- To set the TensorRT library in the PATH using PowerShell, you can use the following command:
-
Verify Installation:
- Check if the installation was successful by entering the Python interpreter in PowerShell and trying to import the
tensorrt
module:python >>> import tensorrt
- Check if the installation was successful by entering the Python interpreter in PowerShell and trying to import the
-
Additional Notes:
- Ensure that your Python version is compatible with the TensorRT library.
- Refer to the official NVIDIA TensorRT documentation for further installation instructions and troubleshooting.
These steps should help you get TensorRT installed and set up correctly.