cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

borsanyi
Journeyman III

clEnqueueMakeBuffersResidentAMD

Dear Developers,

I am playing with a pair of gfx900 cards (amd rx radeon vega 56)  connected over pcie3 in an ubuntu linux box.

Goal is that the two cards communicate.

The call clEnqueueMakeBuffersResidentAMD is supposed to fill in the cl_bus_address_amd structure.

(which I initialized to zero, before the call)

Well after the this call, both integers in cl_bus_address_amd are still zero, so I cannot proceed to initialize the write

buffers on the writer gpu.

From the following code piece you should have an idea what I am doing:

void device_alloc_resident(struct device *D,cl_mem *ptr,cl_bus_address_amd *bus_address,size_t bytes)/*{{{*/

{

    cl_int r;

    cl_mem buffer=clCreateBuffer(D->context,CL_MEM_READ_WRITE|CL_MEM_BUS_ADDRESSABLE_AMD,bytes,NULL,&r);

    opencl_error_check(r);

    r=clEnqueueMigrateMemObjects(D->queue,1,&buffer,CL_MIGRATE_MEM_OBJECT_CONTENT_UNDEFINED,0,NULL,NULL);

    if(r!=CL_SUCCESS) {

        errx(1,"Device memory allocation has failed %s",opencl_strerror(r));

    }

    printf("pre addressess %lu %lu\n",bus_address->surface_bus_address,bus_address->marker_bus_address);

    clEnqueueMakeBuffersResidentAMD(D->queue,1,&buffer,CL_TRUE,bus_address,0,NULL,NULL) CLCHK;

    printf("post addressess %lu %lu\n",bus_address->surface_bus_address,bus_address->marker_bus_address);

    *ptr=buffer;

    D->mem_usage+=bytes;

    clFinish(D->queue);

}/*}}}*/

both printfs write 0 0

thanks.

0 Likes
1 Reply
dipak
Big Boss

Hi,

This API works on AMD GPU with the DirectGMA feature enabled and currently, DirectGMA is supported only on selected FirePro cards.

Regards

0 Likes