Skip to main content

Module detect

Module detect 

Source
Expand description

libtorch installation detection and .arch metadata parsing.

Structs§

LibtorchInfo
Metadata about an installed libtorch variant (from .arch file).

Functions§

active_variant
This box’s active libtorch as (variant directory, variant label), anchored on root (a project root, or the global one).
is_valid_variant
Check whether a libtorch variant directory looks valid (has lib/).
ld_library_path_lines
The export lines a native-build recipe prints for a variant’s vendor, in order.
ld_library_path_value
LD_LIBRARY_PATH VALUE for running against libtorch_lib, in the order the loader must see it. The sibling of ld_library_path_lines, which prints the same ordering as a shell recipe; this one is for setting on a child process.
list_variants
List all installed libtorch variants under <root>/libtorch/.
local_rocm_lib_dir
The system ROCm runtime’s library directory on THIS box, for ld_library_path_value’s local callers.
read_active
Read the active libtorch variant from <root>/libtorch/.active and parse its .arch metadata.
read_active_from
Read any .active* pointer file and resolve its content (a relative path like precompiled/cu128 or builds/sm61-sm120) against libtorch_root to produce a LibtorchInfo.
set_active
Set the active libtorch variant by writing <root>/libtorch/.active.
unmet_loader_requirements
Unmet dynamic-linker requirements of a libtorch variant on THIS host, as the loader itself reports them.
variant_feature
The cargo feature a variant needs, or "" for a CPU-only variant.
variant_vendor
Which GPU stack a libtorch variant path targets, from its basename.