Skip to content

Instantly share code, notes, and snippets.

@kimocoder
Created July 28, 2025 00:38
Show Gist options
  • Save kimocoder/daca56aacbf67ecea82961aaf155bc33 to your computer and use it in GitHub Desktop.
Save kimocoder/daca56aacbf67ecea82961aaf155bc33 to your computer and use it in GitHub Desktop.
Check for NVIDIA driver updates
#!/bin/bash
# NVIDIA "New Feature Branch" driver check script
# Author: ChatGPT for kimocoder
NVIDIA_DRIVER_URL="https://www.nvidia.com/en-us/drivers/unix/"
TMP_PAGE=$(mktemp)
echo "πŸ“¦ Checking NVIDIA New Feature Branch drivers..."
echo "Fetching page: $NVIDIA_DRIVER_URL"
# Fetch driver listing
curl -s "$NVIDIA_DRIVER_URL" -o "$TMP_PAGE"
# Check for fetch errors
if [ $? -ne 0 ] || [ ! -s "$TMP_PAGE" ]; then
echo "❌ Failed to fetch NVIDIA driver page."
exit 1
fi
# Parse and extract latest NFB version numbers
latest_versions=$(grep -A2 "New Feature Branch" "$TMP_PAGE" | grep -Eo '[0-9]+\.[0-9]+\.[0-9]+' | sort -V | uniq)
if [ -z "$latest_versions" ]; then
echo "⚠️ No New Feature Branch versions found."
rm -f "$TMP_PAGE"
exit 1
fi
echo "βœ… New Feature Branch Versions Found:"
echo "$latest_versions"
# Optional: Compare with installed version
if command -v nvidia-smi &>/dev/null; then
installed=$(nvidia-smi --query-gpu=driver_version --format=csv,noheader | head -n1)
echo "πŸ” Installed driver version: $installed"
if echo "$latest_versions" | grep -Fx "$installed" >/dev/null; then
echo "πŸŽ‰ You already have a listed New Feature Branch version."
else
echo "🚨 Newer NFB version available!"
fi
else
echo "ℹ️ nvidia-smi not found. Skipping local version check."
fi
rm -f "$TMP_PAGE"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment