From 882cbeb7d26d493db26b46b9a6455d9188e1e6da Mon Sep 17 00:00:00 2001 From: Jacob Domagala Date: Sun, 19 Jun 2022 22:39:27 +0200 Subject: [PATCH] #1849: tests: Skip the CUDA test if CUDA driver is not present --- tests/unit/active/test_async_op_cuda.cc | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/unit/active/test_async_op_cuda.cc b/tests/unit/active/test_async_op_cuda.cc index 83fe38ccc5..3b27b85222 100644 --- a/tests/unit/active/test_async_op_cuda.cc +++ b/tests/unit/active/test_async_op_cuda.cc @@ -180,6 +180,17 @@ struct CUDAGroup { }; TEST_F(TestAsyncOp, test_async_op_cuda) { + int driverVer; + if ( + (cudaDriverGetVersion(&driverVer) == cudaErrorInvalidValue) or + (driverVer == 0)) { + vtWarn( + "Trying to run test_async_op_cuda but CUDA driver is not present!\n" + ); + + return; + } + auto const this_node = theContext()->getNode(); auto p = theObjGroup()->makeCollective("test_async_op_cuda"); auto ep = theTerm()->makeEpochRooted(term::UseDS{true});