diff --git a/samples/libtorch/all/test_package/conanfile.py b/samples/libtorch/all/test_package/conanfile.py index b630fa2..758392d 100644 --- a/samples/libtorch/all/test_package/conanfile.py +++ b/samples/libtorch/all/test_package/conanfile.py @@ -20,6 +20,11 @@ def layout(self): cmake_layout(self) def test(self): - if can_run(self): - cmd = os.path.join(self.cpp.build.bindir, "test_package") - self.run(cmd, env="conanrun") + if not can_run(self): + return + if self.settings.os in ("Linux", "FreeBSD"): + if self.dependencies["libtorch"].options.get_safe("with_cuda"): + self.output.warning("Skipping the test run: the NVIDIA driver (libcuda.so.1) not available in CI") + return + cmd = os.path.join(self.cpp.build.bindir, "test_package") + self.run(cmd, env="conanrun") diff --git a/samples/llama-cpp/all/test_package/conanfile.py b/samples/llama-cpp/all/test_package/conanfile.py index 2f2ca78..704db83 100644 --- a/samples/llama-cpp/all/test_package/conanfile.py +++ b/samples/llama-cpp/all/test_package/conanfile.py @@ -21,6 +21,11 @@ def build(self): cmake.build() def test(self): - if can_run(self): - bin_path = os.path.join(self.cpp.build.bindir, "test_package") - self.run(bin_path, env="conanrun") + if not can_run(self): + return + if self.settings.os in ("Linux", "FreeBSD"): + if self.dependencies["llama-cpp"].options.get_safe("with_cuda"): + self.output.warning("Skipping the test run: the NVIDIA driver (libcuda.so.1) not available in CI") + return + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun")