[package] name = "dr-inference-engine" version.workspace = true edition.workspace = true rust-version.workspace = true license.workspace = true # The one crate that names a runtime, a provider, a vendor library or a # device (docs/dev/inference.md §8). `dr-face` and `dr-segment` ask it for a # session by role and never see which of these answered. [dependencies] thiserror.workspace = true log.workspace = true serde.workspace = true serde_json.workspace = true # `ort` is the API; what supplies it is decided once per process (§3): # `libonnxruntime` found on disk, or `tract`. Both are behind # `alternative-backend`, so nothing here links C on any target. ort = { workspace = true } ort-tract = { workspace = true, optional = true } # dlopen, and the C types of the table it fetches. Both pure Rust; # `libloading` is already in the tree through wgpu. libloading = { version = "0.8", optional = true } ort-sys = { version = "2.0.0-rc.13", default-features = false, features = ["disable-linking"], optional = true } # The NVIDIA rungs exist on the desktop only. These features add `ort`'s # option builders and nothing else — no linking under `alternative-backend` — # but an Android binary has no business carrying even the option names, and # the packaging must never be tempted to (§2, §3.1). The AMD rung needs no # feature: MIGraphX is registered through the runtime's generic key/value # entry point (`session::migraphx`), because `ort`'s own builder cannot # name the compiled-program cache. [target.'cfg(not(target_os = "android"))'.dependencies] ort = { workspace = true, features = ["cuda", "tensorrt"] } [target.'cfg(target_os = "android")'.dependencies] ort = { workspace = true, features = ["qnn"] } [features] # The floor: `tract` supplies the API table when no runtime file is found, or # always, in a build without `native`. Tests want this and nothing else. default = ["tract"] tract = ["dep:ort-tract"] # Look for `libonnxruntime` on disk and hand its table to `ort`. native = ["dep:libloading", "dep:ort-sys"] [dev-dependencies] # The `ep_probe` example prints the provider's own diagnostics, which is most # of what a failed rung tells you. env_logger.workspace = true