【发布时间】:2021-06-15 01:14:18
【问题描述】:
如何在 Pytorch 中查看哪一行导致 cuda 崩溃,它在 GIL 之外执行异步代码?
Here 是我有 Pytorch 崩溃 cuda 的情况,在 this 数据集上运行 this 代码,每次运行都会在不同的 python 行上使用调试器崩溃,这使得调试非常困难。
【问题讨论】:
标签: python asynchronous deep-learning cuda pytorch
如何在 Pytorch 中查看哪一行导致 cuda 崩溃,它在 GIL 之外执行异步代码?
Here 是我有 Pytorch 崩溃 cuda 的情况,在 this 数据集上运行 this 代码,每次运行都会在不同的 python 行上使用调试器崩溃,这使得调试非常困难。
【问题讨论】:
标签: python asynchronous deep-learning cuda pytorch
我在论坛的completely unrelated thread 中找到了答案。无法在 Google 上找到答案,因此为了将来的用户而在此处发布。
由于 CUDA 调用是异步执行的,您应该运行您的代码 与
CUDA_LAUNCH_BLOCKING=1 python script.py这确保正确的代码行会抛出错误消息。
【讨论】: