🐜 fix(scripts): Use class codes to check for lspci GPU devices (#168)

Fixes gpu_helpers returning "Non-VGA" devices as GPUs.

I was curious about DeepSeek's so I tried it's hand with this as my head
isn't quite up-to-speed yet 😅
But yeah it seems less error-prone than previous naive string-approach.

---------

Co-authored-by: DatCaptainHorse <DatCaptainHorse@users.noreply.github.com>
Co-authored-by: Wanjohi <elviswanjohi47@gmail.com>
Co-authored-by: Wanjohi <71614375+wanjohiryan@users.noreply.github.com>
This commit is contained in:
Kristian Ollikainen
2025-01-28 06:52:05 +02:00
committed by GitHub
parent 4c33d7fe00
commit 431733a0e8
4 changed files with 43 additions and 49 deletions

View File

@@ -36,19 +36,16 @@ source /etc/nestri/gpu_helpers.sh
get_gpu_info
# Identify vendor
if [[ "${vendor_full_map[0],,}" =~ "intel" ]]; then
echo "Intel GPU detected, installing required packages..."
#chwd -a
pacman -Sy --noconfirm gstreamer-vaapi gst-plugin-va gst-plugin-qsv
# chwd missed a thing
pacman -Sy --noconfirm vpl-gpu-rt
elif [[ "${vendor_full_map[0],,}" =~ "amd" ]]; then
echo "AMD GPU detected, installing required packages..."
#chwd -a
pacman -Sy --noconfirm gstreamer-vaapi gst-plugin-va
elif [[ "${vendor_full_map[0],,}" =~ "nvidia" ]]; then
# Check vendors in priority order
if [[ -n "${vendor_devices[nvidia]:-}" ]]; then
echo "NVIDIA GPU detected. Assuming drivers are linked"
elif [[ -n "${vendor_devices[intel]:-}" ]]; then
echo "Intel GPU detected, installing required packages..."
pacman -Sy --noconfirm gstreamer-vaapi gst-plugin-va gst-plugin-qsv
pacman -Sy --noconfirm vpl-gpu-rt
elif [[ -n "${vendor_devices[amd]:-}" ]]; then
echo "AMD GPU detected, installing required packages..."
pacman -Sy --noconfirm gstreamer-vaapi gst-plugin-va
else
echo "Unknown GPU vendor. No additional packages will be installed"
fi