Update nvidia_installer.sh

This commit is contained in:
MacRimi
2026-06-12 17:19:20 +02:00
parent b5cdf1d2a6
commit 345d66e0fd

View File

@@ -1625,6 +1625,17 @@ auto_reinstall_from_state() {
echo "No NVIDIA GPU detected on this host — skipping reinstall" | tee -a "$LOG_FILE" echo "No NVIDIA GPU detected on this host — skipping reinstall" | tee -a "$LOG_FILE"
return 0 return 0
fi fi
# Skip if the GPU is bound to vfio-pci (reserved for VM passthrough);
# installing the host driver would conflict with the passthrough config.
local _vfio_dev
for _vfio_dev in /sys/bus/pci/devices/*; do
[[ "$(cat "$_vfio_dev/vendor" 2>/dev/null)" == "0x10de" ]] || continue
if [[ -L "$_vfio_dev/driver" ]] \
&& [[ "$(basename "$(readlink "$_vfio_dev/driver")")" == "vfio-pci" ]]; then
echo "NVIDIA GPU bound to vfio-pci — skipping host driver reinstall" | tee -a "$LOG_FILE"
return 0
fi
done
detect_driver_status detect_driver_status
if $CURRENT_DRIVER_INSTALLED && [[ "$CURRENT_DRIVER_VERSION" == "$recorded_version" ]]; then if $CURRENT_DRIVER_INSTALLED && [[ "$CURRENT_DRIVER_VERSION" == "$recorded_version" ]]; then
echo "Driver $recorded_version already installed and matches state — no-op" | tee -a "$LOG_FILE" echo "Driver $recorded_version already installed and matches state — no-op" | tee -a "$LOG_FILE"