| name | ubuntu-nvidia-gpu-enablement |
| description | Enable NVIDIA GPUs on a Ubuntu server for compute/inference serving โ install the open-kernel-module driver (required for Blackwell/Hopper), CUDA toolkit, turn on IOMMU (intel_iommu=on iommu=pt), set up nvidia-persistenced, and install/wire a container runtime (Docker + nvidia-container-toolkit, or the minimal CLI), then verify all GPUs, IOMMU groups, P2P, nvcc, and GPU containers. Use when asked to enable or set up NVIDIA GPUs, install the NVIDIA driver + CUDA on Ubuntu, install Docker + nvidia-container-toolkit for GPU containers, configure GPU IOMMU/passthrough, prepare a host for GPU serving (vLLM/PyTorch/TensorRT/NIM), or troubleshoot nouveau, persistence mode, GPU-in-container, or driver/CUDA/glibc problems. |
Ubuntu NVIDIA GPU Enablement
Bring a fresh UEFI Ubuntu server with NVIDIA GPUs to a serving-ready state. Order matters:
driver โ IOMMU cmdline โ CUDA โ persistence โ container access โ verify. Driver and cmdline changes
each need a reboot โ batch them (Steps 1 + 2 reboot together).
Run as a sudo user (over SSH is fine). REFERENCE.md holds the why, GRUB/AMD variants,
and troubleshooting. Boot-affecting steps are deliberate โ keep BMC/console access as a fallback.
Pre-flight
- UEFI:
[ -d /sys/firmware/efi ].
- Secure Boot:
mokutil --sb-state. If enabled, DKMS modules need MOK enrollment at the console โ plan
for it or disable SB. (Off is typical with a custom bootloader; verify, don't assume.)
- GPUs present:
sudo apt-get install -y pciutils && lspci -nn | grep -i nvidia. Note the architecture.
- Bootloader = GRUB or ZFSBootMenu? (decides where the cmdline lives โ Step 2.)
- Egress to
archive.ubuntu.com (+ nvidia.github.io for the container repo).
Step 1 โ Driver (OPEN kernel module)
sudo apt-get update
sudo apt-get install -y nvidia-driver-580-server-open
- Blackwell requires the open modules (proprietary won't support it); Hopper too. Pick the right branch
with
ubuntu-drivers devices. Datacenter / "Server Edition" cards โ nvidia-driver-<ver>-server-open.
- Auto-blacklists nouveau; needs a reboot (do it with Step 2).
- Fabric Manager is only for NVLink/NVSwitch systems โ skip it if your GPUs have no NVLink.
Step 2 โ IOMMU kernel cmdline
Add intel_iommu=on iommu=pt (AMD: amd_iommu=on iommu=pt). iommu=pt = passthrough/identity DMA:
~zero bare-metal cost and preserves GPU P2P (full translation can disable P2P โ NCCL falls back to SHM).
Step 3 โ CUDA toolkit
sudo apt-get install -y cuda-toolkit
Step 4 โ Persistence
sudo systemctl enable --now nvidia-persistenced
Step 5 โ Container access (optional)
5a โ Container engine. The toolkit only wires an existing engine, so install one first. Docker's
official docker-ce repo lags new Ubuntu releases by months โ if it has no suite for your codename
(curl -fsI download.docker.com/linux/ubuntu/dists/$(. /etc/os-release; echo $VERSION_CODENAME)/Release
โ 404/000, e.g. 26.04 resolute), install Ubuntu's own docker.io (current โ 26.04 ships Docker 29.x).
Both provide docker + the nvidia runtime hook.
sudo apt-get install -y docker.io
sudo usermod -aG docker "$USER"
5b โ NVIDIA repo + toolkit. Add the repo (REFERENCE ยง5), then EITHER:
5c โ Verify the GPU reaches a container:
sudo docker run --rm --gpus all -e NVIDIA_DRIVER_CAPABILITIES=all ubuntu:24.04 nvidia-smi -L
NVIDIA_DRIVER_CAPABILITIES=all is what injects nvidia-smi/CUDA libs โ --gpus all selects the GPUs but
caps decide the userspace, so bare --gpus all can return "executable not found". CDI path (Podman, or
Docker โฅ 25): nvidia-ctk cdi list; run with --device nvidia.com/gpu=all.
Step 6 โ BIOS (max serving perf / passthrough)
Generic GPU-serving profile: Above-4G + Resize BAR on, Performance power/EPP, disable deep
C-states / C1E-promotion / ASPM, SR-IOV on (for VM passthrough), VT-d/IOMMU available, ACS off for fast
bare-metal P2P (flip on only when isolating GPUs for VFIO), Sub-NUMA Clustering off. Full table in REFERENCE ยง6.
For ASUS ESC8000-E12P exact attribute tokens + apply/verify, use the asus-esc8000-gpu-bios-tuning skill.
Verify (final)
nvidia-smi
cat /proc/driver/nvidia/version
cat /proc/cmdline
sudo dmesg | grep -iE 'DMAR|IOMMU'
ls /sys/kernel/iommu_groups | wc -l
nvidia-smi topo -p2p r
systemctl is-enabled nvidia-persistenced
bash -lc 'nvcc --version'