[Answering both questions with this email]
These changes depend on new features in CUDA 4.0. With CUDA 4.0, there is the concept of Unified Virtual Addresses, so the addresses do not overlap. They are all unique within the process. There is an API in the CUDA 4.0 that one can use to query what type of memory an address points to.
This work does not depend on GPU Direct. It is making use of the fact that one can malloc memory, register it with IB, and register it with CUDA via the new 4.0 API cuMemHostRegister API. Then one can copy device memory into this memory.
From: devel-bounces_at_[hidden] [mailto:devel-bounces_at_[hidden]] On Behalf Of Brice Goglin
Sent: Wednesday, April 13, 2011 1:00 PM
Subject: Re: [OMPI devel] RFC: Add support to send/receive CUDA device memory directly
This "CUDA device memory" isn't memory mapped in the host, right? Then what does its address look like ? When you say "when it is detected that a buffer is CUDA device memory", if the actual device and host address spaces are different, how do you know that device addresses and usual host addresses will never have the same values ?
Do you need GPUDirect for "to improve performance, the internal host buffers have to also be registered with the CUDA environment" ?
Le 13/04/2011 18:47, Rolf vandeVaart a écrit :
WHAT: Add support to send data directly from CUDA device memory via MPI calls.
TIMEOUT: April 25, 2011
DETAILS: When programming in a mixed MPI and CUDA environment, one cannot currently send data directly from CUDA device memory. The programmer first has to move the data into host memory, and then send it. On the receiving side, it has to first be received into host memory, and then copied into CUDA device memory.
This RFC adds the ability to send and receive CUDA device memory directly.
There are three basic changes being made to add the support. First, when it is detected that a buffer is CUDA device memory, the protocols that can be used are restricted to the ones that first copy data into internal buffers. This means that we will not be using the PUT and RGET protocols, just the send and receive ones. Secondly, rather than using memcpy to move the data into and out of the host buffers, the library has to use a special CUDA copy routine called cuMemcpy. Lastly, to improve performance, the internal host buffers have to also be registered with the CUDA environment (although currently it is unclear how helpful that is)
By default, the code is disable and has to be configured into the library.
--with-cuda(=DIR) Build cuda support, optionally adding DIR/include,
DIR/lib, and DIR/lib64
--with-cuda-libdir=DIR Search for cuda libraries in DIR
An initial implementation can be viewed at:
Here is a list of the files being modified so one can see the scope of the impact.
$ svn status
This email message is for the sole use of the intended recipient(s) and may contain confidential information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message.
devel mailing list