【发布时间】:2021-12-23 10:34:23
【问题描述】:
问题:
在 CentOS 7 上运行的 Nvidia GPU 上使用 CUDA 运行 PyTorch 脚本时,我偶尔会遇到以下 CUDA 错误。
如果我跑:
python3 -c 'import torch; print(torch.cuda.is_available()); torch.randn(1).to("cuda")'
我得到以下输出:
True
Traceback (most recent call last):
File "<string>", line 1, in <module>
RuntimeError: CUDA error: all CUDA-capable devices are busy or unavailable
CUDA kernel errors might be asynchronously reported at some other API call,so the stacktrace below might be incorrect.
For debugging consider passing CUDA_LAUNCH_BLOCKING=1.
PyTorch 似乎认为 GPU 可用,但我不能在它的内存上放任何东西。当我重新启动计算机时,错误消失了。我似乎无法让错误持续出现。
【问题讨论】: