
32
•
Installing Xtium2-CXP PX8
Xtium2-CXP PX8 User's Manual
Configuring Sapera
The Sapera configuration program (Start • Programs • Teledyne DALSA • Sapera LT •
Sapera Configuration) allows the user to see all available Sapera servers for the installed
Sapera-compatible boards. The System entry represents the system server. It corresponds to the
host machine (your computer) and is the only server that should always be present.
Increasing Contiguous Memory for Sapera Resources
The Contiguous Memory section lets the user specify the total amount of contiguous memory (a
block of physical memory, occupying consecutive addresses) reserved for the resources needed for
Sapera buffers allocation and Sapera messaging. For both items, the Requested value dialog
box shows the ‘CorMem’ driver default memory setting while the Allocated value displays the
amount of contiguous memory allocated successfully. The default values will generally satisfy the
needs of most applications.
The Buffers Allocation (Legacy) and (64-bit) value determines the total amount of contiguous
memory reserved at boot time for the allocation of dynamic resources used for frame buffer
management such as scatter-gather list, DMA descriptor tables plus other kernel needs. We
recommend using the 64-bit choice for the Xtium2-CXP PX8 in order to reserve this memory
anywhere in PC memory and not just limited to the 1
st
4GB of physical memory as would be the
case using the Legacy one. Adjust this value higher if your application generates any out-of-
memory error while allocating host frame buffers or when connecting the buffers via a transfer
object. You can approximate the worst-case scenario amount of contiguous memory required as
follows:
•
Calculate the total amount of host memory used for one frame buffer
[number of pixels per line • number of lines • (2 - if buffer is 10/12/14 or 16 bits)].
•
Provide 200 bytes per frame buffer for Sapera buffer resources.
•
Provide 64 bytes per frame buffer for metadata. Memory for this data is reserved in chunks of
64kB blocks.
•
Provide 48 bytes per frame buffer for buffer management. Memory for this data is reserved in
chunks of 64kB blocks.
•
For each frame buffer DMA table, allocate 24 bytes + 8 bytes for each 4kB of buffer. For
example, for a 120x50x8 image: 120x50 = 6000 = 1.46 4kB blocks -> roundup to 2 4kB
blocks. Therefore 24 bytes + (2 * 8 bytes) = 40 bytes for DMA tables per frame buffer. Memory
for this data is reserved in chunks of 64kB blocks. If vertical flipping is enabled, one must add
16 bytes per line per buffer. For example, for an image 4080x3072 image: 16 bytes * 3072 =
49152 bytes.
Note 1: Sapera LT reserves the 1
st
5MB for its own resources, which includes the 200 bytes per frame buffer
mentioned above.
Note 2: Starting with Sapera LT 8.40, contiguous memory can be allocated anywhere in PC memory using the
‘Buffer Allocation (64-bit)’ entry in Sapera Configuration Tool. The driver will use this memory 1
st
for frame buffer
DMA tables.
•
Test for any memory error when allocating host buffers. Simply use the Buffer menu of the
) to allocate the number of host buffers
required for your acquisition source. Feel free to test the maximum limit of host buffers possible
on your host system – the Sapera Grab demo will not crash when the requested number of host
frame buffers is not allocated.
•
The following calculation is an example of the amount of contiguous memory to reserve beyond
5MB with 80,000 buffers of 2048x1024x8:
a) (80000 * 64 bytes)
b) (80000 * 48 bytes)
c) (80000 * (24 + (((2048*1024)/4kB) * 8))) = 323MB
d) Total = a (rounded up to nearest 64kB) + b (rounded up to nearest 64kB) + c
(rounded up to nearest 64kB).