Environment Variables#
This page is intentionally scoped to the capture-and-replay shim
(TRT_SHIM_*) documented in Capture and Replay.
It is not a complete index of every environment variable that appears in
TensorRT workflows. Variables such as LD_LIBRARY_PATH, PATH,
CUDA_VISIBLE_DEVICES, and framework-specific settings are documented where
those workflows live (install method pages, samples, and tooling guides).
Use these entry points for other behavior-changing variables:
PATHandLD_LIBRARY_PATH: Installing TensorRTCUDA_VISIBLE_DEVICESand device selection: Multi-Device InferenceCUDA_MPS_ACTIVE_THREAD_PERCENTAGE: Limiting Compute Resources
The table below lists only TRT_SHIM_* variables.
Capture-and-replay shim (TRT_SHIM_*)#
Set these variables before launching an application through the TensorRT capture shim (LD_PRELOAD or drop-in replacement). For setup instructions, refer to Capture and Replay.
Warning
The capture shim is a development and debugging tool. Do not preload it in a production process.
Captured .json and .bin output can contain proprietary model weights
in cleartext. Write capture output only to a restricted, non-shared
directory, and remove it when debugging is complete.
TRT_SHIM_NVINFER_LIB_NAME controls which native TensorRT library is
loaded into the process. Set it only to a trusted, absolute path that is not
writable by untrusted users.
Note
TRT_SHIM_OUTPUT_JSON_FILE takes precedence over
TRT_SHIM_FORCE_SINGLE_THREAD_API. If both are set, the shim does not
enforce single-threaded API calls.
Variable |
Description |
Type |
Default |
|---|---|---|---|
|
Path to save the captured |
|
|
|
Intercepted TensorRT library name. If unset, |
|
|
|
Print |
|
|
|
Print |
|
|
|
Lock every API call to enforce single-threaded execution. Ignored when |
|
|
|
Inline weights into the |
|
|
|
Skip saving weights with an element count ≥ this threshold (they will be marked as random). |
|
|
|
Flush captured calls to the file after every API call instead of aggregating them. |
|
|
|
Flush captured calls after every |
|
|
|
Path to a tactic-cache file loaded into |
|
|
See also
- Capture and Replay
How to install and run the capture shim.
- Troubleshooting
Common errors and debugging guidance.