Check failed: error == cudaSuccess (74 vs. 0) misaligned address

参考: https://github.com/BVLC/caffe/issues/5729

You can insert tow lines of code before size_t total_max_workspace = ... as follow:

       size_t m=32;
       max_workspace = (max_workspace + m-1) / m * m; //align address to be multiples of m

BTW, I think there is another bug, these lines should be put in else block:

      for (int g = 0; g < (this->group_ * CUDNN_STREAMS_PER_GROUP); g++) {
        workspace[g] = reinterpret_cast<char *>(workspaceData)+g*max_workspace;

}

猜你喜欢

转载自blog.csdn.net/qq_28424679/article/details/79934537