Table of Contents

Class TensorRtEnvironmentProbe

Namespace
JYPPX.TensorRtSharp
Assembly
JYPPX.TensorRtSharp.dll

Queries the current bridge state without requiring TensorRT inference to succeed. 在不要求 TensorRT 推理成功的前提下查询当前 bridge 状态。

public static class TensorRtEnvironmentProbe
Inheritance
TensorRtEnvironmentProbe
Inherited Members

Methods

GetBuilderCapabilityPluginRegistryInventory(TensorRtApiLine, TensorRtEngineCapability)

Gets a read-only snapshot of TensorRT's builder capability plugin registry. 获取 TensorRT builder capability plugin registry 的只读快照。

public static TensorRtPluginRegistryInventory GetBuilderCapabilityPluginRegistryInventory(TensorRtApiLine line, TensorRtEngineCapability capability)

Parameters

line TensorRtApiLine

The TensorRT API line to query. 要查询的 TensorRT API line。

capability TensorRtEngineCapability

The engine capability whose builder-visible registry should be inspected. 要检查其 builder-visible registry 的 engine capability。

Returns

TensorRtPluginRegistryInventory

A builder capability plugin registry inventory snapshot. builder capability plugin registry inventory 快照。

Remarks

This method queries getBuilderPluginRegistry for the requested engine capability. It does not create plugins, register plugins, unregister plugins, initialize plugin libraries, or take ownership of creator objects. 该方法会针对请求的 engine capability 查询 getBuilderPluginRegistry;不会创建 plugin、注册或注销 plugin、初始化 plugin library,也不会接管 creator 对象所有权。

GetCurrent()

Gets the current high-level bridge environment snapshot. 获取当前高层 bridge 环境快照。

public static TensorRtEnvironmentSnapshot GetCurrent()

Returns

TensorRtEnvironmentSnapshot

The current bridge environment snapshot. 当前 bridge 环境快照。

GetGlobalPluginRegistryInventory(TensorRtApiLine)

Gets a read-only snapshot of TensorRT's global plugin registry. 获取 TensorRT 全局 plugin registry 的只读快照。

public static TensorRtPluginRegistryInventory GetGlobalPluginRegistryInventory(TensorRtApiLine line)

Parameters

line TensorRtApiLine

The TensorRT API line to query. 要查询的 TensorRT API line。

Returns

TensorRtPluginRegistryInventory

A global plugin registry inventory snapshot. 全局 plugin registry inventory 快照。

Remarks

This method does not initialize plugin libraries, create plugins, deserialize plugins, or take ownership of creator objects. 该方法不会初始化 plugin library、创建 plugin、反序列化 plugin,也不会接管 creator 对象所有权。

GetGlobalRuntimeVersion(TensorRtApiLine)

Gets TensorRT global runtime version details without creating a runtime. 无需创建 runtime 即可获取 TensorRT 全局 runtime 版本信息。

public static TensorRtGlobalRuntimeVersion GetGlobalRuntimeVersion(TensorRtApiLine line)

Parameters

line TensorRtApiLine

The TensorRT API line to query. 要查询的 TensorRT API line。

Returns

TensorRtGlobalRuntimeVersion

A global runtime version snapshot. 全局 runtime 版本快照。

IsBuilderCapabilityPluginCreatorRegistered(TensorRtApiLine, TensorRtEngineCapability, string, string, string)

Checks whether TensorRT's builder capability plugin registry contains a creator matching the supplied metadata. 检查 TensorRT builder capability plugin registry 是否包含匹配给定元数据的 creator。

public static bool IsBuilderCapabilityPluginCreatorRegistered(TensorRtApiLine line, TensorRtEngineCapability capability, string pluginName, string pluginVersion, string pluginNamespace)

Parameters

line TensorRtApiLine

The TensorRT API line to query. 要查询的 TensorRT API line。

capability TensorRtEngineCapability

The engine capability whose builder-visible registry should be inspected. 要检查其 builder-visible registry 的 engine capability。

pluginName string

The plugin creator name. plugin creator 名称。

pluginVersion string

The plugin creator version. plugin creator 版本。

pluginNamespace string

The plugin creator namespace. plugin creator 命名空间。

Returns

bool

true when TensorRT finds a matching creator. TensorRT 找到匹配 creator 时返回 true

