fix: load kernel modules via host kmod on non-container OS - #37
Merged
BSWANG merged 1 commit intoJul 23, 2026
Merged
Conversation
modprobe/rmmod for erdma, smc and nvidia-peermem were run inside the agent container via containerExec. The container's kmod (e.g. Alibaba Linux 8, kmod-25, only +XZ +ZLIB) cannot decompress ZSTD-compressed modules shipped by newer hosts (e.g. Ubuntu 24.04, kmod +ZSTD), so loading a host-built .ko.zst failed with: modprobe: ERROR: could not insert 'erdma': Exec format error The module files live in the host's /lib/modules (a hostPath mount) and load into the shared host kernel, so they must be decompressed by the host kmod. Route all module operations through a new moduleExec() helper that uses hostExec on a regular OS and containerExec on a container-optimized OS (lifsea, which already runs with host userspace). This also aligns the load step with the install step, which already ran on the host via hostExec for non-container OS, and collapses the duplicated host/container selection in the OFED driver into moduleExec().
BSWANG
force-pushed
the
fix/modprobe-on-host-zstd
branch
from
July 23, 2026 16:34
8888bc0 to
3b3b7e6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On nodes whose host kmod is newer than the agent container's,
modprobe erdmafails with:Root cause: module load (
modprobe/rmmodforerdma,smc,nvidia-peermem) ran inside the agent container viacontainerExec. The container's kmod (e.g. Alibaba Linux 8,kmod-25,+XZ +ZLIBonly) cannot decompress ZSTD-compressed modules shipped by newer hosts (e.g. Ubuntu 24.04,kmodwith+ZSTD). The module files live in the host's/lib/modules(a hostPath mount) and load into the shared host kernel, so they must be decompressed by the host kmod.Fix
Add a
moduleExec()helper that selects the exec context for kernel-module operations:hostExec(enters host mount/cgroup namespaces viansenter, using the host's ZSTD-capable kmod)containerExecRoute
modprobe erdma,EnsureSMCR(modprobe smc) and nvidia-peermem loading through it in thedefault,compatandofeddrivers.This also:
hostExecfor non-container OS;moduleExec().No new privileges are required —
hostExec(nsenter -t 1,hostPID,SYS_ADMIN, hostPath/lib/modules) was already used by the install step and the OFED driver on these same nodes.Test
GOOS=linux/GOOS=darwinbuild,go vet, andgo test ./internal/drivers/all pass.