import type { Metadata } from "next" import { getTranslations, getMessages, setRequestLocale } from "next-intl/server" import { Link } from "@/i18n/navigation" import Image from "next/image" import { ExternalLink } from "lucide-react" import { DocHeader } from "@/components/ui/doc-header" import { Callout } from "@/components/ui/callout" import { Prerequisites } from "@/components/ui/prerequisites" import { Steps } from "@/components/ui/steps" import CopyableCode from "@/components/CopyableCode" export async function generateMetadata({ params, }: { params: Promise<{ locale: string }> }): Promise { const { locale } = await params const t = await getTranslations({ locale, namespace: "docs.hardware.nvidiaHost.meta" }) return { title: t("title"), description: t("description"), } } type MatrixRow = { kernel: string; pve: string; minCode: string; minTail: string } type StringItem = string type RelatedItem = { label: string; href: string; tail?: string } export default async function NvidiaHostPage({ params, }: { params: Promise<{ locale: string }> }) { const { locale } = await params setRequestLocale(locale) const t = await getTranslations({ locale, namespace: "docs.hardware.nvidiaHost" }) const messages = (await getMessages({ locale })) as unknown as { docs: { hardware: { nvidiaHost: { walkthrough: { version: { rows: MatrixRow[] } prepare: { items: StringItem[] } } reinstallUninstall: { uninstallItems: StringItem[] } updates: { kindsItems: StringItem[] } related: { items: RelatedItem[] } } } } } const matrixRows = messages.docs.hardware.nvidiaHost.walkthrough.version.rows const prepareItems = messages.docs.hardware.nvidiaHost.walkthrough.prepare.items const uninstallItems = messages.docs.hardware.nvidiaHost.reinstallUninstall.uninstallItems const kindsItems = messages.docs.hardware.nvidiaHost.updates.kindsItems const relatedItems = messages.docs.hardware.nvidiaHost.related.items const code = (chunks: React.ReactNode) => {chunks} const strong = (chunks: React.ReactNode) => {chunks} const em = (chunks: React.ReactNode) => {chunks} const persistLink = (chunks: React.ReactNode) => ( {chunks} ) const patchLink = (chunks: React.ReactNode) => ( {chunks} ) const patchTableLink = (chunks: React.ReactNode) => ( {chunks} ) const guideLink = (chunks: React.ReactNode) => ( {chunks} ) return (
{t.rich("intro.body", { code })}

{t("who.heading")}

{t.rich("who.body", { strong, em })}

{t.rich("prereqs.gpu", { strong })}, check: t("prereqs.gpuCheck") }, { label: <>{t.rich("prereqs.notVm", { strong })} }, { label: <>{t.rich("prereqs.internet", { code })} }, { label: <>{t.rich("prereqs.space", { strong, code })} }, ]} /> {t.rich("vmWarn.body", { code })}

{t("running.heading")}

{t.rich("running.body", { strong })}

{t("running.imageAlt")}

{t("howRuns.heading")}

{t("howRuns.body")}

{`┌─────────────────────────────────────────────┐
│  PHASE 1 — Detect, validate, pick version   │
│  (nothing touched yet)                      │
└──────────────────┬──────────────────────────┘
                   ▼
      ┌────────────┴────────────┐
      ▼                         ▼
  lspci detects             GPU bound to
  NVIDIA GPU(s)             vfio-pci? ──→ Abort
      │                         │        (remove VM
      │                         No        passthrough first)
      ▼
  nvidia-smi: driver already installed?
      │
      ├─ No  → continue (fresh install)
      └─ Yes → ask: Reinstall/Update  OR  Remove
                     │
                     ├─ Remove    → complete uninstall
                     │               + reboot prompt
                     └─ Reinstall → continue
      │
      ▼
  Show install overview
  (GPU list + current driver +
   LXC containers with NVIDIA passthrough)
      │
      ▼
  Kernel-compat filter:
  ├─ Kernel 6.17+   → driver 580.82.07+
  ├─ Kernel 6.8–16  → driver 550+
  ├─ Kernel 6.2–7   → driver 535+
  └─ Kernel 5.15+   → driver 470+
      │
      ▼
  User picks version (or "Latest")
                   │
     ┌─────── Cancel   OR   Confirm ────┐
     ▼                                  ▼
 Exit, nothing            ┌─────────────┴──────────────┐
 was changed              │  PHASE 2 — Install driver  │
                          └─────────────┬──────────────┘
                                        ▼
                          Prepare host:
                          ├─ Install pve-headers-$(uname -r)
                          ├─ Install build-essential + dkms
                          ├─ Blacklist nouveau + unload
                          │  └ /etc/modprobe.d/nouveau-blacklist.conf
                          ├─ Write modules-load config
                          │  └ /etc/modules-load.d/nvidia-vfio.conf
                          ├─ Stop/disable nvidia services
                          └─ Unload residual nvidia modules

                          If different version already present:
                          └─ clean uninstall first (apt purge,
                             remove DKMS entries)
                                        │
                                        ▼
                          Download NVIDIA .run installer
                          to /opt/nvidia (validate size +
                          executable signature)
                                        │
                                        ▼
                          Run installer with --dkms
                          --disable-nouveau --no-nouveau-check
                                        │
                                        ▼
                          Install udev rules
                          └─ /etc/udev/rules.d/70-nvidia.rules
                          + clone NVIDIA/nvidia-persistenced
                                        │
                                        ▼
                          update-initramfs -u -k all
                                        │
                                        ▼
                          nvidia-smi — verify driver loaded
                                        │
                        ┌───────────────┴───────────────┐
                        │  PHASE 3 — Optional extras    │
                        └───────────────┬───────────────┘
                                        ▼
                          LXC containers with NVIDIA?
                          ├─ Yes → offer driver propagation
                          │        (Alpine: apk · Arch: pacman ·
                          │         Debian/others: extract .run)
                          └─ No  → skip
                                        │
                                        ▼
                          keylase/nvidia-patch (NVENC limit)?
                          ├─ Yes → clone + apply
                          └─ No  → skip
                                        │
                                        ▼
                          Reboot prompt — required to finalize
                          nouveau blacklist + load new module`}
      

