Skip to main content

has_hidden_gpus

Function has_hidden_gpus 

Source
fn has_hidden_gpus() -> bool
Expand description

True when at least one host GPU is hidden from the container — the only situation that can trigger the peer-init bug, so it gates whether the filter installs at all.

Compares two counts: host is the number of GPUs the kernel driver knows, from the non-dot entries of /proc/driver/nvidia/gpus; visible is the number of /dev/nvidia{0..31} nodes the container can open. GPUs are hidden when host > visible, and the visible > 0 clause ensures there is still a usable GPU (a container with no GPUs at all is not this case).