Description
The CL_DEVICE_MAX_MEM_ALLOC_SIZE
on Intel Arc GPUs is currently set to 4GB (A770 16GB) and 3.86GB (A750). Trying to allocate larger buffers makes the cl::Buffer
constructor return error -61
. Disabling the error by setting buffer flag (1<<23)
during allocation turns compute results into nonsense when the buffer size is larger than 4GB.
This is likely related to 32-bit integer overflow in index calculation.
A 4GB limit on buffer allocation is not contemporary in 2023, especially on a 16GB GPU; it's not 2003 anymore where computers were limited to 32-bit. A lot of software needs to be able to allocate larger buffers in order to fully use the available VRAM capacity. FluidX3D for example needs up to 82% of VRAM in a single buffer; if the allocation limit is 25% on the A770 16GB, only 4.9GB of the 16GB can be used by the software.
The limit should be removed altogether, by setting CL_DEVICE_MAX_MEM_ALLOC_SIZE
= CL_DEVICE_GLOBAL_MEM_SIZE
= 100% of physical VRAM capacity, and making sure that array indices are computed with 64-bit integers. Nvidia and AMD both allow full VRAM allocation in a single buffer for a long time already.