Problem 1: Low Memcpy/Compute Overlap
The percentage of time when memcpy is being performed in parallel with compute is low.
Nsight手册第九章 Memory Optimizations
9.1 Data Transfer Between Host and Device
High Priority:
1、Minimize data transfer between the host and the device, even if it means running some kernels on the device gains no performance when compared with running them on the host.
2、Build intermediate data structures and remember to destroyed them.
3、Using pinned memory(就是我们所说的不可分页内存). But don't overuse it.
Nsight调试:内存拷贝与计算优化

本文介绍了CUDA中低Memcpy/Compute重叠问题的解决方案,重点是通过Nsight手册学习内存优化,特别是如何减少主机与设备间的数据传输。建议包括最小化数据传输,使用中间数据结构,利用固定内存,以及使用异步内存拷贝。示例代码展示了如何通过流(stream)实现计算与内存拷贝的并行,适用于数据可分块传输的情况。此外,还提及了CUDA 2.2及更高版本中的零拷贝技术。
最低0.47元/天 解锁文章
2062

被折叠的 条评论
为什么被折叠?



