是否可以使用较小的块在 GPU 全局内存上进行大的连续分配?
Is Large contiguous allocation on GPU global memory possible using smaller chunks?
我需要动态分配 GPU 全局内存的很大一部分,比如 64 MB,这会花费很多时间;分配完成后,副本 to/from 分配的 space 将开始。我想知道是否可以在较小的块(例如 1 MB)中分配 64 MB 并在每个分配的块上启动异步复制?请注意,我希望最终分配的 space 是连续的。
另一个问题,不存在异步 cudaMalloc 或任何等效的东西,对吗?
I am wondering if it is possible to allocate that 64 MB in smaller chunks (for example 1 MB) and initiate an asynchronous copy on each of the allocated chunks? Please note that I want the final allocated space to be contiguous.
不,这不可能。您无法控制地址 space 分配的位置。无法请求位于特定地址或与另一个分配相邻的分配。在这方面,行为和功能与主机 malloc
非常相似,主机 malloc
也具有 none 这些功能。
Another question, no asynchronous cudaMalloc or anything equivalent to that exist, right?
cudaMalloc
没有 "async" 版本。它通常会有阻塞行为,因为它正在修改 GPU 的地址映射。当 GPU 上没有其他 activity 发生时(即没有内核执行,没有正在进行的复制操作),地址映射的这种修改必须发生。
我需要动态分配 GPU 全局内存的很大一部分,比如 64 MB,这会花费很多时间;分配完成后,副本 to/from 分配的 space 将开始。我想知道是否可以在较小的块(例如 1 MB)中分配 64 MB 并在每个分配的块上启动异步复制?请注意,我希望最终分配的 space 是连续的。
另一个问题,不存在异步 cudaMalloc 或任何等效的东西,对吗?
I am wondering if it is possible to allocate that 64 MB in smaller chunks (for example 1 MB) and initiate an asynchronous copy on each of the allocated chunks? Please note that I want the final allocated space to be contiguous.
不,这不可能。您无法控制地址 space 分配的位置。无法请求位于特定地址或与另一个分配相邻的分配。在这方面,行为和功能与主机 malloc
非常相似,主机 malloc
也具有 none 这些功能。
Another question, no asynchronous cudaMalloc or anything equivalent to that exist, right?
cudaMalloc
没有 "async" 版本。它通常会有阻塞行为,因为它正在修改 GPU 的地址映射。当 GPU 上没有其他 activity 发生时(即没有内核执行,没有正在进行的复制操作),地址映射的这种修改必须发生。