{"id":29352947,"url":"https://github.com/em-geeklab/nvidia-driver-installer","last_synced_at":"2025-07-09T01:16:55.654Z","repository":{"id":303285916,"uuid":"1014961703","full_name":"EM-GeekLab/nvidia-driver-installer","owner":"EM-GeekLab","description":"支持多种 Linux 发行版的交互式/自动化 NVIDIA 驱动安装脚本","archived":false,"fork":false,"pushed_at":"2025-07-06T20:16:22.000Z","size":35,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-06T20:28:30.212Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/EM-GeekLab.png","metadata":{"files":{"readme":"README.en.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-07-06T18:38:10.000Z","updated_at":"2025-07-06T20:16:25.000Z","dependencies_parsed_at":"2025-07-06T20:28:50.449Z","dependency_job_id":"1c5628e0-56e6-4be5-8ab9-ab273bba8c98","html_url":"https://github.com/EM-GeekLab/nvidia-driver-installer","commit_stats":null,"previous_names":["em-geeklab/nvidia-driver-installer"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/EM-GeekLab/nvidia-driver-installer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EM-GeekLab%2Fnvidia-driver-installer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EM-GeekLab%2Fnvidia-driver-installer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EM-GeekLab%2Fnvidia-driver-installer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EM-GeekLab%2Fnvidia-driver-installer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/EM-GeekLab","download_url":"https://codeload.github.com/EM-GeekLab/nvidia-driver-installer/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EM-GeekLab%2Fnvidia-driver-installer/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264373831,"owners_count":23598085,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-07-09T01:16:52.351Z","updated_at":"2025-07-09T01:16:55.586Z","avatar_url":"https://github.com/EM-GeekLab.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://github.com/EM-GeekLab/nvidia-driver-installer\"\u003e\n        \u003cimg src=\"logo.svg\" alt=\"NVIDIA Driver Installer\" width=\"150\"\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\u003ch1 align=\"center\"\u003eUniversal NVIDIA Driver Installation Script\u003c/h1\u003e\n\u003cp align=\"center\"\u003eOne script to automate NVIDIA driver installation across multiple Linux distributions.\u003c/p\u003e\n\n```bash\ncurl -sSL https://raw.githubusercontent.com/EM-GeekLab/nvidia-driver-installer/main/nvidia-install.sh -o nvidia-install.sh\nsudo bash nvidia-install.sh\n```\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"README.md\"\u003e简体中文\u003c/a\u003e | English\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/EM-GeekLab/nvidia-driver-installer/blob/main/LICENSE\"\u003e\u003cimg src=\"https://shields.io/github/license/EM-GeekLab/nvidia-driver-installer?color=%2376b900\" alt=\"License: Apache 2.0\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/EM-GeekLab/nvidia-driver-installer\"\u003e\u003cimg src=\"https://img.shields.io/github/stars/EM-GeekLab/nvidia-driver-installer?color=%2376b900\" alt=\"Stars\"\u003e\u003c/a\u003e\n\u003ca href=\"https://deepwiki.com/EM-GeekLab/nvidia-driver-installer\"\u003e\u003cimg src=\"https://deepwiki.com/badge.svg\" alt=\"Ask DeepWiki\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cdiv align=\"center\"\u003e\n\u003ctable\u003e\n    \u003cthead\u003e\n        \u003ctr\u003e\n            \u003cth\u003eOperating System\u003c/th\u003e\n            \u003cth\u003eSupported Versions\u003c/th\u003e\n        \u003c/tr\u003e\n    \u003c/thead\u003e\n    \u003ctbody\u003e\n        \u003ctr\u003e\n            \u003ctd\u003e\u003csub\u003e\u003cimg src=\"https://raw.githubusercontent.com/devicons/devicon/master/icons/ubuntu/ubuntu-original.svg\" width=\"16\"\u003e\u003c/sub\u003e Ubuntu\u003c/td\u003e\n            \u003ctd\u003e\u003ccode\u003e20.04\u003c/code\u003e, \u003ccode\u003e22.04\u003c/code\u003e, \u003ccode\u003e24.04\u003c/code\u003e\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n            \u003ctd\u003e\u003csub\u003e\u003cimg src=\"https://raw.githubusercontent.com/devicons/devicon/master/icons/debian/debian-plain.svg\" width=\"16\"\u003e\u003c/sub\u003e Debian\u003c/td\u003e\n            \u003ctd\u003e\u003ccode\u003e12\u003c/code\u003e\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n            \u003ctd\u003eKylinOS\u003c/td\u003e\n            \u003ctd\u003e\u003ccode\u003eV10 SP3\u003c/code\u003e\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n            \u003ctd\u003e\u003csub\u003e\u003cimg src=\"https://raw.githubusercontent.com/devicons/devicon/master/icons/redhat/redhat-plain.svg\" width=\"16\"\u003e\u003c/sub\u003e Red Hat Enterprise Linux\u003c/td\u003e\n            \u003ctd\u003e\u003ccode\u003e8.x\u003c/code\u003e, \u003ccode\u003e9.x\u003c/code\u003e\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n            \u003ctd\u003e\u003csub\u003e\u003cimg src=\"https://raw.githubusercontent.com/devicons/devicon/master/icons/rockylinux/rockylinux-original.svg\" width=\"16\"\u003e\u003c/sub\u003e Rocky Linux\u003c/td\u003e\n            \u003ctd\u003e\u003ccode\u003e8.x\u003c/code\u003e, \u003ccode\u003e9.x\u003c/code\u003e\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n            \u003ctd\u003e\u003csub\u003e\u003cimg src=\"https://raw.githubusercontent.com/devicons/devicon/master/icons/oracle/oracle-original.svg\" width=\"16\"\u003e\u003c/sub\u003e Oracle Linux\u003c/td\u003e\n            \u003ctd\u003e\u003ccode\u003e8.x\u003c/code\u003e, \u003ccode\u003e9.x\u003c/code\u003e\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n            \u003ctd\u003e\u003csub\u003e\u003cimg src=\"https://raw.githubusercontent.com/devicons/devicon/master/icons/fedora/fedora-plain.svg\" width=\"16\"\u003e\u003c/sub\u003e Fedora\u003c/td\u003e\n            \u003ctd\u003eOfficially supports \u003ccode\u003e41\u003c/code\u003e\u003cbr/\u003eScript theoretically supports \u003ccode\u003e39\u003c/code\u003e~\u003ccode\u003e42\u003c/code\u003e\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n            \u003ctd\u003e\u003csub\u003e\u003cimg src=\"https://raw.githubusercontent.com/devicons/devicon/master/icons/opensuse/opensuse-original.svg\" width=\"16\"\u003e\u003c/sub\u003e openSUSE\u003c/td\u003e\n            \u003ctd\u003e\u003ccode\u003e15 SP6\u003c/code\u003e\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n            \u003ctd\u003e\u003csub\u003e\u003cimg src=\"https://raw.githubusercontent.com/devicons/devicon/master/icons/opensuse/opensuse-original.svg\" width=\"16\"\u003e\u003c/sub\u003e SUSE Linux Enterprise Server\u003c/td\u003e\n            \u003ctd\u003e\u003ccode\u003e15 SP6\u003c/code\u003e\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n            \u003ctd\u003e\u003csub\u003e\u003cimg src=\"https://raw.githubusercontent.com/devicons/devicon/master/icons/amazonwebservices/amazonwebservices-original-wordmark.svg\" width=\"16\"\u003e\u003c/sub\u003e Amazon Linux\u003c/td\u003e\n            \u003ctd\u003e\u003ccode\u003e2023\u003c/code\u003e\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n            \u003ctd\u003e\u003csub\u003e\u003cimg src=\"https://raw.githubusercontent.com/devicons/devicon/refs/heads/master/icons/azure/azure-original.svg\" width=\"16\"\u003e\u003c/sub\u003e Azure Linux\u003c/td\u003e\n            \u003ctd\u003e\u003ccode\u003e2.0\u003c/code\u003e, \u003ccode\u003e3.0\u003c/code\u003e\u003c/td\u003e\n        \u003c/tr\u003e\n    \u003c/tbody\u003e\n\u003c/table\u003e\n\u003c/div\u003e\n\n\u003e [!WARNING]\n\u003e The script may also be compatible with other Debian or RHEL-based derivative distributions, but it has not been fully tested.\n\n### 📖 Introduction\n\nThis project aims to provide a universal NVIDIA driver installation script that supports multiple Linux distributions. It automates the installation of NVIDIA drivers through package managers (such as `dnf`, `apt`, `zypper`, etc.), avoiding the tedious process of manually downloading and running `.run` files.\n\nThe script also provides a highly automated installation experience, supporting unattended installation, idempotent operations, state recovery, and a rollback mechanism to ensure stable operation in various environments.\n\n### 🚀 Quick Start\n\n\u003e [!NOTE]\n\u003e For security reasons, it is recommended to use the following two-step installation method. This gives you an opportunity to review the script's content before execution.\n\n```bash\ncurl -sSL https://raw.githubusercontent.com/EM-GeekLab/nvidia-driver-installer/main/nvidia-install.sh -o nvidia-install.sh\nsudo bash nvidia-install.sh\n```\n\nThis command will launch an interactive installation wizard to help you complete the NVIDIA driver installation.\n\nIf you need to use it in a CI/CD environment or automated script, you can add the `-y` parameter for unattended installation:\n```bash\nsudo bash nvidia-install.sh -y -q --auto-reboot\n```\n\n### 🛠️ Usage and Options\n\nThe script provides a rich set of command-line options to meet the needs of different scenarios.\n\nUsage: `./nvidia-install.sh [options]`\n\n#### Basic Options:\n    -h, --help              Show this help message\n    -t, --type TYPE         Installation type: full, compute-only, desktop-only (default: full)\n    -m, --modules TYPE      Kernel module type: open, proprietary (default: open)\n    -l, --local             Install using a local repository\n    -v, --version VERSION   Specify driver version (e.g., 575)\n\n#### Automation Options:\n    -y, --yes               Automatically confirm all prompts (non-interactive mode)\n    -q, --quiet             Quiet mode, reduce output\n    -f, --force             Force reinstallation, even if drivers are already installed\n    -s, --skip-checks       Skip existing installation checks\n    --auto-reboot           Automatically reboot after installation\n\n#### Advanced Options:\n    --cleanup               Clean up failed installation state and exit\n    --rollback              Roll back to the pre-installation state\n    --show-exit-codes       Show all exit codes and their meanings\n\n#### Examples\n\n*   **Interactive Installation (Recommended)**\n    ```bash\n    sudo bash nvidia-install.sh\n    ```\n\n*   **Fully Automated Installation (CI/CD Environment)**\n    ```bash\n    sudo bash nvidia-install.sh -y -q --auto-reboot\n    ```\n\n*   **Install Compute-Only Drivers with Proprietary Kernel Modules**\n    ```bash\n    sudo bash nvidia-install.sh -t compute-only -m proprietary -y\n    ```\n\n*   **Roll Back All Changes**\n    ```bash\n    sudo bash nvidia-install.sh --rollback\n    ```\n\n*   **View All Exit Code Meanings**\n    ```bash\n    ./nvidia-install.sh --show-exit-codes\n    ```\n\n### ✨ Features\n\nThis script aims to solve the inconveniences of manual or official `.run` file installation methods by providing a more modern and reliable solution.\n\n* **🤖 Highly Automated**\n    * With parameters like `-y` (yes) and `-q` (quiet), it can achieve fully non-interactive silent installation without manual intervention.\n    * Automatically detects the operating system distribution, version, and GPU architecture to select the best installation strategy.\n    * Automatically handles existing driver conflicts and cleans them up based on user choice or automated policies.\n\n* **🔄 Idempotency and State Recovery**\n    * The script supports **idempotent operations**, meaning it can be safely run multiple times. If the driver is already correctly installed, the script will detect it and skip, preventing system damage.\n    * Every step of the installation process is logged. If the script is interrupted unexpectedly (e.g., network issues, SSH disconnection), it will automatically prompt to **resume installation** from the breakpoint on the next run, without starting from scratch.\n\n* **⏪ Reliable Rollback Mechanism**\n    * Before performing any substantial modifications to the system (like installing packages or adding repositories), the script records the corresponding \"undo\" operation.\n    * If the installation fails or you want to uninstall the drivers, simply run the `--rollback` parameter to **restore the system to its pre-installation state**.\n\n* **🔒 Intelligent Secure Boot Handling**\n    * Automatically detects the system's UEFI Secure Boot status.\n    * If Secure Boot is enabled, the script provides a detailed explanation and multiple solutions (disabling SB or configuring MOK keys).\n    * In interactive mode, it can guide the user to automatically generate and enroll MOK keys to meet Secure Boot's signing requirements.\n\n* **⚙️ Flexible Installation Options**\n    * Supports selection between **open-source** (`open`) and **proprietary** (`proprietary`) kernel modules.\n    * Supports three installation types: **full**, **compute-only**, and **desktop-only**, to meet the needs of different scenarios.\n    * Supports installation from NVIDIA's official network repository or a local repository.\n\n\n### 🎯 Applicable Scenarios\n\nThis script is particularly useful in the following scenarios:\n\n* **Data Centers and Server Clusters**: For unified and repeatable driver deployment across a large number of servers. The automation and idempotency features ensure deployment consistency and reliability.\n* **DevOps \u0026 CI/CD Environments**: In automated pipelines, a predictable script with clear exit codes is needed to build images or environments that include NVIDIA drivers.\n* **Multi-Distribution Environments**: Supports installing NVIDIA drivers on multiple machines with different distributions simultaneously. The script automatically identifies and adapts, reducing maintenance costs with a unified deployment standard.\n\n### 🆚 Comparison with Runfile Installation Method\n\n| Feature             | This Script (Package Manager Method)                                                                                       | Official `.run` File                                                                                                               |\n| :------------------ | :------------------------------------------------------------------------------------------------------------------------- | :--------------------------------------------------------------------------------------------------------------------------------- |\n| **Integration**     | ✅ **High**: Deeply integrated with the system package manager (`dnf`/`apt`/`zypper`), with clear dependency relationships. | ❌ **Low**: Independent of the package manager, like being \"air-dropped\" into the system, which may conflict with system libraries. |\n| **Uninstallation**  | ✅ **Clean, Thorough**: Easily uninstalled via the package manager. The `--rollback` feature can revert all changes.        | ⚠️ **Difficult, Incomplete**: `nvidia-uninstall` may leave residues; manual cleanup is complex and error-prone.                     |\n| **Automation**      | ✅ **Very Easy**: Rich command-line options and environment variables are tailored for automation.                          | ⚠️ **More Complex**: Requires concatenating many `--silent` series parameters, with poor fault tolerance.                           |\n| **Idempotency**     | ✅ **Yes**: Can be safely re-run.                                                                                           | ❌ **No**: Re-running usually leads to installation failure or conflicts.                                                           |\n| **Rollback**        | ✅ **Supported**: One-click rollback to the pre-installation state.                                                         | ❌ **Not Supported**: No rollback mechanism.                                                                                        |\n| **Secure Boot**     | ✅ **Intelligent Handling**: Automatically detects and provides solutions, can assist with MOK signing.                     | ❌ **Not Supported**: Requires the user to manually handle all Secure Boot related issues before installation.                      |\n| **Offline Install** | ⚠️ **Indirectly Supported**: Requires setting up a local repository first.                                                  | ✅ **Directly Supported**: The `.run` file itself is an offline installation package.                                               |\n| **Latest Drivers**  | ⚠️ **Depends on Repository**: Driver version update speed depends on the official NVIDIA repository.                        | ✅ **Fastest**: NVIDIA's official website usually releases the latest drivers in `.run` format first.                               |\n\n\n\n---\n\u003cp align=\"center\"\u003e\n    If you find this project helpful, please click the ⭐ Star at the top right of the repository and share it with more friends!\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://star-history.com/#EM-GeekLab/nvidia-driver-installer\u0026Date\"\u003e\n     \u003cpicture\u003e\n       \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://api.star-history.com/svg?repos=EM-GeekLab/nvidia-driver-installer\u0026type=Date\u0026theme=dark\" /\u003e\n       \u003csource media=\"(prefers-color-scheme: light)\" srcset=\"https://api.star-history.com/svg?repos=EM-GeekLab/nvidia-driver-installer\u0026type=Date\" /\u003e\n       \u003cimg alt=\"Star History Chart\" src=\"https://api.star-history.com/svg?repos=EM-GeekLab/nvidia-driver-installer\u0026type=Date\" /\u003e\n     \u003c/picture\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fem-geeklab%2Fnvidia-driver-installer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fem-geeklab%2Fnvidia-driver-installer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fem-geeklab%2Fnvidia-driver-installer/lists"}