From f8141aab274a850c8f56dab3a5984f12cf300ff9 Mon Sep 17 00:00:00 2001 From: Evan Lezar Date: Fri, 20 Sep 2024 14:35:20 +0200 Subject: [PATCH] Skip explicit creation of libnvidia-allocator.so.1 symlink Since we expect .so.1 symlinks to be created by ldconfig, we don't explicitly request these. This change removes the creation of a libnvidia-allocator.so.1 -> libnvidia-allocator.so.RM_VERSION symlink through the create-symlinks hook. Signed-off-by: Evan Lezar --- internal/discover/graphics.go | 8 ++++---- internal/discover/graphics_test.go | 2 -- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/internal/discover/graphics.go b/internal/discover/graphics.go index e87f85c3..e80dd0be 100644 --- a/internal/discover/graphics.go +++ b/internal/discover/graphics.go @@ -180,10 +180,10 @@ func (d graphicsDriverLibraries) Hooks() ([]Hook, error) { switch { case d.isDriverLibrary(filename, "libnvidia-allocator.so"): // gbm/nvidia-drm_gbm.so is a symlink to ../libnvidia-allocator.so.1 which - // in turn symlinks to libnvidia-allocator.so.RM_VERSION and is created - // when ldconfig is run in the container. - // create libnvidia-allocate.so.1 -> libnvidia-allocate.so.RM_VERSION symlink - links = append(links, fmt.Sprintf("%s::%s", filename, filepath.Join(dir, "libnvidia-allocator.so.1"))) + // in turn symlinks to libnvidia-allocator.so.RM_VERSION. + // The libnvidia-allocator.so.1 -> libnvidia-allocator.so.RM_VERSION symlink + // is created when ldconfig is run against the container and there + // is no explicit need to create it. // create gbm/nvidia-drm_gbm.so -> ../libnvidia-allocate.so.1 symlink linkPath := filepath.Join(dir, "gbm", "nvidia-drm_gbm.so") links = append(links, fmt.Sprintf("%s::%s", "../libnvidia-allocator.so.1", linkPath)) diff --git a/internal/discover/graphics_test.go b/internal/discover/graphics_test.go index d484d9ba..a515c939 100644 --- a/internal/discover/graphics_test.go +++ b/internal/discover/graphics_test.go @@ -68,7 +68,6 @@ func TestGraphicsLibrariesDiscoverer(t *testing.T) { Lifecycle: "createContainer", Path: "/usr/bin/nvidia-cdi-hook", Args: []string{"nvidia-cdi-hook", "create-symlinks", - "--link", "libnvidia-allocator.so.123.45.67::/usr/lib64/libnvidia-allocator.so.1", "--link", "../libnvidia-allocator.so.1::/usr/lib64/gbm/nvidia-drm_gbm.so", }, }, @@ -126,7 +125,6 @@ func TestGraphicsLibrariesDiscoverer(t *testing.T) { Lifecycle: "createContainer", Path: "/usr/bin/nvidia-cdi-hook", Args: []string{"nvidia-cdi-hook", "create-symlinks", - "--link", "libnvidia-allocator.so.123.45.67::/usr/lib64/libnvidia-allocator.so.1", "--link", "../libnvidia-allocator.so.1::/usr/lib64/gbm/nvidia-drm_gbm.so", "--link", "libnvidia-vulkan-producer.so.123.45.67::/usr/lib64/libnvidia-vulkan-producer.so", },