Resolve "CUDA error: device-side assert triggered"
The traceback lies because CUDA runs async. Get the real line with CUDA_LAUNCH_BLOCKING=1 or the CPU, then fix the out-of-range index behind it.
2 articles
The traceback lies because CUDA runs async. Get the real line with CUDA_LAUNCH_BLOCKING=1 or the CPU, then fix the out-of-range index behind it.
The fastest test is torch.version.cuda — if it's None you have a CPU-only wheel. PyTorch bundles its own CUDA runtime, so you only need the NVIDIA driver.