Installation¶
This guide will help you install trtutils and its dependencies. The recommended method is to install trtutils into a virtual environment to ensure dependency isolation.
System Requirements¶
Python 3.8 or later
CUDA toolkit
TensorRT
NVIDIA GPU or Jetson device
Basic Installation¶
The simplest way to install trtutils is using pip:
$ pip install trtutils
For development or to get the latest features, install from source:
$ git clone https://github.com/justincdavis/trtutils.git
$ cd trtutils
$ pip install -e .
Optional Dependencies¶
trtutils provides several optional dependency groups that can be installed using pip’s extras feature:
JIT Compiler Support¶
Install support for the JIT compiler:
$ pip install "trtutils[jit]"
This installs: - Numba - LLVM-Lite
This enables the use of trtutils.enable_jit() to accelerate some CPU operations.
Development Tools¶
For development or contributing to trtutils:
$ pip install "trtutils[dev]"
This installs: - Testing frameworks - Linting tools - Documentation generators - Development utilities
Troubleshooting¶
Common Installation Issues¶
CUDA/TensorRT Not Found - Ensure CUDA and TensorRT are properly installed - Check environment variables (LD_LIBRARY_PATH, etc.) - Verify CUDA version compatibility
Dependency Conflicts - Use a virtual environment - Check package versions - Update pip:
pip install --upgrade pipJetson-Specific Issues - Install Jetson-specific TensorRT version - Use compatible CUDA version - Check Jetpack installation
libnvrtc.so.* Not Found - Ensure the version of cuda-python installed matches the version of CUDA installed - If using a custom CUDA path, ensure it is correctly set in the environment variables
Getting Started¶
After installation, verify your setup:
from trtutils import TRTEngine
# Create a test engine
engine = TRTEngine("test.engine")
print("Installation successful!")
For more detailed examples, see the Examples section.