/ de-omarchy / bin / omarchy-hw-nvidia-gsp
swadhinbiswas Initial de-omarchy: Omarchy UI layer for Arch-based distros · 8/22/2026
9f393b2
21 lines · 685 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/bash

# omarchy: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="${OMARCHY_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