From dbefc1b85021df75db3554cd87c8f10aa7ec5250 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sun, 3 May 2026 15:58:32 +0200 Subject: [PATCH] Simplify the steam install so we don't need user intervention for drivers --- bin/omarchy-hw-nvidia-gsp | 6 ++++++ bin/omarchy-hw-nvidia-without-gsp | 6 ++++++ bin/omarchy-install-steam | 22 ++++++++++++++++++++-- install/config/hardware/nvidia.sh | 10 +++------- 4 files changed, 35 insertions(+), 9 deletions(-) create mode 100755 bin/omarchy-hw-nvidia-gsp create mode 100755 bin/omarchy-hw-nvidia-without-gsp diff --git a/bin/omarchy-hw-nvidia-gsp b/bin/omarchy-hw-nvidia-gsp new file mode 100755 index 00000000..06af2a3e --- /dev/null +++ b/bin/omarchy-hw-nvidia-gsp @@ -0,0 +1,6 @@ +#!/bin/bash + +# omarchy:summary=Detect whether the computer has an NVIDIA GPU with GSP firmware (Turing or newer). + +# GTX 16xx, RTX 20xx-50xx, RTX Pro, Quadro RTX, datacenter A/H/T/L series. +lspci | grep -i 'nvidia' | grep -qE "GTX 16[0-9]{2}|RTX [2-5][0-9]{3}|RTX PRO [0-9]{4}|Quadro RTX|RTX A[0-9]{4}|A[1-9][0-9]{2}|H[1-9][0-9]{2}|T4|L[0-9]+" diff --git a/bin/omarchy-hw-nvidia-without-gsp b/bin/omarchy-hw-nvidia-without-gsp new file mode 100755 index 00000000..177e60b6 --- /dev/null +++ b/bin/omarchy-hw-nvidia-without-gsp @@ -0,0 +1,6 @@ +#!/bin/bash + +# omarchy:summary=Detect whether the computer has an NVIDIA GPU without GSP firmware (Maxwell/Pascal/Volta). + +# GTX 9xx/10xx, GT 10xx, Quadro P/M/GV, MX series, Titan X/Xp/V, Tesla V100. +lspci | grep -i 'nvidia' | grep -qE "GTX (9[0-9]{2}|10[0-9]{2})|GT 10[0-9]{2}|Quadro [PM][0-9]{3,4}|Quadro GV100|MX *[0-9]+|Titan (X|Xp|V)|Tesla V100" diff --git a/bin/omarchy-install-steam b/bin/omarchy-install-steam index 8d88f7d7..0fad4a5a 100755 --- a/bin/omarchy-install-steam +++ b/bin/omarchy-install-steam @@ -5,6 +5,24 @@ set -e -echo "Now pick dependencies matching your graphics card" -sudo pacman -S steam +PACKAGES=(steam) + +# Pick the lib32 vulkan provider matching detected GPU(s) so pacman doesn't prompt. +if omarchy-hw-nvidia-gsp; then + PACKAGES+=(lib32-nvidia-utils) +elif omarchy-hw-nvidia-without-gsp; then + PACKAGES+=(lib32-nvidia-580xx-utils) +fi + +declare -A VULKAN_DRIVERS=( + [Intel]=lib32-vulkan-intel + [AMD]=lib32-vulkan-radeon +) +for vendor in "${!VULKAN_DRIVERS[@]}"; do + if lspci | grep -iE "(VGA|Display).*$vendor" >/dev/null; then + PACKAGES+=("${VULKAN_DRIVERS[$vendor]}") + fi +done + +omarchy-pkg-add "${PACKAGES[@]}" setsid gtk-launch steam >/dev/null 2>&1 & diff --git a/install/config/hardware/nvidia.sh b/install/config/hardware/nvidia.sh index 5fb37232..dddcf7e4 100644 --- a/install/config/hardware/nvidia.sh +++ b/install/config/hardware/nvidia.sh @@ -1,15 +1,11 @@ -NVIDIA="$(lspci | grep -i 'nvidia')" - -if [[ -n $NVIDIA ]]; then +if lspci | grep -qi 'nvidia'; then # Check which kernel is installed and set appropriate headers package KERNEL_HEADERS="$(pacman -Qqs '^linux(-zen|-lts|-hardened)?$' | head -1)-headers" - # Turing+ (GTX 16xx, RTX 20xx-50xx, RTX Pro, Quadro RTX, datacenter A/H/T/L series) have GSP firmware - if echo "$NVIDIA" | grep -qE "GTX 16[0-9]{2}|RTX [2-5][0-9]{3}|RTX PRO [0-9]{4}|Quadro RTX|RTX A[0-9]{4}|A[1-9][0-9]{2}|H[1-9][0-9]{2}|T4|L[0-9]+"; then + if omarchy-hw-nvidia-gsp; then PACKAGES=(nvidia-open-dkms nvidia-utils lib32-nvidia-utils libva-nvidia-driver) GPU_ARCH="turing_plus" - # Maxwell (GTX 9xx), Pascal (GT/GTX 10xx, Quadro P, MX series), Volta (Titan V, Tesla V100, Quadro GV100) lack GSP - elif echo "$NVIDIA" | grep -qE "GTX (9[0-9]{2}|10[0-9]{2})|GT 10[0-9]{2}|Quadro [PM][0-9]{3,4}|Quadro GV100|MX *[0-9]+|Titan (X|Xp|V)|Tesla V100"; then + elif omarchy-hw-nvidia-without-gsp; then PACKAGES=(nvidia-580xx-dkms nvidia-580xx-utils lib32-nvidia-580xx-utils) GPU_ARCH="maxwell_pascal_volta" fi