Allocating physically contiguous memory with clSVMAlloc()


I’m working on APU (Kaveri) machine to use clSVMAlloc() to eliminate any memory copy between CPU and GPU.

Although using clSVMAlloc() works well for sharing same virtual address for CPU and GPU, I am finding it difficult how zero-copy feature can be supported with peripheral devices like NIC. For example, Intel’s DPDK optimizes performance by using huge pages that allocate virtually + physically contiguous memory. Therefore, if I want to allocate shared virtual memory so that NIC, CPU and GPU all access same memory, I would need the shared virtual memory to be physically contiguous as well.

Unfortunately, I’ve confirmed that clSVMAlloc() does not allocate physically contiguous memory. Is there any possible way to allocate shared virtual memory, which is also physically contiguous? Also, is there any mmap-like function for SVM that I can use for huge pages that were previously allocated by the host?

Thank you,