Install & Upgrade the latest NVIDIA DKMS driver for Ubuntu (headless servers)
This script installs or upgrades the latest NVIDIA Geforce drivers on Ubuntu headless servers (e.g., Plex/Emby/AI workloads).
- Branch selection: Installs the latest Production, New Feature, or Beta branch (configurable via
DRIVER_BRANCHin the script). - Automatic patching: Optionally applies nvidia-patch for NVENC/NvFBC unlock.
- Interactive/Automated: By default, prompts before reinstalling the latest version. Set
interactive=falsefor full automation.
- Download or clone this repository to your server.
- Make the script executable:
chmod +x nvidia-upgrade.sh
- Run as root:
sudo ./nvidia-upgrade.sh
- To run fully automated, set
interactive=falsein the script. - To select a different driver branch, set
DRIVER_BRANCHtoproduction,new-feature, orbeta. - To automate via cron, add to root's crontab:
# Run NVIDIA Driver Upgrade (1st Monday of the month at 2am) 0 2 1-7 * MON /path/to/scripts/nvidia-upgrade/nvidia-upgrade.sh
- Detects installed NVIDIA driver version (via DKMS or nvidia-smi)
- Fetches the latest available driver for the selected branch
- Checks if upgrade is needed; prompts if already latest (unless automated)
- Downloads and installs the driver silently (with DKMS)
- Optionally applies nvidia-patch for NVENC/NvFBC unlock
- Cleans up and restarts any stopped Docker containers
A workflow (see .github/workflows/test-and-badge.yml) simulates a test run, extracts the latest NVIDIA and Ubuntu versions, and updates the above table with the current status.
MIT

