mirror of
https://github.com/NVIDIA/nvidia-container-toolkit
synced 2025-06-26 18:18:24 +00:00
Allow cdi mode to work with --gpus flag
This changes ensures that the cdi modifier also removes the NVIDIA Container Runtime Hook from the incoming spec. This aligns with what is done for CSV modifications and prevents an error when starting the container. Signed-off-by: Evan Lezar <elezar@nvidia.com>
This commit is contained in:
@@ -74,6 +74,12 @@ var _ = Describe("docker", Ordered, func() {
|
||||
Expect(containerOutput).To(Equal(hostOutput))
|
||||
})
|
||||
|
||||
It("should support automatic CDI spec generation with the --gpus flag", func(ctx context.Context) {
|
||||
containerOutput, _, err := r.Run("docker run --rm -i --gpus=all --runtime=nvidia -e NVIDIA_VISIBLE_DEVICES=runtime.nvidia.com/gpu=all ubuntu nvidia-smi -L")
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
Expect(containerOutput).To(Equal(hostOutput))
|
||||
})
|
||||
|
||||
It("should support the --gpus flag using the nvidia-container-runtime", func(ctx context.Context) {
|
||||
containerOutput, _, err := r.Run("docker run --rm -i --runtime=nvidia --gpus all ubuntu nvidia-smi -L")
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
|
||||
Reference in New Issue
Block a user