Vendor the command set the menu and shell depend on

This commit is contained in:
2026-09-19 23:57:12 -04:00
parent 9501f2bb4d
commit c5434026a8
179 changed files with 12414 additions and 54 deletions
+20
View File
@@ -0,0 +1,20 @@
#!/bin/bash
# blob:summary=Detect whether the computer has an NVIDIA GPU with GSP firmware (Turing or newer).
# Turing is the first generation with GSP firmware, and the first to use device
# IDs at 0x1e00 or above; Maxwell, Pascal, and Volta all sit below that line.
#
# Read the cached sysfs IDs rather than lspci, which reads PCI config space and
# resumes runtime-suspended GPUs.
pci_devices_path="${BLOB_PCI_DEVICES_PATH:-/sys/bus/pci/devices}"
shopt -s nullglob
for device in "$pci_devices_path"/*; do
[[ $(< "$device/vendor") == "0x10de" ]] || continue
[[ $(< "$device/class") == 0x03* ]] || continue
(( $(< "$device/device") >= 0x1e00 )) && exit 0
done
exit 1