Enhancing RDMA Performance: GPU Memory Integration

Updated on Apr 07,2024

Enhancing RDMA Performance: GPU Memory Integration

Table of Contents

  1. Overview of RDMA Operations
  2. RDMA Operations with GPU Memory
  3. Memory Registration for RDMA Operations
  4. Using DMA Buff for GPU Memory RDMA Support
  5. Implementation Details
  6. Software Stack Changes
  7. testing and Performance
  8. Upstream Proposals and Future Plans
  9. Conclusion
  10. FAQ

Overview of RDMA Operations

Remote Direct Memory Access (RDMA) is a mechanism that allows data to be transferred between systems without involving the CPU. It combines Direct Memory Access (DMA) and networking, enabling efficient data transfers. In an RDMA write operation, the initiator side performs a DMA read from the buffer, and the NIC sends the data to the target over the network. RDMA operations are typically performed using the physical addresses (DMA addresses) of the memory buffers rather than virtual addresses.

RDMA Operations with GPU Memory

When using GPU memory in RDMA operations, additional steps are required due to the local nature of GPU memory. The NIC driver cannot directly Pin GPU memory or determine its DMA address. Instead, the GPU driver and NIC driver must work together to exchange information. The GPU driver provides the NIC driver with the necessary information about the GPU memory, allowing the NIC driver to perform DMA transactions with the GPU memory.

Memory Registration for RDMA Operations

Memory registration is a crucial step in setting up DMA operations for RDMA. The NIC driver needs to know the DMA address of the memory buffers to perform the DMA transactions. Memory registration involves pinning the memory pages so that the physical memory is not accessed for other purposes during the DMA operation. Specialized functions such as get_user_pages and dma_map_sg are used for memory registration.

Using DMA Buff for GPU Memory RDMA Support

To support RDMA operations with GPU memory, a different approach is needed. One proposed solution is to use DMA Buff as a mechanism for information exchange between the GPU driver and NIC driver. DMA Buff is a standard mechanism in the Linux kernel for sharing buffers between different device drivers. It allows buffers to be exported by one driver and imported by another, enabling efficient data sharing.

Implementation Details

The implementation of using DMA Buff for GPU memory RDMA support focuses on the memory registration side, as GPU memory differs from system memory. The flowchart of the memory registration process starts with memory allocation by the GPU driver. The GPU driver exports the buffer as a DMA Buff object, which is then imported by the kernel RDMA driver. The kernel RDMA driver uses the DMA Buff API functions to set up the DMA address for the GPU memory.

Software Stack Changes

To support GPU memory RDMA with DMA Buff, changes are required at several layers of the software stack. GPU drivers need to be optimized for Peer-to-peer access. User-space libraries need to provide interfaces for obtaining DMA Buff file descriptors. RDMA drivers need to support DMA Buff as user memory and introduce new commands for memory registration with DMA Buff.

Testing and Performance

A software prototype has been implemented on Linux kernel 5.6 and the latest user-space RDMA core library. Intel GPUs using the i915 driver and Mellanox ConnectX-4 EDR NICs were used for testing. The prototype achieved expected performance, and the next step is to upstream the code changes to the Linux kernel and user-space libraries.

Upstream Proposals and Future Plans

The proposed changes have been submitted as RFC (Request for Comments) patches to the Linux RDMA list. Future plans include revising the patches based on feedback, watching GPU driver and DMA Buff infrastructure development, and upstreaming the changes to the Linux kernel and user-space libraries.

Conclusion

Using DMA Buff as a mechanism for supporting GPU memory RDMA operations offers a promising alternative to existing solutions. By leveraging DMA Buff's buffer sharing mechanism, it enables efficient data exchange between GPU and NIC drivers, enhancing RDMA performance and scalability.

FAQ

  1. Question: Is this proposal specific to Linux? Answer: Yes, this proposal is specific to the Linux RDMA subsystem. It has been submitted as RFC patches to the Linux RDMA list for feedback and potential inclusion in the Linux kernel.

  2. Question: How does using DMA Buff compare to other approaches for supporting GPU memory RDMA? Answer: DMA Buff offers a standardized mechanism for buffer sharing between device drivers, making it a flexible and efficient solution for supporting GPU memory RDMA. It allows drivers to exchange information about memory buffers, enabling seamless integration of GPU memory into RDMA operations.

  3. Question: What are the performance implications of using DMA Buff for GPU memory RDMA? Answer: The performance of using DMA Buff for GPU memory RDMA has been tested and found to meet expected performance levels. It provides an efficient way to integrate GPU memory into RDMA operations, enhancing overall system performance.

  4. Question: Are there any limitations or drawbacks to using DMA Buff for GPU memory RDMA? Answer: One limitation is that DMA Buff may not be optimized for all GPU drivers, requiring additional development effort to ensure compatibility and performance. Additionally, upstreaming the changes to the Linux kernel and user-space libraries may require coordination and effort from the development community.

Most people like