cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

richeek_arya
Journeyman III

Question Regarding CL_DEVICE_MAX_MEM_ALLOC_SIZE

Conceptual question regarding memory management

Hi,

I am using ATI Radeon 5450 which has 1GB of video memory. When I call clGetDeviceInfo with CL_DEVICE_GLOBAL_MEM_SIZE I get around 512MB consequnetly CL_DEVICE_MAX_MEM_ALLOC_SIZE comes around 128MB. I have three questions here:

1. Is global memory not same as Video RAM? Or else why am I not getting 1GB as the output of CL_DEVICE_GLOBAL_MEM_SIZE?

2. When I try to create an array of size 138MB I get an error of CL_INVALID_BUFFER_SIZE which I think in this case means that buffer is too large to be allocated. Is it because CL_DEVICE_MAX_ALLOC_SIZE is 128MB? But according to the spec it is the MINIMUM value of memory allocation. What is the ceil value for it?

3. If I create buffer with CL_MEM_ALLOC_HOST_PTR which uses pinned host memory then also I am unsuccesful in creating the buffer. In this case since the buffer is created on the Host itself why does it not succeed? Is there a way to know maximum amount of host pinned memory too?

Thanks for patiently reading through the message!

Regards,

Richeek

0 Likes
6 Replies
nou
Exemplar

1. yes global memory is currently limited to half of normal memory. AMD is working to enable whole memory for OpenCL

2. yes it is too large.

3. limit of CL_DEVICE_MAX_ALLOC_SIZE still apply.

0 Likes

Originally posted by: nou

 

2. yes it is too large.

 

 

 

Thanks for your reply nou. Do you know the max value for MAX_ALLOC_SIZE?

0 Likes

If you need more space, you can allocate images. You can allocate an image with up to 1GB of space in a single image, and the half of available memory thing only applies to global memory. However, images are also more restrictive than global memory, as you can only read from or write to an image (not both) in the same kernel.

0 Likes

Originally posted by: rick.weber If you need more space, you can allocate images. You can allocate an image with up to 1GB of space in a single image, and the half of available memory thing only applies to global memory. However, images are also more restrictive than global memory, as you can only read from or write to an image (not both) in the same kernel.

 

Ok I will check that out. Thank u very much for the suggestion.

0 Likes

OpenCL specify only minimum value which is 128MB or 1/4 of size of global memory. it takes larger value from this two.

0 Likes

Originally posted by: richeek.arya Thanks for your reply nou. Do you know the max value for MAX_ALLOC_SIZE?

 

If the runtime reports back 128 MiB, then that is the maximum supported by that device.  The spec only says that devices must support a maximum that is at least 128 MiB.

Jeff

0 Likes