cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Anonymous
Not applicable
7,650 Views

sds_alloc error with big arrays

Jump to solution

I get the following error when I execute my application on zedboard.

 

ERROR: No virtual to physical mapping found; Make sure all arrays passed to the zero copy datamover are allocated with sds_alloc

 

I have allocated my arrays with sds_alloc. The same application works for smaller input size (768KB) but for bigger arrays (2MB) it gives this error. I also have a check to see if allocation was successful, so no problem with allocation as well. Any idea what might be the problem?

0 Kudos
Reply
1 Solution

Accepted Solutions
Xilinx Employee
Xilinx Employee
12,973 Views
Registered: ‎06-29-2015

Hi,

 

There is currently a 4MB minus one page (4KB) size limitation when using sds_alloc() and sds_alloc_non_cacheable() in 2016.1. As in, you cannot allocate anything larger than 4190208 bytes (4MB - 4KB). When you allocate the 1920x1080x4 (float) buffer you're asking for 8294400 bytes, which is larger than this limit. It it definately a bug that the allocation succeeds and doesnt return NULL (as you checked). And the 4MB limit is not very nice either. 

 

Both of these may be addressed in a future release.

 

In the meantime, the only work around for large buffers is to use malloc() and Scatter/Gather DMAs. 

 

Sam

 

View solution in original post

6 Replies
Xilinx Employee
Xilinx Employee
7,605 Views
Registered: ‎06-29-2015

Hi,

 

Can you show a code sample that demos how you allocating, using, and freeing the buffers?

 

Sam

0 Kudos
Reply
Anonymous
Not applicable
7,599 Views

I am allocating the image as:

 

image = (unsigned char *) sds_alloc( rows*cols*sizeof(unsigned char) );
if( image == NULL )
{
    fprintf(stderr, "Error allocating image.\n");
    exit(-1);
}

tempim = (float*) sds_alloc_non_cacheable( rows*cols*sizeof(float) );
if( (tempim) == NULL )
{
    fprintf(stderr, "Error allocating tempim.\n");
    exit(1);
}

I am freeing this image as:

 

 

 

sds_free(image);
sds_free(tempim);

 

 

This is how i am calling hardware function:

 

kernel(image, tempim);


This is how I am declaring my kernel

 

 

#pragma SDS data copy(image[0:HWROWS*HWCOLS])
#pragma SDS data zero_copy(tempim[0:HWROWS*HWCOLS])
#pragma SDS data access_pattern(image:SEQUENTIAL)
int kernel(unsigned char *image, float *tempim);

 

This works upto 1024X768 image. but if I make it 1920X1080, I get the error at run time.

ERROR: No virtual to physical mapping found; Make sure all arrays passed to the zero copy datamover are allocated with sds_alloc

 

0 Kudos
Reply
Xilinx Employee
Xilinx Employee
12,974 Views
Registered: ‎06-29-2015

Hi,

 

There is currently a 4MB minus one page (4KB) size limitation when using sds_alloc() and sds_alloc_non_cacheable() in 2016.1. As in, you cannot allocate anything larger than 4190208 bytes (4MB - 4KB). When you allocate the 1920x1080x4 (float) buffer you're asking for 8294400 bytes, which is larger than this limit. It it definately a bug that the allocation succeeds and doesnt return NULL (as you checked). And the 4MB limit is not very nice either. 

 

Both of these may be addressed in a future release.

 

In the meantime, the only work around for large buffers is to use malloc() and Scatter/Gather DMAs. 

 

Sam

 

View solution in original post

Anonymous
Not applicable
7,516 Views
Thanks for the clarification.
0 Kudos
Reply
Visitor
Visitor
7,502 Views
Registered: ‎06-04-2014

Hi,

 

I have a similar problem. I receive data (12 MB) from an accelerator.

I allocated successfully memory using malloc():

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

 

and configured the data mover

to AXIDMA_SG by inserting:


#pragma SDS data data_mover(A:AXIDMA_SG)

 

In addition, I used the following pragma for sequential access:

 #pragma SDS data access_pattern(A:SEQUENTIAL)

 

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 if you have any ideas or helps to solve this problem, I appreciate this. 

 

0 Kudos
Reply
Xilinx Employee
Xilinx Employee
7,465 Views
Registered: ‎06-29-2015

Hi rettkjjk,

 

Please start a new thread since the problem you're experiencing is different from the actual problem found in this thread. I will respond to your post in this new thread after you open it.

 

When you do start the new thread, please state the version of the tools that you're using and post some source code showing exactly how your hardware function is specified (with the pragmas).

 

Thanks!
Sam

0 Kudos
Reply