No, the stack trace is useless in this case. The exception is thrown in C++. Also, by now I am pretty sure that div isn’t the problem here. I guess detect_anomaly does not work well with some cudnn optimizations.