Skip to main content
ALT Linux Bugzilla
– Attachment 22250 Details for
Bug 59499
libnvidia-ml не попадает в CDI-спецификацию nvidia-container-toolkit: в контейнерах не работает nvidia-smi и любые потребители NVML
New bug
|
Search
|
[?]
|
Help
Register
|
Log In
[x]
|
Forgot Password
Login:
[x]
|
EN
|
RU
[patch]
nvidia-container-toolkit-alt-nvml.patch
nvidia-container-toolkit-alt-nvml.patch (text/plain), 2.68 KB, created by
Vladislav Glinkin
on 2026-09-18 19:12:00 MSK
(
hide
)
Description:
nvidia-container-toolkit-alt-nvml.patch
Filename:
MIME Type:
Creator:
Vladislav Glinkin
Created:
2026-09-18 19:12:00 MSK
Size:
2.68 KB
patch
obsolete
>From d9819791763d5a029e0a02d361bb113019365c4e Mon Sep 17 00:00:00 2001 >From: Vladislav Glinkin <glinkinvd@basealt.ru> >Date: Fri, 18 Sep 2026 18:50:44 +0300 >Subject: [PATCH] ALT: include NVML alternatives directory in CDI > >--- > internal/lookup/root/root.go | 9 +++++++++ > internal/lookup/root/root_test.go | 32 +++++++++++++++++++++++++++++++ > 2 files changed, 41 insertions(+) > >diff --git a/internal/lookup/root/root.go b/internal/lookup/root/root.go >index 284bafd5..817fafa0 100644 >--- a/internal/lookup/root/root.go >+++ b/internal/lookup/root/root.go >@@ -120,6 +120,15 @@ func (r *Driver) DriverLibraryLocator(additionalDirs ...string) (lookup.Locator, > } > > searchPaths := []string{libcudasoParentDirPath} >+ // Some distributions expose the driver libraries through an alternatives >+ // directory that is listed in ld.so.cache but is not the directory that >+ // contains libcuda.so. Add the resolved NVML directory to the search paths >+ // used for versioned driver libraries as well. >+ if nvmlPaths, err := r.Libraries().Locate("libnvidia-ml.so.1"); err == nil { >+ for _, path := range nvmlPaths { >+ searchPaths = append(searchPaths, r.RelativeToRoot(filepath.Dir(path))) >+ } >+ } > for _, dir := range additionalDirs { > if strings.HasPrefix(dir, "/") { > searchPaths = append(searchPaths, dir) >diff --git a/internal/lookup/root/root_test.go b/internal/lookup/root/root_test.go >index c256deb6..7778babd 100644 >--- a/internal/lookup/root/root_test.go >+++ b/internal/lookup/root/root_test.go >@@ -17,6 +17,7 @@ > package root > > import ( >+ "os" > "path/filepath" > "testing" > >@@ -79,3 +80,34 @@ func TestDriverLibrariesLocate(t *testing.T) { > } > } > } >+ >+func TestDriverLibraryLocatorIncludesNvmlDirectory(t *testing.T) { >+ logger, _ := testlog.NewNullLogger() >+ rootfs := t.TempDir() >+ >+ libcudaDir := filepath.Join(rootfs, "usr", "lib64") >+ nvmlDir := filepath.Join(rootfs, "etc", "libnvidiacurrent") >+ require.NoError(t, os.MkdirAll(libcudaDir, 0755)) >+ require.NoError(t, os.MkdirAll(nvmlDir, 0755)) >+ >+ const version = "999.88.77" >+ libcuda := filepath.Join(libcudaDir, "libcuda.so."+version) >+ require.NoError(t, os.WriteFile(libcuda, nil, 0644)) >+ >+ nvml := filepath.Join(nvmlDir, "libnvidia-ml.so."+version) >+ require.NoError(t, os.WriteFile(nvml, nil, 0644)) >+ require.NoError(t, os.Symlink("libnvidia-ml.so."+version, filepath.Join(nvmlDir, "libnvidia-ml.so.1"))) >+ >+ driver := New( >+ WithLogger(logger), >+ WithDriverRoot(rootfs), >+ WithLibrarySearchPaths(libcudaDir, nvmlDir), >+ ) >+ >+ libraries, err := driver.DriverLibraryLocator() >+ require.NoError(t, err) >+ >+ candidates, err := libraries.Locate("*.so." + version) >+ require.NoError(t, err) >+ require.ElementsMatch(t, []string{libcuda, nvml}, candidates) >+}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 59499
:
21648
| 22250