Remarks

This lookup does not create a plugin and does not return or own the native creator pointer. 该 lookup 不会创建 plugin,也不会返回或持有 native creator 指针。

IsBuilderSafePluginRegistryAvailable(TensorRtApiLine, TensorRtEngineCapability)

Checks whether TensorRT exposes a builder safe plugin registry for the requested engine capability. 检查 TensorRT 是否为指定 engine capability 暴露 builder safe plugin registry。

public static bool IsBuilderSafePluginRegistryAvailable(TensorRtApiLine line, TensorRtEngineCapability capability)

Parameters

line TensorRtApiLine

The TensorRT API line to query. 要查询的 TensorRT API line。

capability TensorRtEngineCapability

The engine capability whose safe builder registry should be checked. 要检查 safe builder registry 的 engine capability。

Returns

bool

true when TensorRT reports a safe builder plugin registry. TensorRT 报告存在 safe builder plugin registry 时返回 true

Remarks

This method calls the deprecated TensorRT safe-registry getter only to test for a non-null registry pointer. It does not return the registry pointer, register creators, unregister creators, load plugin libraries, or take ownership of native objects. 该方法只调用已弃用的 TensorRT safe registry getter 判断返回指针是否非空;不会返回 registry 指针、注册或注销 creator、加载 plugin library,也不会接管 native 对象所有权。

IsGlobalPluginCreatorRegistered(TensorRtApiLine, string, string, string)

Checks whether TensorRT's global plugin registry contains a creator matching the supplied metadata. 检查 TensorRT 全局 plugin registry 是否存在匹配给定元数据的 creator。

public static bool IsGlobalPluginCreatorRegistered(TensorRtApiLine line, string pluginName, string pluginVersion, string pluginNamespace)

Parameters

line TensorRtApiLine

The TensorRT API line to query. 要查询的 TensorRT API line。

pluginName string

The plugin creator name. plugin creator 名称。

pluginVersion string

The plugin creator version. plugin creator 版本。

pluginNamespace string

The plugin creator namespace. plugin creator 命名空间。

Returns

bool

true when TensorRT finds a matching creator. TensorRT 找到匹配 creator 时返回 true

Remarks

This lookup does not create a plugin and does not return or own the native creator pointer. 该 lookup 不会创建 plugin,也不会返回或持有 native creator 指针。

ProbeNativeDependencies(TensorRtApiLine)

Probes native bridge, TensorRT, CUDA, cuDNN, and parser DLL resolution using managed OS APIs only. 仅使用托管 OS API 探测 native bridge、TensorRT、CUDA、cuDNN 与 parser DLL 的解析情况。

public static TensorRtDependencyProbeReport ProbeNativeDependencies(TensorRtApiLine line)

Parameters

line TensorRtApiLine

The TensorRT API line used to select expected TensorRT DLL file names. 用于选择预期 TensorRT DLL 文件名的 TensorRT API line。

Returns

TensorRtDependencyProbeReport

A non-throwing native dependency probe report. 非抛异常的 native 依赖探测报告。

Remarks

This diagnostic does not call TensorRT global version functions, global registry functions, runtime creation, or builder creation. It is intended to inspect DLL search-path drift before riskier vendor entry points are used. 该诊断不会调用 TensorRT 全局版本函数、全局 registry 函数、runtime 创建或 builder 创建;用于在调用风险更高的 vendor 入口点前检查 DLL 搜索路径漂移。

ProbeRuntime(TensorRtApiLine)

Runs staged TensorRT runtime probes and returns diagnostics for each stage. 运行 TensorRT runtime 分阶段探针,并返回每个阶段的诊断信息。

public static TensorRtRuntimeProbeReport ProbeRuntime(TensorRtApiLine line)

Parameters

line TensorRtApiLine

The TensorRT API line to probe. 要探测的 TensorRT API line。

Returns

TensorRtRuntimeProbeReport

A staged runtime probe report. 分阶段 runtime 探针报告。

Remarks

The probe intentionally separates global version, global registry, logger creation, builder creation, and runtime creation. 探针会刻意分离全局版本、全局 registry、logger 创建、builder 创建和 runtime 创建阶段。

TryBuildTensorRt10SerializedNetworkOnly(out string)

