Intel® Quartus® Prime Software
Intel® Quartus® Prime Design Software, Design Entry, Synthesis, Simulation, Verification, Timing Analysis, System Design (Platform Designer, formerly Qsys)
Intel Support hours are Monday-Fridays, 8am-5pm PST, except Holidays. Thanks to our community members who provide support during our down time or before we get to your questions. We appreciate you!

Need Forum Guidance? Click here
Search our FPGA Knowledge Articles here.
15388 Discussions

host: acl_mem.c:390: acl_bind_buffer_to_device: Assertion `mem' failed.


My host has 16GB RAM and FPGA also has 16GB RAM.

in my code, I try to create buffer and write data to buffer 16 times, every time will use 1 GB then release it.

for(int i=0; i<16; i++){ device_mem = clCreateBuffer(context, CL_MEM_READ_WRITE, GB, NULL, NULL); err = clEnqueueReadBuffer(queue, device_mem, CL_TRUE, 0, chunk, device_data, 0, NULL, NULL); clReleaseMemObject(device_mem); }

but I will get

host: acl_mem.c:390: acl_bind_buffer_to_device: Assertion `mem' failed.


P.S. It work well if I create and release device_mem outside the loop.

0 Kudos
1 Reply
Valued Contributor II

You have defined your buffer size as "GB", is this expected? In which iteration do you get the error? There is no guarantee you would be able to allocate 16 GB on the device since parts of the device memory could be reserved for other operations.