pub(crate) fn get_gpu_driver(card_index: i32) -> StringExpand description
Read the kernel driver bound to a render node for encoder routing.
An nvidia driver name routes to NVENC; anything else routes to VA-API. The name is
lowercased for case-insensitive substring matching, and is empty when the node has no driver
link (treated as “no detectable GPU” by the selection logic).
sysfs lists every card the kernel sees, not the ones this process was given: a container
handed a single GPU still finds the host’s others under /sys/class/drm. A driver read
from a node with no device file would route the encoder at hardware it cannot open, so an
absent node answers the same as an unknown one.
§Arguments
card_index- DRM card index (maps to/sys/class/drm/renderD{128 + card_index}).
§Returns
Lowercased driver name, or an empty string if the node is unusable or has no driver link.