Unverified50% confidenceFactExact time
In PyTorch, torch.cuda.is_available() is used to detect whether the current environment supports CUDA; if it returns False, all operations that attempt to move tensors to the GPU (such as .cuda() or .to('cuda')) will throw a runtime error.
1
Sources
50%
Confidence
Long-term
Relevance
11/10/2026
First Seen
Sources
Related Entities
Related Claims
UnverifiedPrior to torch.accelerator, PyTorch code typically detected hardware resources through CUDA-specific APIs such as torch.cuda.device_count() or torch.cuda.is_available().77% similarUnverifiedThe error 'Torch not compiled with CUDA enabled' is usually caused by installing the CPU version of PyTorch, and requires reinstalling the version corresponding to the appropriate CUDA version.70% similarUnverifiedMany third-party libraries and models embed CUDA code using methods such as torch.utils.cpp_extension, and these paths often require dedicated alternatives on non-CUDA backends.69% similarUnverifiedIn a ROCm environment, torch.cuda is an alias for HIP, and both torch.cuda.is_available() and is_bf16_supported() return true values normally.68% similarUnverifiedOn Nvidia GPUs, PyTorch's execution path is PyTorch → CUDA (along with acceleration libraries such as cuDNN and cuBLAS) → the graphics card driver.68% similar
Cite This Claim
Stable URI
https://kongchang.com/claim/1156593API
curl https://kongchang.com/api/v1/knowledge/claims/1156593MCP
get_claim(id=1156593)