cuda - 多个进程可以共享一个 CUDA 上下文吗?

标签 cuda multiprocessing gpu cuda-context

这个问题是 Jason R 的后续 comment罗伯特·克罗韦拉斯回答 this original question (“一个设备的多个 CUDA 上下文 - 有什么意义吗?”):

When you say that multiple contexts cannot run concurrently, is this limited to kernel launches only, or does it refer to memory transfers as well? I have been considering a multiprocess design all on the same GPU that uses the IPC API to transfer buffers from process to process. Does this mean that effectively, only one process at a time has exclusive access to the entire GPU (not just particular SMs)? [...] How does that interplay with asynchronously-queued kernels/copies on streams in each process as far as scheduling goes?



Robert Crovella 建议在一个新问题中提出这个问题,但它从未发生过,所以让我在这里做这个。

最佳答案

Multi-Process Service是 Nvidia 的替代 CUDA 实现,它使多个进程使用相同的上下文。这例如允许来自多个进程的内核并行运行,如果它们中的每一个都不能自己填满整个 GPU。

关于cuda - 多个进程可以共享一个 CUDA 上下文吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58747321/

相关文章:

c++ - 当程序在显示 "the program has stopped working"时崩溃时如何知道它是否是内存错误

c++ - 从指针计算数组索引

c - 唯一标识套接字

c++ - 计算一个 cuda 内核有多少 block 和线程,以及如何使用它们

Cuda 生成的 VC++ 解决方案上的 Boost 错误(错误 C2675)

cuda - 使用 cuCtxSetCurrent 时需要什么样的线程安全?

python - 多处理卡在连接处

Python 多处理 : Only one process is running

c++ - 使用pgc++编译器禁用OpenACC隐式编译指示生成

linux - 为多个 GPU 编写 CUDA 程序