UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Visitor rettkjjk
Visitor
5,532 Views
Registered: ‎06-04-2014

Unable to send data greater than 8MB

Hi,

 

I am using SDSoC 2016.1 with the Zedboard.

 

I am facing the following problem. I exchange data between the ARM processor and an

accelerator. I allocated successfully memory using malloc() instead of sds_alloc(), since my data 

is greater than 4 MB

However, when I run the program, the system crashes with the following error message:

ERROR: Unable to send buffer greater than 8MB over sg_dma that is not allocated through sds_alloc()

              Either allocate this buffer using sds_alloc(), or copy this buffer into an sds_allocated buffer before transfer.

 

My main contains the following call of the function:

A = (int *)malloc( (width-8)*(height-8)*9* sizeof(int)); //3146976 * sizeof(int)
if(A != NULL){
       printf("A is allocated.\n");
}else{
       return 0;
}

B = (int *)malloc( (width-8)*(height-8)*9* sizeof(int)); //3146976 * sizeof(int)
f(B != NULL){
       printf("B is allocated.\n");
}else{
       return 0;
}

func(A,B); //function that is accelerated
 

My header file contains the following code:

#pragma SDS data access_pattern(A:SEQUENTIAL, B:SEQUENTIAL)

#pragma SDS data data_mover(A:AXIDMA_SG, B:AXIDMA_SG)

void func(
         int A[width*height],
	  int B[width*height]);

 

 

So if you have any ideas or helps to solve this problem, I appreciate this. 

0 Kudos
6 Replies
Visitor rettkjjk
Visitor
5,508 Views
Registered: ‎06-04-2014

Re: Unable to send data greater than 8MB

Actually, my code for the header is wrong. It should be:

#pragma SDS data access_pattern(A:SEQUENTIAL, B:SEQUENTIAL)

#pragma SDS data data_mover(A:AXIDMA_SG, B:AXIDMA_SG)

void func(
         int *A,
	  int *B);
0 Kudos
Teacher muzaffer
Teacher
5,499 Views
Registered: ‎03-31-2012

Re: Unable to send data greater than 8MB

>> I allocated successfully memory using malloc() instead of sds_alloc(), since my data is greater than 4 MB

>> However, when I run the program, the system crashes with the following error message:

>> ERROR: Unable to send buffer greater than 8MB over sg_dma that is not allocated through sds_alloc()

              Either allocate this buffer using sds_alloc(), or copy this buffer into an sds_allocated buffer before transfer.

 

So there is an api which has a limitation, you ignore the limitation and the api fails with an error code. I am not sure what else you were expecting.

 

To solve your problem, I suggest that you divide your data in chunks of 4MB and transfer sequentially. The extra overhead will be negligible.

I am not familiar with your design but I can't help wonder where in FPGA you are sending this 8 MB of data. 

- Please mark the Answer as "Accept as solution" if information provided is helpful.
Give Kudos to a post which you think is helpful and reply oriented.
0 Kudos
Visitor rettkjjk
Visitor
5,493 Views
Registered: ‎06-04-2014

Re: Unable to send data greater than 8MB

According to the UG1027, it is possible to transfer data larger than 8 MB with the scatter-gather DMA. Unfortunately, there is a bug with sds_alloc(). It has a limitation in allocating memory as it is described in this post

https://forums.xilinx.com/t5/SDSoC-Development-Environment/sds-alloc-error-with-big-arrays/td-p/706581

 

However, there should be a workaround with malloc(), when I understood this correctly. I tried it with malloc() and I got this error message.

0 Kudos
Xilinx Employee
Xilinx Employee
5,481 Views
Registered: ‎06-29-2015

Re: Unable to send data greater than 8MB

Hi rettkjjk,

 

There also apears to be a problem with the malloc/sg_dma path also (as you have clearly pointed out) with a limit as described by the error message you get of 8MB. Which means that 2016.1 has the following limits (when using Linux as the OS):

 

4MB - using sds_alloc() or sds_alloc_non_cacheable()  and simple_dma or sg_dma

 

8MB - using malloc() and sg_dma

 

And version 2015.4 has the following limits:

 

~256MB - using sds_alloc() or sds_alloc_non_cacheable()  and simple_dma (up to 8MB) or sg_dma

 

8MB - using malloc() and sg_dma

 

You can expect the sds_alloc()/sds_alloc_non_cacheable() limits to be much better in 2016.2, this is something that obviously needs fixed.

 

So if you need to move forward immediately, you can move back to 2015.4 with sds_alloc. And when 2016.2 is release jump forward to that and continue using sds_alloc.


Sam

0 Kudos
Participant eejlny
Participant
4,640 Views
Registered: ‎05-05-2015

Re: Unable to send data greater than 8MB

I am trying the latest version 2016.2 and I think the limitation of 4 MB sds_alloc is still there.

 

I wonder if someone could confirm ? 

0 Kudos
Xilinx Employee
Xilinx Employee
4,616 Views
Registered: ‎06-07-2016

Re: Unable to send data greater than 8MB

Hi Eejlny,

 

I have personally tested this and I can confirm that arrays > 8MB will work in SDSoC 2016.2. 

 

If you are seeing an error you don't understand feel free to start a new thread.

 

Best,

--Dutch

0 Kudos