multi-gpu cuda:在一个设备上运行内核并在另一个设备上修改元素? [英] multi-gpu cuda: Run kernel on one device and modify elements on the other?

查看:294
本文介绍了multi-gpu cuda:在一个设备上运行内核并在另一个设备上修改元素?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我在一台机器上有多个GPU,并且有一个内核在GPU0上运行。

Suppose I have multiple GPU's in a machine and I have a kernel running on GPU0.

使用CUDA 4.0的UVA和P2P功能,当内核在GPU0上运行时,我可以修改另一个设备上的阵列的内容,例如GPU1吗?

With the UVA and P2P features of CUDA 4.0, can I modify the contents of an array on another device say GPU1 when the kernel is running on GPU0?

CUDA 4.0 SDK中的simpleP2P示例不能演示这一点。

The simpleP2P example in the CUDA 4.0 SDK does not demonstrate this.

这只会演示:


  • 对等备忘录

  • 在GPU0上运行的内核,从GPU1缓冲区读取输入并将输出写入GPU0缓冲

  • Peer-to-peer memcopies
  • A kernel running on GPU0 which reads input from GPU1 buffer and writes output to GPU0 buffer

在GPU1上运行的内核,从GPU0缓冲区读取输入并将输出写入GPU1缓冲区

A kernel running on GPU1 which reads input from GPU0 buffer and writes output to GPU1 buffer

推荐答案

简单答案:是的,你可以。

Short answer: Yes, you can.

更长的答案

链接的演示文稿提供了完整的详细信息,但这里是要求:

The linked presentation gives full details, but here are the requirements:


  • 必须位于64位操作系统(Linux或Windows和Tesla Compute Cluster驱动程序)。

  • GPU必须都是Compute Capability 2.0(sm_20)或更高版本。

  • 目前,GPU必须连接到相同的 IOH

  • Must be on a 64-bit OS (either Linux or Windows with the Tesla Compute Cluster driver).
  • GPUs must both be Compute Capability 2.0 (sm_20) or higher.
  • Currently the GPUs must be attached to the same IOH.

您可以使用 cudaDeviceCanAccessPeer()查询是否可以进行直接P2P访问。

You can use cudaDeviceCanAccessPeer() to query whether direct P2P access is possible.

这篇关于multi-gpu cuda:在一个设备上运行内核并在另一个设备上修改元素?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