@@ -160,4 +160,30 @@ var _ = Describe("docker", Ordered, func() {
160
160
Expect (referenceOutput ).To (Equal (out4 ))
161
161
})
162
162
})
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
+ })
163
189
})
0 commit comments