diff --git a/python/cugraph/community/__init__.py b/python/cugraph/community/__init__.py index 4e1115a71ee..e8bea0cbaa0 100644 --- a/python/cugraph/community/__init__.py +++ b/python/cugraph/community/__init__.py @@ -31,7 +31,11 @@ # replace ktruss with a __UnsupportedModule instance, which lazily raises an # exception when referenced. from numba import cuda -__cuda_version = cuda.runtime.get_version() +try: + __cuda_version = cuda.runtime.get_version() +except cuda.cudadrv.runtime.CudaRuntimeAPIError: + __cuda_version = "n/a" + __ktruss_unsupported_cuda_version = (11, 4) class __UnsupportedModule: diff --git a/python/cugraph/community/ktruss_subgraph.py b/python/cugraph/community/ktruss_subgraph.py index b9682e072c2..c80f65c1608 100644 --- a/python/cugraph/community/ktruss_subgraph.py +++ b/python/cugraph/community/ktruss_subgraph.py @@ -20,8 +20,13 @@ # crash in that environment. Allow ktruss to import on non-11.4 systems, but # raise an exception if ktruss is directly imported on 11.4. from numba import cuda -__cuda_version = cuda.runtime.get_version() +try: + __cuda_version = cuda.runtime.get_version() +except cuda.cudadrv.runtime.CudaRuntimeAPIError: + __cuda_version = "n/a" + __ktruss_unsupported_cuda_version = (11, 4) + if __cuda_version == __ktruss_unsupported_cuda_version: __kuvs = ".".join([str(n) for n in __ktruss_unsupported_cuda_version]) raise NotImplementedError("k_truss is not currently supported in CUDA"