def built_with_cuda():
    """Returns whether GraphBolt was built with CUDA support."""
    # This op is defined if graphbolt is built with CUDA support.
    return hasattr(torch.ops.graphbolt, "set_max_uva_threads")
Returns whether GraphBolt was built with CUDA support.
python/dgl/graphbolt/internal_utils.py