Skip to content

Commit db68c39

Browse files
authored
Merge pull request #326 from elezar/CNT-4766/create-so-symlinks
Create .so symlinks for driver libraries in container
2 parents 0920018 + 3a59233 commit db68c39

File tree

21 files changed

+434
-283
lines changed

21 files changed

+434
-283
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
## v1.18.0-rc.2
44

5+
- Ensure that .so symlinks are created for driver libraries in the container
56
- Load settings from config.toml file during CDI generation
67
- Use securejoin to resolve /proc
78
- Refactor nvml CDI spec generation for consistency

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
## Introduction
1010

11-
The NVIDIA Container Toolkit allows users to build and run GPU accelerated containers. The toolkit includes a container runtime [library](https://github.com/NVIDIA/libnvidia-container) and utilities to automatically configure containers to leverage NVIDIA GPUs.
11+
The NVIDIA Container Toolkit allows users to build and run GPU-accelerated containers. The toolkit includes a container runtime [library](https://github.com/NVIDIA/libnvidia-container) and utilities to automatically configure containers to leverage NVIDIA GPUs.
1212

1313
Product documentation including an architecture overview, platform support, and installation and usage guides can be found in the [documentation repository](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/overview.html).
1414

cmd/nvidia-cdi-hook/commands/commands.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import (
2020
"github.com/urfave/cli/v3"
2121

2222
"github.com/NVIDIA/nvidia-container-toolkit/cmd/nvidia-cdi-hook/chmod"
23-
createsonamesymlinks "github.com/NVIDIA/nvidia-container-toolkit/cmd/nvidia-cdi-hook/create-soname-symlinks"
2423
symlinks "github.com/NVIDIA/nvidia-container-toolkit/cmd/nvidia-cdi-hook/create-symlinks"
2524
"github.com/NVIDIA/nvidia-container-toolkit/cmd/nvidia-cdi-hook/cudacompat"
2625
disabledevicenodemodification "github.com/NVIDIA/nvidia-container-toolkit/cmd/nvidia-cdi-hook/disable-device-node-modification"
@@ -36,7 +35,6 @@ func New(logger logger.Interface) []*cli.Command {
3635
symlinks.NewCommand(logger),
3736
chmod.NewCommand(logger),
3837
cudacompat.NewCommand(logger),
39-
createsonamesymlinks.NewCommand(logger),
4038
disabledevicenodemodification.NewCommand(logger),
4139
}
4240
}

cmd/nvidia-cdi-hook/create-soname-symlinks/soname-symlinks.go

Lines changed: 0 additions & 166 deletions
This file was deleted.

cmd/nvidia-ctk-installer/toolkit/toolkit_test.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -98,15 +98,6 @@ containerEdits:
9898
- libcuda.so.1::/lib/x86_64-linux-gnu/libcuda.so
9999
env:
100100
- NVIDIA_CTK_DEBUG=false
101-
- hookName: createContainer
102-
path: {{ .toolkitRoot }}/nvidia-cdi-hook
103-
args:
104-
- nvidia-cdi-hook
105-
- create-soname-symlinks
106-
- --folder
107-
- /lib/x86_64-linux-gnu
108-
env:
109-
- NVIDIA_CTK_DEBUG=false
110101
- hookName: createContainer
111102
path: {{ .toolkitRoot }}/nvidia-cdi-hook
112103
args:

cmd/nvidia-ctk/cdi/generate/generate.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,6 @@ func (m command) build() *cli.Command {
173173
Destination: &opts.ldconfigPath,
174174
Sources: cli.NewValueSourceChain(
175175
cli.EnvVar("NVIDIA_CTK_CDI_GENERATE_LDCONFIG_PATH"),
176-
m.config.ValueFrom("nvidia-container-cli.ldconfig"),
177176
),
178177
},
179178
&cli.StringFlag{

cmd/nvidia-ctk/cdi/generate/generate_test.go

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -102,15 +102,6 @@ containerEdits:
102102
- --host-driver-version=999.88.77
103103
env:
104104
- NVIDIA_CTK_DEBUG=false
105-
- hookName: createContainer
106-
path: /usr/bin/nvidia-cdi-hook
107-
args:
108-
- nvidia-cdi-hook
109-
- create-soname-symlinks
110-
- --folder
111-
- /lib/x86_64-linux-gnu
112-
env:
113-
- NVIDIA_CTK_DEBUG=false
114105
- hookName: createContainer
115106
path: /usr/bin/nvidia-cdi-hook
116107
args:
@@ -188,15 +179,6 @@ containerEdits:
188179
- libcuda.so.1::/lib/x86_64-linux-gnu/libcuda.so
189180
env:
190181
- NVIDIA_CTK_DEBUG=false
191-
- hookName: createContainer
192-
path: /usr/bin/nvidia-cdi-hook
193-
args:
194-
- nvidia-cdi-hook
195-
- create-soname-symlinks
196-
- --folder
197-
- /lib/x86_64-linux-gnu
198-
env:
199-
- NVIDIA_CTK_DEBUG=false
200182
- hookName: createContainer
201183
path: /usr/bin/nvidia-cdi-hook
202184
args:
@@ -274,15 +256,6 @@ containerEdits:
274256
- libcuda.so.1::/lib/x86_64-linux-gnu/libcuda.so
275257
env:
276258
- NVIDIA_CTK_DEBUG=false
277-
- hookName: createContainer
278-
path: /usr/bin/nvidia-cdi-hook
279-
args:
280-
- nvidia-cdi-hook
281-
- create-soname-symlinks
282-
- --folder
283-
- /lib/x86_64-linux-gnu
284-
env:
285-
- NVIDIA_CTK_DEBUG=false
286259
- hookName: createContainer
287260
path: /usr/bin/nvidia-cdi-hook
288261
args:

deployments/container/Dockerfile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ ARG VERSION="N/A"
1818

1919
FROM nvcr.io/nvidia/cuda:12.9.1-base-ubi9 AS build
2020

21+
RUN rm -f /etc/yum.repos.d/cuda.repo && rm -f /etc/ld.so.conf.d/nvidia.conf
22+
2123
RUN dnf install -y \
2224
wget make git gcc \
2325
&& \
@@ -86,6 +88,8 @@ COPY LICENSE /licenses/
8688
# The debpackages stage is used to extract the contents of deb packages.
8789
FROM nvcr.io/nvidia/cuda:12.9.1-base-ubuntu20.04 AS debpackages
8890

91+
RUN rm -f /etc/apt/sources.list.d/cuda.list
92+
8993
ARG TARGETARCH
9094
ARG PACKAGE_DIST_DEB=ubuntu18.04
9195

@@ -104,6 +108,9 @@ RUN set -eux; \
104108

105109
# The rpmpackages stage is used to extract the contents of the rpm packages.
106110
FROM nvcr.io/nvidia/cuda:12.9.1-base-ubi9 AS rpmpackages
111+
112+
RUN rm -f /etc/yum.repos.d/cuda.repo && rm -f /etc/ld.so.conf.d/nvidia.conf
113+
107114
RUN dnf install -y cpio
108115

109116
ARG TARGETARCH

internal/discover/hooks.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,6 @@ const (
4646
// An UpdateLDCacheHook is the hook used to update the ldcache in the
4747
// container. This allows injected libraries to be discoverable.
4848
UpdateLDCacheHook = HookName("update-ldcache")
49-
// A CreateSonameSymlinksHook is the hook used to ensure that soname symlinks
50-
// for injected libraries exist in the container.
51-
CreateSonameSymlinksHook = HookName("create-soname-symlinks")
5249

5350
defaultNvidiaCDIHookPath = "/usr/bin/nvidia-cdi-hook"
5451
)

internal/discover/ldconfig.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,7 @@ func (d ldconfig) Hooks() ([]Hook, error) {
6161
args = append(args, "--folder", f)
6262
}
6363

64-
h := Merge(
65-
d.hookCreator.Create(CreateSonameSymlinksHook, args...),
66-
d.hookCreator.Create(UpdateLDCacheHook, args...),
67-
)
68-
69-
return h.Hooks()
64+
return d.hookCreator.Create(UpdateLDCacheHook, args...).Hooks()
7065
}
7166

7267
// getLibraryPaths extracts the library dirs from the specified mounts

0 commit comments

Comments
 (0)