Tries to build a TensorRT 10 serialized network without running inference. 尝试构建一个不执行推理的 TensorRT 10 serialized network。

public static bool TryBuildTensorRt10SerializedNetworkOnly(out string message)

Parameters

message string

A success or failure diagnostic message. 成功或失败诊断消息。

Returns

bool

true when serialized-network build succeeds. serialized network 构建成功时返回 true

TryBuildTensorRt11SerializedNetworkOnly(out string)

Tries to build a TensorRT 11 serialized network without running inference. 尝试构建一个不执行推理的 TensorRT 11 serialized network。

public static bool TryBuildTensorRt11SerializedNetworkOnly(out string message)

Parameters

message string

A success or failure diagnostic message. 成功或失败诊断消息。

Returns

bool

true when serialized-network build succeeds. serialized network 构建成功时返回 true

TryBuildTensorRt8SerializedNetworkOnly(out string)

Tries to build a TensorRT 8 serialized network without running inference. 尝试构建一个不执行推理的 TensorRT 8 serialized network。

public static bool TryBuildTensorRt8SerializedNetworkOnly(out string message)

Parameters

message string

A success or failure diagnostic message. 成功或失败诊断消息。

Returns

bool

true when serialized-network build succeeds. serialized network 构建成功时返回 true

TryCreateBuilder(TensorRtApiLine, out string)

Tries to create a TensorRT builder for one API line. 尝试为一个 API line 创建 TensorRT builder。

public static bool TryCreateBuilder(TensorRtApiLine line, out string message)

Parameters

line TensorRtApiLine

The TensorRT API line. TensorRT API 版本线。

message string

A success or failure diagnostic message. 成功或失败诊断消息。

Returns

bool

true when builder creation succeeds. builder 创建成功时返回 true

TryCreateLogger(TensorRtApiLine, out string)

Tries to create a TensorRT logger for one API line. 尝试为一个 API line 创建 TensorRT logger。

public static bool TryCreateLogger(TensorRtApiLine line, out string message)

Parameters

line TensorRtApiLine

The TensorRT API line. TensorRT API 版本线。

message string

A success or failure diagnostic message. 成功或失败诊断消息。

Returns

bool

true when logger creation succeeds. logger 创建成功时返回 true

TryCreateRuntime(TensorRtApiLine, out string)

Tries to create a TensorRT runtime for one API line. 尝试为一个 API line 创建 TensorRT runtime。

public static bool TryCreateRuntime(TensorRtApiLine line, out string message)

Parameters

line TensorRtApiLine

The TensorRT API line. TensorRT API 版本线。

message string

A success or failure diagnostic message. 成功或失败诊断消息。

Returns

bool

true when runtime creation succeeds. runtime 创建成功时返回 true

TryGetBuilderCapabilityPluginCreator(TensorRtApiLine, TensorRtEngineCapability, string, string, string, out TensorRtPluginCreatorInfo?, out string)

Tries to read metadata for a plugin creator from TensorRT's builder capability plugin registry. 尝试从 TensorRT builder capability plugin registry 读取某个 plugin creator 的元数据。

public static bool TryGetBuilderCapabilityPluginCreator(TensorRtApiLine line, TensorRtEngineCapability capability, string pluginName, string pluginVersion, string pluginNamespace, out TensorRtPluginCreatorInfo? creator, out string diagnostic)

Parameters

line TensorRtApiLine

The TensorRT API line to query. 要查询的 TensorRT API line。

capability TensorRtEngineCapability

The engine capability whose builder-visible registry should be inspected. 要检查其 builder-visible registry 的 engine capability。

pluginName string

The plugin creator name. plugin creator 名称。

pluginVersion string

The plugin creator version. plugin creator 版本。

pluginNamespace string

The plugin creator namespace. plugin creator 命名空间。

creator TensorRtPluginCreatorInfo

The copied creator metadata when a matching creator is found. 找到匹配 creator 时复制出的 creator 元数据。

diagnostic string

A diagnostic string describing success or failure. 描述成功或失败原因的诊断字符串。

Returns

bool

true when a matching creator was found and copied. 找到并复制匹配 creator 时返回 true

Remarks

