Altera_Forum
Honored Contributor
7 years agoSmall mistake in clCreateBuffer crashes PCIe
I made a really simple mistake. I have created a 16 byte buffer but transfered 24 bytes to FPGA global memory. This was crashing the PCIe. I have to restart the entire system because of this small error. The run time drivers of OpenCL SDK are really unstable.
//Assign 16 bytes of memory in FPGA DDR sample_buf = clCreateBuffer(context, CL_MEM_READ_ONLY, 2* sizeof(char), NULL, &status); checkError(status, "Failed to create buffer for sample in FPGA"); //Transfer 24 bytes of memory to FPGA DDR status = clEnqueueWriteBuffer(que_sample, sample_buf, CL_TRUE, 0, 3*sizeof(char), sample_buf_cpu, 0, NULL, NULL); checkError(status, "Failed to transfer sample_buf_cpu");