Intel® Quartus® Prime Software
Intel® Quartus® Prime Design Software, Design Entry, Synthesis, Simulation, Verification, Timing Analysis, System Design (Platform Designer, formerly Qsys)
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
17268 Discussions

opencl program and kernel object limits + retaining buffers

Altera_Forum
Honored Contributor II
1,086 Views

Hi,  

 

I'm currently experiencing problems when creating a number of program objects under OpenCL, I'm getting "host out of memory" errors on a Stratix D5 FPGA. I believe that I may be hitting a limit in the Altera OpenCL implementation of 20, as the problem always occurs on the creation of the 21st kernel.  

 

Similarly the AOCL programming guide also seems to indicate that there is a limit on the number of kernels per FPGA device of 32. Is this the maximum number of kernels which can be on a FPGA simultaneously (ie in one aocx file) or is it the total number of kernel objects which can be created within an overall program? 

 

For both the program and kernel objects is it possible to increase these limits? If not are there reasons for setting them to these levels? And would it be possible to request an increase in a future release of the Altera OpenCL implementation? 

 

Similarly as I understand it all OpenCL buffers are wiped from the FPGA card memory during a reconfiguration (ie when loading a new aocx file). Is this correct? And if so would it be possible for this to be changed in a future release of the OpenCL implementation? 

 

Many thanks
0 Kudos
2 Replies
Altera_Forum
Honored Contributor II
375 Views

Regarding memory being wiped: these buffers are actually copied to the host side to preserve them so no need to worry about them being deleted/freed. However, this may incur some slight performance penalty when context switching between OpenCL programs. 

 

The limit of 32 kernels is per OpenCL program (aocx file). The limit of 20 OpenCL programs per host program. That is why you are seeing this error message. 

 

My recommendation is to try to squeeze more kernels per program, if at all possible. Future releases may increase the number of active OpenCL programs but this is not determined yet. We will take your comments into consideration.
0 Kudos
Altera_Forum
Honored Contributor II
375 Views

Swizzle,  

 

Many thanks for the response / clarification. re the buffers being copied to the host side I'd strongly urge you to examine this in future releases. For the kind of applications I'm interested in porting to these devices continually moving the data back and forward across the PCI bus will seriously degrade performance. We've seen this on the GPUs, it was crucial to keep the data resident on the card and only copy minimal amounts of data back and forward to avoid the PCIe overhead.  

 

I should probably be able to work around the 20 program limit in this current application, however, I do see this being an issue for some of the larger applications we have in mind.  

 

Regards 

 

 

--- Quote Start ---  

Regarding memory being wiped: these buffers are actually copied to the host side to preserve them so no need to worry about them being deleted/freed. However, this may incur some slight performance penalty when context switching between OpenCL programs. 

 

The limit of 32 kernels is per OpenCL program (aocx file). The limit of 20 OpenCL programs per host program. That is why you are seeing this error message. 

 

My recommendation is to try to squeeze more kernels per program, if at all possible. Future releases may increase the number of active OpenCL programs but this is not determined yet. We will take your comments into consideration. 

--- Quote End ---  

0 Kudos
Reply