From d88b9bcbeda114f043d994fc51997c622c7fe0e3 Mon Sep 17 00:00:00 2001 From: HikariKnight <2557889+HikariKnight@users.noreply.github.com> Date: Wed, 14 Aug 2024 15:53:09 +0200 Subject: [PATCH] feat(nvidia): add script check for legacy nvidia hardware (#1428) * feat: add script check for legacy nvidia hardware on nvidia image * fix(nvidia-legacy-hardware): remove unintended output from grep in the if condition * chore(nvidia): add Volta to nvidia-legacy-hardware --- .../nvidia/shared/usr/libexec/nvidia-legacy-hardware | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100755 system_files/nvidia/shared/usr/libexec/nvidia-legacy-hardware diff --git a/system_files/nvidia/shared/usr/libexec/nvidia-legacy-hardware b/system_files/nvidia/shared/usr/libexec/nvidia-legacy-hardware new file mode 100755 index 00000000..74623905 --- /dev/null +++ b/system_files/nvidia/shared/usr/libexec/nvidia-legacy-hardware @@ -0,0 +1,7 @@ +#!/usr/bin/bash +# Returns true if legacy nvidia hardware (older than turing) using die names +# GK### (Kepler), GM### (Maxwell), GP### (Pascal), GV### (Volta) +if lspci -nn | grep -P "(VGA compatible|3D) controller .+G(K|M|P|V)\d{3}" > /dev/null; then + exit 0 +fi +exit 1