﻿# Match a GPU kernel module to the running kernel

Compare the selected module with the running kernel build contract, and distinguish version mismatch from signature rejection.

Author: Retrivium editorial team
Updated: 2026-11-03
Canonical URL: https://retrivium.ai/journal/guide-linux-kernel-module-vermagic/
Language: en

After a kernel update, a previously installed GPU module fails to load. The installed package version is only one part of the evidence. External modules must match the kernel build contract, and the module's version magic records relevant release and configuration information. Read the actual running kernel and selected module before changing anything.

## Compare running and installed kernels

Record the running release rather than assuming the newest installed package is currently booted. Identify the module file selected for that kernel and its build metadata. A module present under another release's directory is not proof of readiness for the running system. Preserve the original load error before a reboot or package operation changes the investigated state.

## Interpret version magic narrowly

The upstream definition combines the kernel release with relevant build configuration and architecture information. Compare the module's reported value with the intended kernel build. A mismatch supports an incompatibility diagnosis, but matching text alone does not certify every symbol and configuration requirement. Do not treat a version string as a complete ABI test.

## Verify the build prerequisites

The external-module build documentation requires the corresponding kernel configuration and headers. NVIDIA's guide likewise calls for packages matching the running kernel when building its driver. A generic latest headers package can refer to a different release. Check the actual build output and supported packaging path instead of assuming installation success means every installed kernel received a usable module.

## Keep signature rejection separate

Module signature verification is a distinct admission boundary. A compatible build can still be rejected under the configured trust policy. Preserve the specific kernel error and trust evidence instead of rebuilding repeatedly for a signing problem. Do not remove version or signature checks as a diagnostic shortcut; that changes the protection boundary without establishing module correctness.

## Define reviewable recovery evidence

An isolated maintenance fixture can compare the chosen kernel, matching build inputs, module identity and documented load result before a bounded device check. Acceptance means the selected module is admitted and the intended device path works in that fixture. It does not guarantee every GPU workload, authorize live module replacement or prove that future kernel updates will rebuild and select the right module automatically.

## Primary references

[Linux Module Version Magic Definition](https://raw.githubusercontent.com/torvalds/linux/master/include/linux/vermagic.h).

[Linux External Module Build Contract](https://docs.kernel.org/kbuild/modules.html).

[NVIDIA Driver Kernel Prerequisites](https://docs.nvidia.com/datacenter/tesla/driver-installation-guide/latest/pre-installation-actions.html).

[Linux Module Signature Verification](https://docs.kernel.org/admin-guide/module-signing.html).

Related reading: [Reproducible inference stacks: preserving a GPU pilot’s result](/journal/software-stack-reproducibility/); [GPU containers or virtual machines: what to check before deployment](/journal/gpu-containers-vs-vms/).