{t.rich("walkthrough.detect.body1", { em })}

{t("walkthrough.detect.body2")}

{t("walkthrough.detect.imageAlt")}

{t.rich("walkthrough.version.body1", { strong, em })}

{t("walkthrough.version.body2")}

{matrixRows.map((row, idx) => ( ))}
{t("walkthrough.version.headerKernel")} {t("walkthrough.version.headerPve")} {t("walkthrough.version.headerMin")}
{row.kernel} {row.pve} {row.minCode}{row.minTail}
{t("walkthrough.version.whyBody")} {t("walkthrough.version.imageAlt")}

{t.rich("walkthrough.uninstall.body", { code })}

{t("walkthrough.prepare.body")}

    {prepareItems.map((_, idx) => (
  • {t.rich(`walkthrough.prepare.items.${idx}`, { code })}
  • ))}

{t.rich("walkthrough.download.body", { code })}

.run \\ --no-questions \\ --ui=none \\ --disable-nouveau \\ --no-nouveau-check \\ --dkms`} className="my-4" /> {t("walkthrough.download.imageAlt")}

{t.rich("walkthrough.persist.body", { code, persistLink })}

{t.rich("walkthrough.nvenc.body", { strong, patchLink })}

{t.rich("walkthrough.nvenc.supportBody", { patchTableLink })}

{t.rich("walkthrough.propagate.body1", { code, strong })}

{t.rich("walkthrough.propagate.body2", { code })}

{t("walkthrough.propagate.imageAlt")}

{t.rich("walkthrough.reboot.body", { code, strong })}

{t("reinstallUninstall.heading")}

{t.rich("reinstallUninstall.intro", { code })}

{t("reinstallUninstall.imageAlt")}
{t("reinstallUninstall.imageCaption")}

{t("reinstallUninstall.reinstallHeading")}

{t("reinstallUninstall.reinstallBody")}

{t("reinstallUninstall.uninstallHeading")}

{t("reinstallUninstall.uninstallIntro")}

    {uninstallItems.map((_, idx) => (
  • {t.rich(`reinstallUninstall.uninstallItems.${idx}`, { code })}
  • ))}
{t("reinstallUninstall.lxcWarnBody")}

{t("updates.heading")}

{t.rich("updates.body", { code })}

{t("updates.kindsHeading")}

    {kindsItems.map((_, idx) => (
  • {t.rich(`updates.kindsItems.${idx}`, { strong })}
  • ))}
{t("updates.antiBody")} {t.rich("updates.applyBody", { strong })}

{t("verify.heading")}

{t("verify.intro")}

{t("verify.after")}

{t("verify.imageAlt")}

{t("troubleshoot.heading")}

{t.rich("troubleshoot.smiFailBody", { strong, code })} {t.rich("troubleshoot.lxcMissBody", { code })} {t.rich("troubleshoot.logBody", { code })}

{t("manualSteps.heading")}

{t.rich("manualSteps.body", { code, guideLink })}

{t("related.heading")}

    {relatedItems.map((item) => (
  • {item.label} {item.tail}
  • ))}
) }