from __future__ import annotations from .base import DeviceBackend class CudaBackend(DeviceBackend): name = "cuda" visibility_env_keys = ("CUDA_VISIBLE_DEVICES",) torch_namespace = "cuda" flaggems_vendor = "nvidia" supports_cuda_graph = True supports_mm_cluster_fix = True supports_triton_hooks = True list_command = (("nvidia-smi", "--list-gpus"), "GPU ") # Unchanged from when this list lived in _cudagraph_plugin; CUDA numbers do # not move because of the classification refactor. fatal_error_markers = ( "illegal memory access", "cudaerrorillegaladdress", "out of memory", "device-side assert triggered", "an illegal instruction", "misaligned address", "uncorrectable ecc", ) # No CUDA wording is known to poison the context without also matching one # of the fatal markers above, so nothing is listed here rather than guessed. poisoning_error_markers = ()