nvidia ux & bookworm bpo cleanup

- Removed redundant confirmation dialogs from `_install_nvidia_stack`. Users can now access driver management (including removal) without first confirming installation intent; initial plan display is followed by pause for review instead of blocking prompt.
- Automated CUDA repository enabling on Debian 13/Bookworm paths (590/595). Manual confirmation prompts eliminated; script auto-enables repo via `_enable_cuda_repo` with error handling while maintaining safety checks.
- Split CUDA driver installation into two distinct APT transactions in `nvidia.sh`. Step 1 installs mandatory version pinning (`nvidia-driver-pinning-${ver}`); failure aborts process. Step 2 installs `nvidia-open`, relying on transitive dependencies for firmware rather than explicit package listing.
- Eliminated all Bookworm backports support due to EOL (2026-08-09). Removed `_install_nvidia_bookworm_bpo()`, dead code `install_nvidia_driver()`, and dispatcher logic for Debian 12. Turing now installs standard packages only; Trixie backports remain intact.
- Updated documentation (`docs/gpu.md`) to reflect actual installation flow and removed references to deprecated functions.
This commit is contained in:
stornic56
2026-08-10 17:58:03 -05:00
committed by GitHub
parent 2bcdb511b2
commit dbd2dfca37
4 changed files with 49 additions and 164 deletions
+8 -12
View File
@@ -178,20 +178,16 @@ The NVIDIA driver installation process is inherently complex due to proprietary
- **CUDA Repository Enablement**: On Debian 12 (Bookworm) the `nvidia-cuda` repository is enabled via `extrepo`. On Debian 13 (Trixie) the official `cuda-keyring` package is used instead (`wget` + `dpkg -i`), since extrepo cannot configure the repo correctly on Trixie. After enabling, the script always runs an explicit `apt update`, then installs `nvidia-driver-pinning-<ver>` if available (official NVIDIA pinning, optional), and finally installs the unified metapackage `nvidia-open` plus `firmware-nvidia-gsp`. No manual pinning file is written; if `apt install` fails, the real apt error is shown and the installation aborts. - **CUDA Repository Enablement**: On Debian 12 (Bookworm) the `nvidia-cuda` repository is enabled via `extrepo`. On Debian 13 (Trixie) the official `cuda-keyring` package is used instead (`wget` + `dpkg -i`), since extrepo cannot configure the repo correctly on Trixie. After enabling, the script always runs an explicit `apt update`, then installs `nvidia-driver-pinning-<ver>` if available (official NVIDIA pinning, optional), and finally installs the unified metapackage `nvidia-open` plus `firmware-nvidia-gsp`. No manual pinning file is written; if `apt install` fails, the real apt error is shown and the installation aborts.
#### **Installation Flow** #### **Installation Flow**
```bash The NVIDIA flow is driven by `_install_nvidia_stack` (dispatcher in `modules/gpu.sh`):
if [ "$HAS_NVIDIA" = true ]; then
if [ "$(is_backports_kernel)" == "true" ] && \
{ [ "$DEBIAN_CODENAME" != "trixie" ] || ! is_nvidia_blackwell; }; then
# Warn about DKMS compatibility or use enterprise repo 1. **Plan**`_msg` with detected GPUs, then `_pause`.
offer_nvidia_enterprise_repo 2. **Manage menu** (`_nvidia_manage_menu`): "Install / Change NVIDIA Driver Version" or "Remove NVIDIA Driver and Restore Nouveau".
fi 3. **Version menu** (`_show_nvidia_version_menu`): Debian 12 → v535 (Recommended) / v470 (Kepler); Debian 13 → v550 (Recommended) / v590 / v595 (NVIDIA CUDA Repo).
4. **Dispatch by hardware**: Kepler → `nvidia-tesla-470-driver`; Fermi → veto with message; Turing+ → `_install_nvidia_standard` (Debian stable); Blackwell on Trixie → CUDA repo v590.
5. **CUDA repo (590/595)**: two separate APT transactions — `nvidia-driver-pinning-<ver>` (version lock, mandatory) then `nvidia-open` (driver + open kernel modules, firmware via transitive dependency).
6. **Post-install**: `/etc/modprobe.d/nvidia-wayland.conf` + DKMS verification.
if _confirm "NVIDIA Driver"; then > Note: Debian 12 (Bookworm) backports reached EOL (2026-08-09); the NVIDIA flow on Bookworm only uses the stable repository.
install_nvidia_driver # Installs latest stable (535/550) or v590 for Blackwell
fi
fi
```
--- ---
### 8.**NVIDIA Driver Management & Kernel Compatibility** ### 8.**NVIDIA Driver Management & Kernel Compatibility**
+4 -13
View File
@@ -187,10 +187,7 @@ _install_nvidia_stack() {
plan+="\nPlanned:\n [+] NVIDIA proprietary driver" plan+="\nPlanned:\n [+] NVIDIA proprietary driver"
_msg "NVIDIA Stack — Plan" "$plan" 14 65 _msg "NVIDIA Stack — Plan" "$plan" 14 65
if ! _confirm "NVIDIA Stack" "Install the NVIDIA proprietary driver?"; then _pause "Press Enter to continue..."
echo "Skipping NVIDIA driver installation."
return
fi
NVIDIA_DRIVER_MODE="" NVIDIA_DRIVER_MODE=""
@@ -220,8 +217,6 @@ _install_nvidia_stack() {
_msg "NVIDIA Fermi — Bookworm" \ _msg "NVIDIA Fermi — Bookworm" \
"Fermi GPUs (GF1xx) are not supported\nin Debian 12 (Bookworm).\nThe nvidia-legacy-390xx driver is\nnot available in this version.\n\nNo NVIDIA driver will be installed." "Fermi GPUs (GF1xx) are not supported\nin Debian 12 (Bookworm).\nThe nvidia-legacy-390xx driver is\nnot available in this version.\n\nNo NVIDIA driver will be installed."
NVIDIA_DRIVER_MODE="" NVIDIA_DRIVER_MODE=""
elif [ "$(is_backports_kernel)" = "true" ]; then
_install_nvidia_bookworm_bpo
else else
_install_nvidia_standard _install_nvidia_standard
fi fi
@@ -282,14 +277,10 @@ Only Turing, Ampere, Ada and Blackwell GPUs are supported.\n\n\
No NVIDIA driver will be installed." 14 65 No NVIDIA driver will be installed." 14 65
NVIDIA_DRIVER_MODE="" NVIDIA_DRIVER_MODE=""
else else
if ! _is_cuda_repo_ready; then if ! _enable_cuda_repo; then
if ! _confirm "CUDA Repository" \
"The official NVIDIA CUDA repository is not enabled.\n\n\
Enable it now? (Required for NVIDIA v${NVIDIA_SELECTED_VERSION}.)"; then
echo "Skipping NVIDIA driver installation."
NVIDIA_DRIVER_MODE="" NVIDIA_DRIVER_MODE=""
return _msg "CUDA Repo — Error" "Failed to enable the official NVIDIA CUDA repository.\n\nNo NVIDIA driver was installed." 10 60
fi return 1
fi fi
if _install_nvidia_cuda_repo "$NVIDIA_SELECTED_VERSION"; then if _install_nvidia_cuda_repo "$NVIDIA_SELECTED_VERSION"; then
NVIDIA_DRIVER_MODE="cuda-repo" NVIDIA_DRIVER_MODE="cuda-repo"
+31 -136
View File
@@ -1,64 +1,11 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# NVIDIA GPU driver installation — 3-CASE dispatch # NVIDIA GPU driver installation
# #
# CASE A : Trixie + backports kernel → Official NVIDIA CUDA Repo (Pinned v590) # CASE A : Trixie + backports kernel → Official NVIDIA CUDA Repo (Pinned v590)
# CASE B : Bookworm + backports kernel → Debian backports (-t bookworm-backports) # CASE B : Kernel stable (any distro) → Debian stable
# CASE C : Kernel stable (any distro) → Debian stable (optional backports) #
# Nota: Debian 12 (Bookworm) backports llegaron a EOL (2026-08-09);
# --- DEPRECATED (Replaced by _install_nvidia_stack in gpu.sh) --- # el flujo NVIDIA solo usa el repositorio estable para Debian 12.
install_nvidia_driver() {
echo -e "${YELLOW}NVIDIA GPU detected.${NC}"
NVIDIA_DRIVER_MODE=""
local is_bpo_kernel; is_bpo_kernel=$(is_backports_kernel)
local nv_arch; nv_arch=$(detect_nvidia_arch "$NVIDIA_GPU_DEVICE_ID")
local is_kepler="false"; [[ "$nv_arch" == "legacy" ]] && _is_nvidia_kepler_id "$NVIDIA_GPU_DEVICE_ID" && is_kepler="true"
local is_maxwell; is_maxwell=$(is_nvidia_maxwell)
local is_pascal; is_pascal=$(is_nvidia_pascal)
local is_blackwell; is_blackwell=$(is_nvidia_blackwell)
# ── Blackwell: v550 no soporta GB20x → CUDA repo v590 ──
if [ "$DEBIAN_CODENAME" = "trixie" ] && [ "$is_blackwell" = "true" ]; then
_msg "NVIDIA Blackwell" \
"Your GPU is NVIDIA Blackwell architecture.\n\nDebian 13's nvidia-driver (v550) does not\nsupport Blackwell GPUs.\n\n\
The script will enable the official NVIDIA CUDA\nrepository and install the v590 production branch,\nwhich fully supports Blackwell (GB20x)." 14 65
_install_nvidia_cuda_repo
return
fi
# ── Veto: Kepler en Trixie no tiene driver disponible ──
if [ "$is_kepler" = "true" ] && [ "$DEBIAN_CODENAME" = "trixie" ]; then
_msg "NVIDIA Kepler" \
"Your GPU is NVIDIA Kepler architecture.\n\nThe nvidia-tesla-470 driver is not available\nin Debian 13 (Trixie).\n\nNo NVIDIA driver will be installed." 14 65
return 1
fi
# ── Bloqueo: Maxwell/Pascal no son compatibles con v590 ──
if [ "$DEBIAN_CODENAME" = "trixie" ] && [ "$is_bpo_kernel" = "true" ]; then
if [ "$is_maxwell" = "true" ] || [ "$is_pascal" = "true" ]; then
local gpu_gen="Maxwell"
[ "$is_pascal" = "true" ] && gpu_gen="Pascal"
local block_msg="INCOMPATIBILITY DETECTED: Your NVIDIA ${gpu_gen} GPU\n"
block_msg+="is NOT supported by the modern v590 driver.\n\n"
block_msg+="To run NVIDIA safely on Debian 13 (Trixie), you MUST use\n"
block_msg+="the official Debian v550 driver, which requires the\n"
block_msg+="standard STABLE Kernel.\n\n"
block_msg+="The script will automatically downgrade your path to\n"
block_msg+="Stable Kernel mode for NVIDIA."
_msg "NVIDIA — Trixie + Backports" "$block_msg" 14 70
is_bpo_kernel=false
fi
fi
# ── Dispatch por casos ──
if [ "$DEBIAN_CODENAME" = "trixie" ] && [ "$is_bpo_kernel" = "true" ]; then
_install_nvidia_cuda_repo
elif [ "$DEBIAN_CODENAME" = "bookworm" ] && [ "$is_bpo_kernel" = "true" ]; then
_install_nvidia_bookworm_bpo
else
_install_nvidia_standard
fi
}
# ------------------------------------------------------------------- # -------------------------------------------------------------------
# Shared helper: enable NVIDIA CUDA repo # Shared helper: enable NVIDIA CUDA repo
@@ -272,10 +219,8 @@ _install_nvidia_cuda_repo() {
warn+="the official NVIDIA CUDA repository.\n\n" warn+="the official NVIDIA CUDA repository.\n\n"
warn+="Source: Official NVIDIA CUDA Repo\n" warn+="Source: Official NVIDIA CUDA Repo\n"
warn+="Driver: Production Branch v${ver} (unified metapackage)\n" warn+="Driver: Production Branch v${ver} (unified metapackage)\n"
warn+="[+] nvidia-open (full 64-bit compute + graphics)\n" warn+="[+] nvidia-driver-pinning-${ver} (version lock)\n"
warn+="[+] nvidia-kernel-dkms / nvidia-kernel-open-dkms (vía metapaquete)\n" warn+="[+] nvidia-open (driver + open kernel modules)\n\n"
warn+="[+] firmware-nvidia-gsp\n"
warn+="[+] nvidia-driver-pinning-${ver} (if available)\n\n"
warn+="Do you want to proceed at your own risk?" warn+="Do you want to proceed at your own risk?"
if ! _confirm_custom "NVIDIA Driver — v${ver}" "$warn" "Proceed" "Abort" 18 70; then if ! _confirm_custom "NVIDIA Driver — v${ver}" "$warn" "Proceed" "Abort" 18 70; then
@@ -298,18 +243,30 @@ _install_nvidia_cuda_repo() {
return 1 return 1
fi fi
# Step 3: Pinning oficial de NVIDIA (instalar si existe; el repo no # Step 3: Pinning oficial — transacción APT INDEPENDIENTE y
# siempre lo publica). Su fallo no debe romper el flujo. # obligatoria. APT lee /etc/apt/preferences.d/ al inicio de su
sudo apt install -y "nvidia-driver-pinning-${ver}" >/dev/null 2>&1 || true # ejecución, no durante la transacción: el pinning debe estar
# instalado ANTES de instalar el driver. Si el repo no lo publica,
# Step 4: Instalar el metapaquete. Si falla, el error real de apt # es un problema del repo de NVIDIA: abortar limpiamente en vez de
# ya quedó visible arriba (output de _run_cmd) — no abortar antes # instalar una versión que el usuario no eligió.
# de intentar la instalación. if ! _run_cmd "NVIDIA Pinning" \
if ! _run_cmd "NVIDIA CUDA" \ "sudo apt install -y nvidia-driver-pinning-${ver}" \
"sudo apt install -y nvidia-open firmware-nvidia-gsp" \ "Installing NVIDIA version pinning (${ver})..."; then
"Installing NVIDIA v${ver} production driver via unified metapackage..."; then
NVIDIA_DRIVER_MODE="" NVIDIA_DRIVER_MODE=""
_msg "NVIDIA — Error" "NVIDIA v${ver} installation FAILED.\n\nCheck the apt error above.\n\nNo NVIDIA driver was installed." 10 60 _msg "NVIDIA — Error" "Failed to install NVIDIA driver pinning ${ver}.\n\nNo NVIDIA driver was installed." 10 60
return 1
fi
# Step 4: Instalar el metapaquete (pinning ya activo). Si falla,
# el pinning queda instalado (solo config, no es problema).
# firmware-nvidia-gsp llega como dependencia transitiva obligatoria
# (nvidia-open → nvidia-kernel-open-dkms → firmware-nvidia-gsp),
# alineado con la doc oficial: apt -V install nvidia-open.
if ! _run_cmd "NVIDIA CUDA" \
"sudo apt install -y nvidia-open" \
"Installing NVIDIA driver from CUDA repository..."; then
NVIDIA_DRIVER_MODE=""
_msg "NVIDIA — Error" "NVIDIA driver installation FAILED.\n\nNo NVIDIA driver was installed." 10 60
return 1 return 1
fi fi
@@ -328,47 +285,6 @@ _install_nvidia_cuda_repo() {
_verify_nvidia_dkms_build nvidia-kernel-open-dkms nvidia-kernel-dkms || true _verify_nvidia_dkms_build nvidia-kernel-open-dkms nvidia-kernel-dkms || true
} }
# -------------------------------------------------------------------
# CASE B: Bookworm + Backports Kernel → Debian backports
# -------------------------------------------------------------------
_install_nvidia_bookworm_bpo() {
local nv_pkg=""
local is_kepler
is_kepler=$(is_nvidia_kepler)
if [ "$is_kepler" = "true" ]; then
nv_pkg="nvidia-tesla-470-driver"
else
# Backports de Bookworm solo tienen el módulo cerrado
nv_pkg="nvidia-driver"
fi
local nv_ver
nv_ver=$(apt-cache policy "$nv_pkg" 2>/dev/null | awk 'NR==3 {print $2; exit}') || true
local msg="Source: Debian Bookworm-Backports\n"
msg+="NVIDIA Driver: ${nv_pkg} ${nv_ver:-unknown}\n"
msg+=" (Compatible with Kernel v6.12+)\n"
msg+="[+] firmware-misc-nonfree\n"
msg+="[+] nvidia-vaapi-driver"
if ! _confirm "NVIDIA Driver — Backports" "$msg" 14 70; then
echo "Skipping NVIDIA driver installation."
return 0
fi
if ! _run_cmd "NVIDIA" "sudo apt install -y -t bookworm-backports $nv_pkg firmware-misc-nonfree nvidia-vaapi-driver" \
"Installing NVIDIA driver from backports..."; then
NVIDIA_DRIVER_MODE=""
_msg "NVIDIA — Error" "NVIDIA backports installation FAILED.\n\nNo NVIDIA driver was installed." 10 60
return 1
fi
NVIDIA_DRIVER_MODE="backports"
echo -e "${GREEN}NVIDIA driver installed from backports. Reboot required.${NC}"
_verify_nvidia_dkms_build nvidia-kernel-dkms nvidia-tesla-470-kernel-dkms || true
}
# ------------------------------------------------------------------- # -------------------------------------------------------------------
# Bookworm Kepler intercepción — fuerza nvidia-legacy-470xx-driver # Bookworm Kepler intercepción — fuerza nvidia-legacy-470xx-driver
# ------------------------------------------------------------------- # -------------------------------------------------------------------
@@ -404,27 +320,6 @@ _install_nvidia_bookworm_kepler() {
return 1 return 1
fi fi
# Si backports está habilitado, ofrecer actualización
if [ "$(is_backports_enabled)" == "true" ]; then
local bpo_ver
bpo_ver=$(apt-cache madison "$nv_pkg" 2>/dev/null | \
grep "bookworm-backports" | awk '{print $3}' | head -1) || true
if [ -n "$bpo_ver" ]; then
local msg="Hay una versión en backports: ${bpo_ver}\n"
msg+="Instalar desde bookworm-backports?"
if _confirm "Kepler Backports" "$msg"; then
if _run_cmd "NVIDIA Kepler" \
"sudo apt install -y -t bookworm-backports $nv_pkg" \
"Actualizando Kepler driver desde backports..."; then
NVIDIA_DRIVER_MODE="backports"
echo -e "${GREEN}Kepler driver actualizado desde backports.${NC}"
else
echo -e "${RED}Kepler backports upgrade failed — keeping the stable version.${NC}"
fi
fi
fi
fi
NVIDIA_DRIVER_MODE="${NVIDIA_DRIVER_MODE:-stable}" NVIDIA_DRIVER_MODE="${NVIDIA_DRIVER_MODE:-stable}"
echo -e "${GREEN}Kepler driver (${nv_pkg}) installed. Reboot required.${NC}" echo -e "${GREEN}Kepler driver (${nv_pkg}) installed. Reboot required.${NC}"
@@ -432,7 +327,7 @@ _install_nvidia_bookworm_kepler() {
} }
# ------------------------------------------------------------------- # -------------------------------------------------------------------
# CASE C: Kernel stable (any distro) → Debian stable # CASE B: Kernel stable (any distro) → Debian stable
# ------------------------------------------------------------------- # -------------------------------------------------------------------
_install_nvidia_standard() { _install_nvidia_standard() {
# --- 1. ARQUITECTURA → MÓDULO KERNEL --- # --- 1. ARQUITECTURA → MÓDULO KERNEL ---
+3
View File
@@ -492,6 +492,9 @@ get_intel_generation() {
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
# Check if backports repository is enabled (active line without #) # Check if backports repository is enabled (active line without #)
# Nota: el flujo NVIDIA Debian 12 (Bookworm) ya NO usa esta función
# (backports EOL 2026-08-09). Sigue activa para kernels, desktop/greetd,
# gaming, audio, comunicación y Mesa (AMD/Intel).
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
is_backports_enabled() { is_backports_enabled() {
local codename="${DEBIAN_CODENAME:-}" local codename="${DEBIAN_CODENAME:-}"