mirror of
https://github.com/NVIDIA/nvidia-container-toolkit
synced 2025-06-26 18:18:24 +00:00
Add update-nvidia-params hook to CDI spec
Some checks failed
Some checks failed
Signed-off-by: Evan Lezar <elezar@nvidia.com>
This commit is contained in:
parent
b4b1dfaeff
commit
a802cc4ded
@ -106,6 +106,10 @@ func NewDriverLibraryDiscoverer(logger logger.Interface, driver *root.Driver, nv
|
||||
nvidiaCDIHookPath,
|
||||
),
|
||||
updateLDCache,
|
||||
discover.CreateNvidiaCDIHook(
|
||||
nvidiaCDIHookPath,
|
||||
"update-nvidia-params",
|
||||
),
|
||||
)
|
||||
|
||||
return d, nil
|
||||
|
||||
@ -24,7 +24,7 @@ import (
|
||||
)
|
||||
|
||||
// Integration tests for Docker runtime
|
||||
var _ = Describe("docker", Ordered, func() {
|
||||
var _ = Describe("docker", Ordered, ContinueOnFailure, func() {
|
||||
var r Runner
|
||||
|
||||
// Install the NVIDIA Container Toolkit
|
||||
@ -166,4 +166,23 @@ var _ = Describe("docker", Ordered, func() {
|
||||
Expect(referenceOutput).To(Equal(out4))
|
||||
})
|
||||
})
|
||||
|
||||
Describe("Disabling device node creation", Ordered, func() {
|
||||
BeforeAll(func(ctx context.Context) {
|
||||
_, _, err := r.Run("docker pull ubuntu")
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
})
|
||||
|
||||
It("should work with nvidia-container-runtime-hook", func(ctx context.Context) {
|
||||
output, _, err := r.Run("docker run --rm -i --runtime=runc --gpus=all ubuntu bash -c \"grep ModifyDeviceFiles: /proc/driver/nvidia/params\"")
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
Expect(output).To(Equal("ModifyDeviceFiles: 0\n"))
|
||||
})
|
||||
|
||||
It("should work with automatic CDI spec generation", func(ctx context.Context) {
|
||||
output, _, err := r.Run("docker run --rm -i --runtime=nvidia -e NVIDIA_VISIBLE_DEVICES=runtime.nvidia.com/gpu=all ubuntu bash -c \"grep ModifyDeviceFiles: /proc/driver/nvidia/params\"")
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
Expect(output).To(Equal("ModifyDeviceFiles: 0\n"))
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
Loading…
Reference in New Issue
Block a user