☆CUDA 出错 debug 注意点

  1. 运行程序之前,在运行程序的命令行窗口,执行 export CUDA_LAUNCH_BLOCKING=1 以获得准确的出错日志。没有运行之前的报错位置会更后面一些。

    In general, when encountering cuda runtine errors, it is advisable to run your program again using the CUDA_LAUNCH_BLOCKING=1 flag to obtain an accurate stack trace.
    来源:https://stackoverflow.com/questions/51691563/cuda-runtime-error-59-device-side-assert-triggered

    You didn't run this example with CUDA_LAUNCH_BLOCKING=1 so the backtraces are too late--if you rerun with this envvar you'll get better back traces
    来源:https://github.com/pytorch/pytorch/issues/25537#issuecomment-527452087

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容