How to translate a cuMemMap() virtual address to PCIE physical address


I am implementing RDMA between a Nvidia GPU and our own device on Windows.
After I call these APIs:
CUdeviceptr deviceptr;
cuMemAddressReserve(&deviceptr, size, align, 0, 0);
CUmemGenericAllocationHandle allocationHandle; // the physical handle for device memory
cuMemCreate(&allocationHandle, size, prop, 0);
ret = cuMemMap(deviceptr, size, 0, allocationHandle, 0);

I get the virtual address pointer deviceptr.
How do I translate it into a physical address so I can pass it a third-party device and it start a DMA to the address?


Hi Robert:

I’ve gone through this document. But it is the instruction for Linux. I wanted to do the RDMA on Windows. Can you show me such info for Windows?


I’m not aware of any instructions/methods for windows.