6
votes

I have read that there's a limit to the maximum memory allocation to around 60% of device memory, and these can be changed by modifying the GPU_MAX_HEAP_SIZE and GPU_MAX_ALLOC_SIZE environment variables for GPU.

I am wonder if the AMD SDK has something similar for the CPU if I want to raise the limit of memory allocation?

For my current configuration, it returns the following:

CL_DEVICE_MAX_MEM_ALLOC_SIZE = 2973.37MB

CL_DEVI_CEGLOBAL_MEM_SIZE = 11893.5MB

Thanks.

1
It's 25% by default actually. Apparently, CPU_MAX_HEAP_SIZE is "not supported at all", which is admittedly a little weird... if you are using an Intel CPU, you could try the Intel OpenCL SDK which has the ability to do that, iirc. - Thomas

1 Answers

2
votes

I was able to change this on my system. I don't know if this method was possible when you originally asked the question.

set the environment variable 'CPU_MAX_ALLOC_PERCENT' to the percentage of total memory you want to be able to allocate for a single global buffer. I have 8GB system memory, and after setting CPU_MAX_ALLOC_PERCENT to 80, clinfo reports the following:

Max memory allocation:                         6871207116

Success! 6.399GB

You can also use GPU_MAX_ALLOC_PERCENT in the same way for your GPU devices.