The returned metadata is copied into managed objects. The native creator pointer is never exposed or owned by managed code. 返回的元数据会复制到托管对象中;native creator 指针不会暴露给托管代码,也不会由托管代码持有。

TryGetBuilderCapabilityPluginRegistryInventory(TensorRtApiLine, TensorRtEngineCapability, out TensorRtPluginRegistryInventory?, out string)

Tries to get TensorRT's builder capability plugin registry inventory without throwing for unsupported lines. 尝试获取 TensorRT builder capability plugin registry inventory;不支持的 API line 不会抛出异常。

public static bool TryGetBuilderCapabilityPluginRegistryInventory(TensorRtApiLine line, TensorRtEngineCapability capability, out TensorRtPluginRegistryInventory? inventory, out string diagnostic)

Parameters

line TensorRtApiLine

The TensorRT API line to query. 要查询的 TensorRT API line。

capability TensorRtEngineCapability

The engine capability whose builder-visible registry should be inspected. 要检查其 builder-visible registry 的 engine capability。

inventory TensorRtPluginRegistryInventory

The inventory snapshot when the query succeeds. 查询成功时的 inventory 快照。

diagnostic string

A diagnostic string describing success or failure. 描述成功或失败原因的诊断字符串。

Returns

bool

true when the inventory was collected successfully. 成功采集 inventory 时返回 true

TryGetGlobalPluginRegistryInventory(TensorRtApiLine, out TensorRtPluginRegistryInventory?, out string)

Tries to get TensorRT's global plugin registry inventory without throwing for unsupported lines. 尝试获取 TensorRT 全局 plugin registry inventory;不支持时不抛出异常。

public static bool TryGetGlobalPluginRegistryInventory(TensorRtApiLine line, out TensorRtPluginRegistryInventory? inventory, out string diagnostic)

Parameters

line TensorRtApiLine

The TensorRT API line to query. 要查询的 TensorRT API line。

inventory TensorRtPluginRegistryInventory

The inventory snapshot when the query succeeds. 查询成功时的 inventory 快照。

diagnostic string

A diagnostic string describing success or failure. 描述成功或失败原因的诊断字符串。

Returns

bool

true when the inventory was collected successfully. 成功采集 inventory 时返回 true

TryGetGlobalRuntimeVersion(TensorRtApiLine, out TensorRtGlobalRuntimeVersion?, out string)

Tries to get TensorRT global runtime version details without throwing for unsupported lines. 尝试获取 TensorRT 全局 runtime 版本信息;不支持时不抛出异常。

public static bool TryGetGlobalRuntimeVersion(TensorRtApiLine line, out TensorRtGlobalRuntimeVersion? version, out string diagnostic)

Parameters

line TensorRtApiLine

The TensorRT API line to query. 要查询的 TensorRT API line。

version TensorRtGlobalRuntimeVersion

The version snapshot when the query succeeds. 查询成功时的版本快照。

diagnostic string

A diagnostic string describing success or failure. 描述成功或失败原因的诊断字符串。

Returns

bool

true when the version was collected successfully. 成功采集版本信息时返回 true

TryRunTensorRt10MinimalBuildChain(out string)

Tries to run the minimal TensorRT 10 build chain. 尝试运行最小 TensorRT 10 构建链路。

public static bool TryRunTensorRt10MinimalBuildChain(out string message)

Parameters

message string

A success or failure diagnostic message. 成功或失败诊断消息。

Returns

bool

true when the minimal build chain succeeds. 最小构建链路成功时返回 true

TryRunTensorRt11MinimalBuildChain(out string)

Tries to run the minimal TensorRT 11 build chain. 尝试运行最小 TensorRT 11 构建链路。

public static bool TryRunTensorRt11MinimalBuildChain(out string message)

Parameters

message string

A success or failure diagnostic message. 成功或失败诊断消息。

Returns

bool

true when the minimal build chain succeeds. 最小构建链路成功时返回 true

TryRunTensorRt8MinimalBuildChain(out string)

Tries to run the minimal TensorRT 8 build chain. 尝试运行最小 TensorRT 8 构建链路。

public static bool TryRunTensorRt8MinimalBuildChain(out string message)

Parameters

message string

A success or failure diagnostic message. 成功或失败诊断消息。

Returns

bool

true when the minimal build chain succeeds. 最小构建链路成功时返回 true