From 0fae50971d75344d2de54d4ae1385aceb67155bb Mon Sep 17 00:00:00 2001 From: Ayush Ranjan Date: Mon, 7 Oct 2024 11:22:26 -0700 Subject: [PATCH] Register container name with kernel before Loader.createContainerProcess(). Loader.createContainerProcess() => createDeviceFiles() calls devutil.GoferClientFromContext() when using nvidia-container-runtime-hook. devutil.GoferClientFromContext() expects `Kernel.containerNames` map to be initialized with the current container's ID -> name mapping. However, for sub-containers we were not initializing this map before Loader.createContainerProcess(). This change fixes that. We hadn't hit this yet because we never had multi-container usages of nvidia-container-runtime-hook. Updates #10997 PiperOrigin-RevId: 683256638 --- runsc/boot/loader.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runsc/boot/loader.go b/runsc/boot/loader.go index aefd82fb0..01ae8d261 100644 --- a/runsc/boot/loader.go +++ b/runsc/boot/loader.go @@ -1023,6 +1023,7 @@ func (l *Loader) startSubcontainer(spec *specs.Spec, conf *config.Config, cid st } containerName := l.registerContainerLocked(spec, cid) + l.k.RegisterContainerName(cid, containerName) info := &containerInfo{ cid: cid, containerName: containerName, @@ -1091,7 +1092,6 @@ func (l *Loader) startSubcontainer(spec *specs.Spec, conf *config.Config, cid st }) } - l.k.RegisterContainerName(cid, info.containerName) l.k.StartProcess(ep.tg) // No more failures from this point on. cu.Release()