Only the primary cardN nodes carry a device/vendor, so renderD* and per-connector
entries (card0-HDMI-A-1) are skipped and each physical GPU is counted once — the
connectors are read separately, to answer whether the card drives a display.
If sysfs yields nothing (a minimal container), falls back to parsing nvidia-smi -L; those
entries carry only what the CLI actually tells us.
Enumerate the local GPUs.
Only the primary
cardNnodes carry adevice/vendor, sorenderD*and per-connector entries (card0-HDMI-A-1) are skipped and each physical GPU is counted once — the connectors are read separately, to answer whether the card drives a display.If sysfs yields nothing (a minimal container), falls back to parsing
nvidia-smi -L; those entries carry only what the CLI actually tells us.