Skip to content

Commit 8e0c69b

Browse files
committed
Add basic integration tests for forward compat
Signed-off-by: Evan Lezar <[email protected]>
1 parent 24dfcdd commit 8e0c69b

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

tests/e2e/nvidia-container-toolkit_test.go

+26
Original file line numberDiff line numberDiff line change
@@ -160,4 +160,30 @@ var _ = Describe("docker", Ordered, func() {
160160
Expect(referenceOutput).To(Equal(out4))
161161
})
162162
})
163+
164+
Describe("CUDA Forward compatibility", Ordered, func() {
165+
BeforeAll(func(ctx context.Context) {
166+
_, _, err := r.Run("docker pull nvcr.io/nvidia/cuda:12.8.0-base-ubi8")
167+
Expect(err).ToNot(HaveOccurred())
168+
})
169+
170+
It("should use the CUDA compat libs in legacy mode", func(ctx context.Context) {
171+
ldconfigOut, _, err := r.Run("docker run --rm -i -e NVIDIA_DISABLE_REQUIRE=true --runtime=nvidia --gpus all nvcr.io/nvidia/cuda:12.8.0-base-ubi8 bash -c \"ldconfig -p | grep libcuda.so.1\"")
172+
Expect(err).ToNot(HaveOccurred())
173+
Expect(ldconfigOut).To(ContainSubstring("/usr/local/cuda/compat"))
174+
})
175+
176+
It("should use the CUDA compat libs in CDI mode", func(ctx context.Context) {
177+
ldconfigOut, _, err := r.Run("docker run --rm -i -e NVIDIA_DISABLE_REQUIRE=true --runtime=nvidia -e NVIDIA_VISIBLE_DEVICES=runtime.nvidia.com/gpu=all nvcr.io/nvidia/cuda:12.8.0-base-ubi8 bash -c \"ldconfig -p | grep libcuda.so.1\"")
178+
Expect(err).ToNot(HaveOccurred())
179+
Expect(ldconfigOut).To(ContainSubstring("/usr/local/cuda/compat"))
180+
})
181+
182+
It("should use the CUDA compat libs when using the nvidia-container-runtime-hook", func(ctx context.Context) {
183+
ldconfigOut, _, err := r.Run("docker run --rm -i -e NVIDIA_DISABLE_REQUIRE=true --runtime=runc --gpus all nvcr.io/nvidia/cuda:12.8.0-base-ubi8 bash -c \"ldconfig -p | grep libcuda.so.1\"")
184+
Expect(err).ToNot(HaveOccurred())
185+
Expect(ldconfigOut).To(ContainSubstring("/usr/local/cuda/compat"))
186+
})
187+
188+
})
163189
})

0 commit comments

Comments
 (0)