From 1f2f2c8b72b51e2dc47009342d2d5e5a7e7cb5d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= Date: Sun, 14 Jun 2026 17:09:23 +0200 Subject: [PATCH] fixup! build: split NVIDIA rootfs into base-nvidia image + gpu addon --- .../rootfs-builder/nvidia/nvidia_rootfs.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/tools/osbuilder/rootfs-builder/nvidia/nvidia_rootfs.sh b/tools/osbuilder/rootfs-builder/nvidia/nvidia_rootfs.sh index 5d6a7984c6..ab745861d8 100644 --- a/tools/osbuilder/rootfs-builder/nvidia/nvidia_rootfs.sh +++ b/tools/osbuilder/rootfs-builder/nvidia/nvidia_rootfs.sh @@ -464,6 +464,17 @@ partition_gpu_addon() { done [[ -e lib/libgrpc_mgr.so ]] && cp -a lib/libgrpc_mgr.so "${addon}/lib/" + # Materialize the SONAME symlinks (e.g. libcuda.so.1 -> libcuda.so.595.58.03) + # inside the flattened lib dir. The addon ships only the versioned files, so + # without this `nvidia-ctk cdi generate` has no symlink to replicate into the + # container (it reproduces existing links, it does not synthesize SONAMEs) and + # the container can't resolve libcuda.so.1 -> it then falls back to the image's + # older cuda-compat libcuda and CUDA fails with "driver version is insufficient + # for CUDA runtime version". `ldconfig -n` only creates the versioned symlinks + # in the given dir (no cache, no chroot), which is all the loader-less addon + # needs. The monolith gets the same links via the `chroot . ldconfig` below. + ldconfig -n "${addon}/lib" + # GPU configs (fabricmanager.cfg, nvlsm.conf, ...). [[ -d usr/share/nvidia ]] && cp -a usr/share/nvidia/. "${addon}/usr/share/nvidia/" @@ -661,7 +672,8 @@ setup_nvidia_gpu_rootfs_stage_two() { compress_rootfs # The gpu addon has no loader/ldconfig of its own; its libraries are found - # via NVRC's LD_LIBRARY_PATH, so skip the ld.so cache rebuild there. + # via NVRC's LD_LIBRARY_PATH, so skip the ld.so cache rebuild there. Its + # SONAME symlinks are created with `ldconfig -n` in partition_gpu_addon(). [[ "${layout}" != "gpu-addon" ]] && chroot . ldconfig popd >> /dev/null