Leaving unattended-upgrades enabled on GPU nodes
Automatic apt upgrades bump libnvidia-ml on disk while the old nvidia.ko stays in RAM, breaking every new job with NVML version mismatch.
Operator task guide
Both CUDA driver version is insufficient for CUDA runtime version and Failed to initialize NVML: Driver/library version mismatch come from host driver vs user-space or container library drift. Unattended apt kernel/driver upgrades leave an older nvidia.ko module loaded in memory alongside newly installed user-space libraries, or a container bundles a CUDA runtime newer than the host driver.
Check the loaded kernel driver version (/proc/driver/nvidia/version) against user-space tools and container CUDA tags first. Reboot only to load a freshly upgraded kernel module, or match your container CUDA tag (or NVIDIA forward compatibility package) to the host driver.
Reviewed . Reference guidance is not a diagnosis of your workload.
Read /proc/driver/nvidia/version directly so you see the driver currently running in the kernel even when nvidia-smi itself fails with NVML Driver/library version mismatch.
cat /proc/driver/nvidia/version
dpkg -l | grep -E 'nvidia-driver|libnvidia-ml|cuda-compat'
nvidia-smiIf apt upgraded libnvidia-compute/nvidia-utils in the background while the old nvidia kernel module remained loaded, either hold unattended NVIDIA updates and reboot on a maintenance window, or reload unused kernel modules if zero GPU processes are active.
# Inspect what updated recently in apt history
grep -i nvidia /var/log/dpkg.log | tail -n 20
# Prevent unexpected live driver drift on Ubuntu servers:
sudo apt-mark hold nvidia-driver-* nvidia-dkms-* libnvidia-compute-*Match the host driver minimum table for your container CUDA runtime version, or mount NVIDIA forward compatibility (cuda-compat) when upgrading host drivers is blocked.
docker run --rm --gpus all nvidia/cuda:12.6.0-base-ubuntu24.04 nvidia-smi
# Check NVIDIA Container Toolkit CDI / runtime config
nvidia-ctk --version
sudo systemctl restart dockerWhen nvidia-smi reports No devices were found, check PCIe enumeration (lspci | grep -i nvidia), dmesg module load errors (Secure Boot unsigned module, missing kernel headers, or open vs proprietary kernel module mismatch on Ada/Hopper/Blackwell).
lspci -nn | grep -i nvidia
dmesg -T | grep -iE 'NVRM|nvidia|secureboot|module verification' | tail -n 30| Signal | What it means | Next action |
|---|---|---|
| Failed to initialize NVML: Driver/library version mismatch | Kernel nvidia.ko version disagrees with user-space libnvidia-ml.so. | Compare /proc/driver/nvidia/version vs dpkg, reload modules or reboot in maintenance window. |
| CUDA driver version is insufficient for CUDA runtime version | Host NVIDIA driver is older than the container CUDA runtime. | Upgrade host driver, pick matching container tag, or configure cuda-compat. |
| No devices were found on Ubuntu 24.04 | Kernel driver failed to bind GPU (Secure Boot, open/proprietary mismatch, or PCIe drop). | Check lspci and dmesg for NVRM init errors or Xid 79 / open-kernel requirement. |
| nvidia-container-toolkit: failed to initialize NVML: unknown error | Container runtime cgroup/systemd driver tracking or stale library mount. | Check nvidia-ctk config (no-cgroups / CDI) and restart containerd or docker. |
Automatic apt upgrades bump libnvidia-ml on disk while the old nvidia.ko stays in RAM, breaking every new job with NVML version mismatch.
Verify NVIDIA driver open vs proprietary support for your exact GPU generation.
The host kernel driver ceiling applies to every container unless forward compatibility is explicitly configured.
Step-by-step driver vs runtime compatibility table.
Fix kernel module, Secure Boot, and PCIe enumeration failures.
Verify driver, CUDA toolkit, and PyTorch alignment.
Fix nvidia-container-toolkit and CDI mounts.
An automatic package update upgraded the NVIDIA user-space libraries on disk while the previous NVIDIA kernel module remained loaded in RAM. Rebooting or cleanly unloading and reloading NVIDIA kernel modules resolves the mismatch; use apt-mark hold to stop recurrence.
Either upgrade the NVIDIA driver on the host OS, switch to a container built against an older CUDA toolkit matching your host driver, or install the matching cuda-compat package inside the container.
Common causes are Secure Boot blocking unsigned DKMS kernel modules, missing linux-headers for the active kernel, or needing nvidia-driver-open modules on newer GPU generations.
Frequently systemd cgroup driver reload issues after a Docker/containerd upgrade. Regenerate the CDI spec or set no-cgroups=false cleanly and restart Docker/containerd.
Get the likely cause, supporting evidence, and next safe steps with the same cloud reasoning used by paid plans. A crash the engine recognizes is answered in seconds, then checked by an independent AI review that updates this page when it finishes. A crash it does not recognize waits for the AI's own answer, which can take a few minutes. No account, card, or installation. Logs are masked at Denpex API ingress and are not saved to account history.
Before uploading, review cloud data handling and local options.
Upload your log file. Large files are processed in your browser. Only selected evidence is submitted when you run diagnosis.
No credit card. No automatic subscription. See whether Denpex helps with an incident you already understand.
Up to 50 diagnoses a day for 30 days. Verify your work email to activate an eligible company evaluation, then replay a resolved incident and compare the evidence and next steps with your team's confirmed cause.
Use the three free diagnoses to review your error and relevant evidence. Keep reference guidance separate from the cause and recovery status of your own workload.
Diagnose your incident