Hi,
I stumbled on some interesting behaviour w.r.t. allocating memory that I was hoping someone could shed some light on. I've written a simple program that shows the behaviour (I'm happy to provide it, but I imagine the behaviour might differ across systems based on the available memory).
my specs are:
GPU: Intel HD 5500
OS: Windows 10
Driver Version: 10.18.15.4281
Host memory: 8 GB
The program is very simple: First I allocate a large chunk of host memory using malloc (or calloc). I then attempt to allocate several large OpenCL global memory buffers. Usually after two calls to clCreateBuffer, I get an CL_MEM_OBJECT_ALLOCATION_FAILURE. However, sometimes the program runs to completion without error (rarely).
I've been careful not to allocate more OpenCL global memory at a time than DEVICE_MAX_MEM_ALLOC_SIZE and in total not more than CL_DEVICE_GLOBAL_MEM_SIZE. Also, I've checked that the host has sufficient free memory for the host allocations when the program is run (using the device manager) and I check that those calls succeed.
The machine also has a small Nvidia GPU (with less global memory than the Intel GPU). The program is able to reliably run without error when targeting the Nvidia GPU.
Any help would be greatly appreciated, thanks!