-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Any way to get the tensorrt version & platform by the single engine file ? #3073
Comments
IIRC we encode the TRT version into the engine file in the fiirst few bytes, does read it work for you? cc @nvpohanh |
We currently does not have an API to do so. Would that be useful? If it would, we can consider adding an API for that |
@zerollzeng @nvpohanh Thanks for your reply. 😄 Does the "TRT version encoded in the first few bytes" means "Serialized Engine Version" ? Is there a map between them and the TensorRT version ? 🤔 After testing, I found a map but not sure if it's robust. And it seems like just a minor level verison.
In my case, my original goal was to read the engine file in binary and judge the version without the trt library. But he doesn't seem to be able to implement patch level version checks (using "Serialized Engine Version"). 😿 |
In the next version we've added an option to trtexec to get creation version without deserializing the engine. It works for engines created with TRT 8.6 and forward. simplified related code:
|
@oxana-nvidia Thank you for providing a solution. I'm looking forward to its implementation ~ I will close this issue ~ |
| IIRC we encode the TRT version into the engine file in the fiirst few bytes, does read it work for you? @zerollzeng do you know which type of casting you guys like to use while reading first few bytes (32b, 16b, 8b)
This unfortunately does not give me anything, although I can see trt at the start as ascii |
#3073 (comment) Have you try this? |
No that requires minimum of 8.6 (I can not use that version), so I came up with my own stupid way, which doesn't work weird because I read uint8_t and then cast it to int32_t, which I believe same with the reference you gave. |
Okay, this is subject to change until we provide the API. |
please give the exact trtexec command to find the version of a trt file |
Hi @jpfleischer It just reads the engine file generated by TRT as binary after version 8.6. You can use these bash commands to print the specified bytes:
|
the trtexec option is called
please use trtexec help to see more information. |
Nvida's hardware is really awesome, and its software design is a piece of shit, with no regard for compatibility. |
But don't forget buying their stocks :D At least they might pay your next meal :D |
Sorry about the inconvenience and we are trying to improve it, but unfortunately it's hard to maintain a "good compatibility" due to the fast changing world :-( |
greetings!
In our project, we will keep different tensorrt versions on different platforms.
TensorRT will raise an error with "Serialize Version" when I deserialize an engine file with the wrong tensorrt version. Also I found the "Serialize Version" is in the 9th byte in the engine file. By the "Serialize Version", we can't identify the verbose version in the corresponding tensorrt version.
Is there some way we can get the engine file version or platform and don't need to deserialize ?
The text was updated successfully, but these errors were encountered: