GDR: How to reg GPU memory which is allocated in another process to NIC

We are trying to do something like the following

1.(Process A) allocate GPU Memory

2.(Process A) pass the handle of gpu memory generated by cudaIpcGetMemHandle to Process B

3.(Process B) get pointer of the same gpu memory using cudaIpcOpenMemHandle

4.(Process B) reg the pointer to NIC to enable GDR using ibv_reg_mr

The step 4 returns errno 14,how to fix this

Any advice on what to try would be greatly appreciated