Skip to main content

Module drv

Module drv 

Source
Expand description

libnrt loader. We need three symbols — nrt_init, nrt_get_total_nc_count, and nrt_get_version — and a best-effort read of the Neuron-specific env vars that AWS containers set.

drop(sym) on a libloading::Symbol ends the borrow on its Library; Symbol doesn’t impl Drop but the lifetime parameter does the work.

Structs§

Loaded
Resolved libnrt state: core count, version, and optional entry points.

Enums§

NeuronGen
Neuron hardware generation, inferred from instance type or runtime version.

Constants§

NRT_SUCCESS
Success status (NRT_SUCCESS).

Functions§

detect_generation
Best-effort generation detection. Prefers NEURON_INSTANCE_TYPE env hint (commonly set by AWS Deep Learning AMIs + containers), falls back to the Neuron runtime major version.
is_available
Returns true if libnrt loaded and initialised.
total_cores
Total NeuronCores from nrt_get_total_nc_count, or 0 if libnrt is unavailable.
version
Runtime version string from nrt_get_version, if available.

Type Aliases§

NrtAddTensorToSetFn
Signature of nrt_add_tensor_to_tensor_set.
NrtAllocTensorSetFn
Signature of nrt_allocate_tensor_set.
NrtExecuteFn
Signature of nrt_execute.
NrtFreeTensorSetFn
Signature of nrt_free_tensor_set.
NrtLoadFn
Signature of nrt_load.
NrtModelHandle
Opaque nrt_model_t handle.
NrtStatus
NRT_STATUS return code from the Neuron runtime.
NrtTensorHandle
Opaque nrt_tensor_t handle.
NrtTensorSetHandle
Opaque nrt_tensor_set_t handle.
NrtUnloadFn
Signature of nrt_unload.