From 4fb19f25be2b760d089182b6b7b94b96f4137fba Mon Sep 17 00:00:00 2001 From: Raphael Glon Date: Fri, 5 Apr 2024 17:56:50 +0200 Subject: [PATCH] Regenerate ld.so.cache This file is mandatory for programs to know where to look where to find dynamic linked libraries The problem arise within containers that add .so files to the container during the OCR definition If we consider nvidia-container-runtim, these .so for example concern cuda libs, nvidia drivers, so that the versions on both the host and the guest/container are consistent, to avoid version conflict as much as possible, and provide additional tools, like nvidia-smi, by default) If ldconfig is not run as a precommand then the latest added libs are not cached This does not happen with the nvidia-container-runtime because it runs ldconfig Looks like for some reason the GKE container runtime does not The provided command should be enough to fix most issues Signed-off-by: Raphael Glon --- launcher/src/main.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/launcher/src/main.rs b/launcher/src/main.rs index 63676392..aef09433 100644 --- a/launcher/src/main.rs +++ b/launcher/src/main.rs @@ -1209,6 +1209,16 @@ fn terminate(process_name: &str, mut process: Child, timeout: Duration) -> io::R } fn main() -> Result<(), LauncherError> { + match Command::new("ldconfig").spawn() { + Ok(_) => {} + Err(err) => { + tracing::warn!( + "Unable to refresh ldconfig cache. Skipping (useless in most cases). Details {:?}", + err + ) + } + } + // Pattern match configuration let args: Args = Args::parse();