Skip to content

Conversation

@theHamsta
Copy link

@theHamsta theHamsta commented Feb 9, 2026

This is a draft of allowing dynamic loading of the TensorRT libs. Actual diff here cefe2c1

It is on top of the refactoring of #2 . I would wait whether #2 will be adopted or not and rebase accordingly. I would also wait with this PR on how this projects decides to select TensorRT versions (either via TensorRT present in dev enviornment or by checking in TensorRT headers)

The premise of this change is that both linking of the TensorRT lib and the ONNX parser link and dynamic loading should be Cargo features to which a user of the crate can opt-in or opt-out (no strong opinion what the default features of the crates should be).

Making dynload the default would enable vendoring the TRT headers and not require the TensorRT libs to be present in the dev environment. One could even vendor the headers of different TensorRT version and select the concrete version via Cargo feature or by analyzing the TensorRT library to be dynamically loaded.

Also the ONNX parser should be a Cargo feature. This way users that don't use ONNX don't need to generate unnecessary code.

@theHamsta theHamsta force-pushed the dynloading branch 5 times, most recently from 050258b to 7696256 Compare February 9, 2026 14:09
@theHamsta
Copy link
Author

This would obviously also require building all feature permutations in CI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants